From the standpoint of medical services, a disaster is a calamitous event resulting in an unexpected number of casualties that exceeds the therapeutic capacities of medical services. In these situations, effective medical response plays a crucial role in saving life. To model medical rescue activities, a two-priority non-preemptive S-server, and a finite capacity queueing system is considered. After constructing Chapman-Kolmogorov differential equations, Pontryagin's minimum principle is used to calculate optimal treatment rates for each priority class. The performance criterion is to minimize both the expected value of the square of the difference between the number of servers and the number of patients in the system, and also the cost of serving these patients over a determined time period. The performance criterion also includes a final time cost related to deviations from the determined value of the desired queue length. The two point boundary value problem is numerically solved for different arrival rate patterns and selected parameters.