Drug inventory management is an important part of hospital management. The large amounts of drug data in hospitals bring challenges to optimizing the setting values for the safety stock and the maximum inventory of each drug. This study combined a two-stage clustering method with an inventory policy (s, S) and established a simulation optimization model for the case hospital’s outpatient pharmacy. This research used the simulation optimization software Arena OptQuest, developed by Rockwell Automation Inc. (Rockwell Automation, Coraopolis, PA, USA), in order to determine the minimum and maximum values (s, S) of the best stock amounts for each drug under the considerations of cost and related inventory constraints. The research results showed that the minimum and maximum inventory settings for each drug in the simulation model were better than those set by the case outpatient pharmacy system. The average inventory cost was reduced by 55%, while the average inventory volume was reduced by 68%. The proposed method can improve management efficiency and inventory costs of hospital pharmacies without affecting patient services and increasing the inventory turnover rate of the drugs.