The patient assignment problem: complexity and planning in a dynamic context