With the implementation of the policy of the separation of prescribing and dispensing, many public hospitals have separate drug supply and medical services. Against this backdrop, this paper considers the competitive game among multiple public hospitals of service capabilities to maximize patient utility under limited service capacity constraints and given drug pricing. Firstly, considering the competition between two hospitals, we adopt the Hotelling model to describe the distribution of hospitals and patients, investigate the boundedly rational behavior of location-heterogeneous patients, and consider compensating for the hospital's revenue loss due to the separation of prescribing and dispensing through government subsidies. We prove the existence, uniqueness, and stability of equilibrium strategies in the competition for service capabilities. Secondly, we expand our research to the competition among multiple hospitals under the Salop model. We find that an increase in the number of hospitals in the market or an increase in government subsidies for hospitals does not necessarily increase patient welfare. There exist corresponding thresholds such that when the number of hospitals or government subsidies exceeds this threshold, patient welfare decreases with the increase in the number of medical institutions and government subsidies. Furthermore, in the context of competition among public hospitals' service capabilities, we analyze the drug pricing of drug providers, use the Taylor formula to obtain the approximate optimal pricing, and numerically prove the effectiveness of this approximation method. This paper sheds light on how to design a healthcare system after the separation of prescribing and dispensing.