A Nonlinear Programming Algorithm for Hospital Management