The phenomenon of queues that we often see is hospital service queues. Considering the current unpredictable weather, many patients are seeking treatment at hospitals. Queues at hospitals occur not only during the registration and doctor's examination processes but also while waiting for medication. This article will model the general patient prescription service system at X hospital in Malang City. The goal is to understand how the service sistem works, which will be modeled using Petri nets. Petri nets are discrete event systems that can model queues. In this study, 11 places and 11 transitions were obtained after modifying the flow to save waiting time. It is hoped that this research will be one of the considerations to improve services, especially for general patient prescription services, so that patients do not have to wait too long to receive their medication. A system or application is needed between the hospital pharmacy and the examining doctor so that prescriptions can be confirmed in real-time. The petri net model was simulated using Petri Net Simulator. The resulting Petri net model is also represented in forward, backward, and incidence matrices to obtain its max-plus algebra for further research