We consider the dynamic patient scheduling for the hospital surgery department with electronic health records. Models for increasing the throughput of the surgery are proposed. It is based on classical intellectual optimization problems, such as the assignment problem, the scheduling problem, and the forecasting problem. Various approaches to solving the proposed problem are investigated. The formalization of the surgery planning problem of the large medical hospital surgery department is considered.