An integrated task and personnel scheduling problem to optimize distributed services in hospitals