Introduction
The emergency department (ED) serves as the frontline of healthcare for millions, often experiencing challenges such as overcrowding, long wait times, and inefficient resource allocation. These issues can lead to delayed care, reduced patient satisfaction, and strained healthcare staff. Prolonged emergency department (ED) wait times have been associated with increased patient morbidity and mortality [1]Wretborn J, Wilhelms DB, Ekelund U. Emergency department crowding and mortality: an observational multicenter study in Sweden. Front Public Health. 2023;11:1198188. Published 2023 Jul 25. doi:10.3389/fpubh.2023.1198188. Timely and effective patient care in this high-pressure setting is critical.
Traditional patient flow management in emergency departments (EDs) often depends on manual monitoring and static forecasting models. For instance, forecasting daily attendance [2]Afilal, M., Yalaoui, F., Dugardin, F. et al. Forecasting the Emergency Department Patients Flow. J Med Syst 40, 175 (2016). https://doi.org/10.1007/s10916-016-0527-0 at an ED has been a key element for management strategies, aiming to optimize resource allocation. Additionally, discrete event simulation (DES) models [3]Doudareva, E., & Carter, M. (2022). Discrete event simulation for emergency department modelling: A systematic review of validation methods. Operations Research for Health Care, 32, 100340. https://doi.org/10.1016/j.orhc.2022.100340 have been employed to understand system bottlenecks and analyze resource capacity planning constraints in EDs. However, these models often require specialized knowledge and may not be easily accessible to non-technical hospital staff.
Our web-based ED Flow Simulation App [4]ED Flow Simulation App: Patient Flow Simulation · Streamlit is designed to provide hospitals with real-time insights into patient flow, enabling them to identify system inefficiencies and optimize resource allocation. By leveraging dynamic visualization and predictive analytics, the app supports emergency departments in making data-driven decisions to streamline operations and improve patient outcomes.
Methodology
To assess the effectiveness and reliability of the ED Flow Simulation App, a structured validation framework was implemented, incorporating real-world data benchmarking, comparative analysis with traditional methods, and scenario-based testing.
1. Validation Against Real-World Data
The app was evaluated using data from the MIMIC-III clinical database, which contains real patient flow records from emergency departments. This dataset served as a benchmark to assess the accuracy of the simulation in predicting patient wait times, treatment durations, and system bottlenecks. The comparison helped ensure that the app’s outputs closely aligned with observed ED performance.
2. Comparison with Traditional ED Flow Management Approaches
Conventional methods for managing patient flow in emergency departments typically rely on manual monitoring, spreadsheets, and static forecasting models. These approaches often lack adaptability and fail to capture dynamic changes in patient influx and resource availability. The ED Flow Simulation App provides a real-time, interactive alternative, enabling scenario testing and on-the-fly adjustments, features that traditional forecasting tools do not support.
3. Performance Evaluation Against Existing ED Simulation Tools
To gauge its comparative advantage, the ED Flow Simulation App was assessed alongside existing discrete event simulation (DES) models used in emergency medicine. Unlike many traditional DES tools that require specialized training and are often complex to operate, the app features an intuitive web-based interface with real-time visualization, making it accessible to hospital administrators and healthcare professionals without technical expertise.
4. Scenario-Based Testing and Reliability Assessment
A series of scenario-based simulations were conducted to evaluate the app’s robustness under varying ED conditions. Users could modify parameters [5]Demonstration Video: amsafoundation.org/wp-content/uploads/gravity_forms/10-064f01fce81edffc73cd6f84d381f529/2025/01/ED-Flow-Simulator-Demo.mp4 such as patient arrival rates, waiting room capacity, and treatment room availability to simulate diverse hospital settings. The app’s results were then cross-referenced with historical emergency department performance data to assess its predictive accuracy and overall reliability.
Technology
The ED Flow Simulation App is a web-based tool designed to model and analyze patient flow in emergency departments. By manually inputting specific details such as patient arrival rates, waiting room capacity, and treatment room capacity, the app generates real-time visualizations and predictive analytics. While the current app cannot be integrated with an electronic health record, future iterations may have this capability. The app offers customizable simulations that can be tailored to the unique needs of any hospital or department, ensuring flexibility and relevance across diverse healthcare settings. Dynamic visualization provides real-time graphical representations of patient movement through various stages of the ED, helping to identify congestion points and inefficiencies (Figure 1). Predictive analytics utilize data-driven models to forecast patient wait times, treatment durations, and resource utilization, providing actionable insights for administrators. The user interface, built with Streamlit, is easy to use and understand, making it simple for hospital staff to adjust settings and interpret results. Due to the adaptability, the system can expand beyond emergency departments, in other hospital units that face patient flow challenges.
The ED Flow Simulation App is developed using Python for backend processing and Streamlit for frontend visualization, ensuring an interactive and user-friendly interface. It is designed to model the complex workflows of an emergency department. The simulation covers key stages of patient flow, including arrival, waiting, treatment, and exit. The app’s current version allows for three customizations: arrival rate, waiting room capacity, and treatment room capacity (Figure 1). Cloud-based data storage ensures privacy compliance and allows integration with hospital information systems.

Figure 1 Summary Dashboard of ED Flow Simulation
An example of one of many options for post-simulation reporting in the ED Flow Simulation App. The settings shown on the left can be adjusted to fit the specifics of any department, and the outputs range in specificity from Room overviews and density status to individual patient reports of time spent in each step of the care cycle. The output shown in the figure demonstrates variability in wait times, treatment times, and total time in the encounter (colored lines) by patient ID (x-axis). In this simulation, there is significant variability in waiting time, while treatment time is fairly consistent across patients.
Demonstration
The live demonstration of the ED Flow Simulation App provides an immersive experience of its capabilities. Users can input hospital data and observe the simulation as it generates a detailed patient flow outline. Scenario-based simulations place users in the role of hospital administrators, tasked with identifying bottlenecks and improving efficiency. The app outputs essential performance indicators, such as room occupancy, patient wait times, and resource allocation effectiveness. The simulation results offer clear, actionable insights that healthcare providers can use to implement practical solutions, fostering data-driven decision-making. For example, the app can identify large variations in wait times despite fairly consistent treatment times (Figure 1). The manage this, the user can both enter additional system information to better tailor the simulation to their institution and manipulate those inputs to simulate where changes can have the most effect on wait time.
Impact and Future Ambitions
The ED Flow Simulation App offers tangible benefits for emergency departments by reducing wait times, improving resource allocation, and enhancing overall patient care. The current version of the app is fully functional, and there are plans to improve it further. Future updates will allow more customization to model different hospital departments. The metrics dashboard will be enhanced to provide more detailed and useful insights. The app will also expand its analysis to cover more stages of patient flow. Additionally, machine learning algorithms will be added to improve predictions and make the app more adaptable. These improvements will help healthcare administrators optimize hospital operations more effectively. The next phase of development includes expanding the simulation capabilities to cover a wider range of healthcare systems and hospital departments worldwide.
References
- Wretborn J, Wilhelms DB, Ekelund U. Emergency department crowding and mortality: an observational multicenter study in Sweden. Front Public Health. 2023;11:1198188. Published 2023 Jul 25. doi:10.3389/fpubh.2023.1198188
- Afilal, M., Yalaoui, F., Dugardin, F. et al. Forecasting the Emergency Department Patients Flow. J Med Syst 40, 175 (2016). https://doi.org/10.1007/s10916-016-0527-0
- Doudareva, E., & Carter, M. (2022). Discrete event simulation for emergency department modelling: A systematic review of validation methods. Operations Research for Health Care, 32, 100340. https://doi.org/10.1016/j.orhc.2022.100340
- ED Flow Simulation App: Patient Flow Simulation · Streamlit
- Demonstration Video: amsafoundation.org/wp-content/uploads/gravity_forms/10-064f01fce81edffc73cd6f84d381f529/2025/01/ED-Flow-Simulator-Demo.mp4