An emergency room congestion assessment system based on discrete event simulation
By constructing an emergency congestion assessment system based on discrete event simulation, modularly modeling the entire emergency process and embedding a dynamic adjustment mechanism, the problem of insufficient dynamic simulation of the entire emergency process in existing technologies is solved, and effective support for the optimal allocation of emergency resources and congestion management is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INST OF TECH
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies have failed to achieve dynamic simulation modeling of the entire emergency process, lacking accurate simulation of dynamic behaviors such as differentiated patient arrival, escalation of condition, and leaving without receiving services (LWBS), making it difficult to provide effective support for optimizing emergency resource allocation and managing congestion.
An emergency congestion assessment system based on discrete event simulation was constructed. Using Python development tools, the system modularly models the arrival, triage, registration, diagnosis, examination and treatment of emergency patients. It embeds patient condition classification, resource coordination and dynamic adjustment mechanisms to achieve full-process simulation and multi-dimensional indicator output.
It accurately simulates the dynamic operation of the emergency system, improves the simulation fit, provides multi-dimensional indicator evaluation and visualization support, optimizes resource allocation, and improves the congestion situation in the emergency room.
Smart Images

Figure CN122201676A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical system simulation and computer application technology, specifically to an emergency congestion assessment system based on discrete event simulation. Background Technology
[0002] Emergency room congestion leads to a chain of problems, including prolonged patient waiting times, reduced quality of medical services, and increased workload and psychological stress for healthcare workers, becoming a significant bottleneck restricting the high-quality development of the healthcare service system. To study emergency room congestion and optimize resource allocation, existing technologies widely employ system simulation methods to model and analyze emergency room processes. Discrete event simulation, as a mainstream technique, extracts key events in the emergency system such as patient arrival, resource scheduling, and service execution to construct dynamic models that recreate the system's operational characteristics, providing research support for process optimization. Currently, related research and applications mainly focus on the following directions:
[0003] One approach is process modeling based on general simulation tools. This involves using commercial simulation software such as Flexsim, AnyLogic, and Simul8 to build an emergency system model that includes registration, triage, diagnosis, and examination. By adjusting parameters such as the number of doctors and the configuration of examination rooms, the system performance under different resource scenarios can be simulated. This approach often relies on graphical modeling interfaces, which can quickly simulate basic processes. However, it lacks flexibility in handling complex logical couplings (such as dynamic changes in patient conditions and multi-resource collaborative scheduling) and personalized parameter configurations, making it difficult to accurately describe the dynamic characteristics of the emergency system.
[0004] Secondly, there are specialized optimization models for specific stages of the medical process. For example, there is an emergency triage scheduling method based on queuing theory. This method constructs a patient waiting queue model, determines the priority of treatment based on triage level, and accurately allocates medical resources, focusing on optimizing the triage process. While this approach can improve the response speed of the triage process, it does not cover all aspects of the entire process, such as patient arrival patterns, collaborative examination procedures, and dynamic evolution of the patient's condition.
[0005] Third, data-driven simulation optimization methods are used. Some studies collect historical emergency room data to construct statistical models such as patient arrival time distribution and service time distribution, and then build simulation models using programming languages such as Python or Java. For example, a Poisson process is used to simulate patient arrival, and a normal or exponential distribution is used to simulate service time, thereby analyzing the impact of resource allocation on system efficiency.
[0006] Furthermore, current assessments of emergency department congestion largely rely on single indicators such as average waiting time and bed occupancy rate, failing to achieve a comprehensive measurement of emergency department congestion through multiple congestion indicators. Although some studies have introduced comprehensive indicators such as NEDOCS (National Emergency Department Overcrowding Scale) and EDWIN (Emergency Department Work Index), a complete framework from data collection and indicator calculation to visualization has not been established, making it difficult to intuitively reflect the dynamic fluctuations in congestion status.
[0007] In their paper "Simulation and Optimization of Emergency Department Treatment Process Based on Flexsim [J]. Journal of Qilu University of Technology, 2024, 38 (01): 1-11," Kan Changqing et al. proposed a simulation and optimization scheme for the emergency department treatment process based on Flexsim software. Their research first obtained data on arrival time and service time of patients at various levels in the emergency department of a tertiary hospital through field surveys. The input data was then processed using mathematical statistics methods such as the Kolmogorov-Smirnov goodness-of-fit test, verifying that the arrival time intervals of patients at various levels conformed to an exponential distribution and determining the corresponding distribution parameters. Subsequently, a simulation model was constructed using Flexsim software, corresponding entities such as the generator, temporary storage area, sorting conveyor belt, and processor in the software to real system elements such as patient arrival, waiting area, triage station, and treatment resources, simulating the entire process of patient triage, treatment, and diversion. Simulation identified resource bottlenecks, such as overcrowding in waiting areas for level 3 and 4 patients (general outpatient bed occupancy rate approaching 100%), shortage of inpatient beds for level 2 patients (occupancy rate exceeding 99%), and wasted resources in emergency beds for level 1 patients (occupancy rate below 18.5%). To address these bottlenecks, optimization schemes were proposed, including increasing the number of general outpatient beds and adjusting the allocation of emergency beds and waiting beds for level 1 patients. Simulation verification showed that the optimizations effectively eliminated overcrowding and shortened patient waiting times.
[0008] In their paper "A Study on the Order of Initial and Follow-up Patients in Emergency Department Based on Discrete Event Simulation [J]. Chinese Hospital, 2017, 21 (02): 54-57," Deng Yewen et al. used discrete event simulation to study the order of initial and follow-up patients based on data from emergency internal medicine patients in a tertiary hospital in Shanghai from 2014 to 2015. The study analyzed the distribution of patient arrival time and service time using SPSS statistical software, finding that the arrival of initial patients approximately followed a Poisson distribution with morning and evening peaks. The service times for initial and follow-up patients were approximately triangularly distributed with a mode of 7 minutes and 3 minutes, respectively. A simulation model was built using Arena software to simulate the patient flow, focusing on evaluating the impact of 12 different call-number ratio strategies for initial and follow-up patients on indicators such as average waiting time, emergency room stay time, and average number of patients in the emergency room. The results showed that when initial and follow-up patients were called in a 1:1 ratio, the overall average waiting time was the shortest, and the average number of patients in the system was the smallest, effectively improving the crowded and disorderly situation in the consultation room and providing a basis for the implementation of an electronic queuing system in the emergency department.
[0009] In their paper "Research on Emergency Patient Scheduling Based on Simulation [J]. Computer Simulation, 2021, 38 (07): 467-474," Zhou Xin et al. used Anylogic software to construct a simulation model of the emergency department of a tertiary hospital in Shanghai and studied the impact of different patient scheduling strategies. The model covers processes such as pre-examination triage, initial consultation in the examination room, examination, follow-up consultation in the examination room, and patient diversion. It considers the classification characteristics of patients from level 1 to 4, with level 1 and some level 2 patients directly entering the resuscitation room without occupying internal medicine emergency room resources. The study designed various queue priority rules such as FCFS, EDT, WEDT, WEDTL, and PF, and proposed a secondary allocation strategy for medical resources, namely, a "green channel" examination room, which prioritizes the service of emergency patients in some examination rooms and accepts other patients when idle. By comparing the performance of different strategy combinations through simulation, it was found that the WEDTL rule combined with the "green channel" strategy can significantly improve the WTT target achievement rate of level II and III patients, maintain good responsiveness when the system load increases, provide more timely treatment for truly urgent patients, and balance the service needs of patients at all levels.
[0010] Therefore, existing technologies have not achieved dynamic simulation modeling of the entire emergency process, and lack accurate simulation of dynamic behaviors such as differentiated patient arrival, disease escalation, and LWBS. There is an urgent need to build a simulation model that takes into account completeness, dynamism, and accuracy, so as to provide more effective decision support for the optimal allocation of emergency resources and congestion management. Summary of the Invention
[0011] In view of this, the present invention provides an emergency congestion assessment system based on discrete event simulation, which can construct a simulation model that takes into account completeness, dynamism and accuracy, and provide more effective decision support for the optimal allocation of emergency resources and congestion management.
[0012] To achieve the above objectives, the present invention provides an emergency congestion assessment system based on discrete event simulation, the technical solution of which includes the following modules: The simulation parameter configuration module is used to provide basic operating environment configuration and core parameter adjustment for the entire simulation model.
[0013] The patient generation and arrival module adopts a time-segmented differentiated arrival mode for dual patient types to realize the generation logic of two types of patients: those arriving autonomously and those transported by ambulance. At the same time, it creates patient objects containing patient attribute information and connects to the simulation environment through a discrete event triggering mechanism.
[0014] The triage and pathway allocation module is used to classify patients by their condition level and allocate medical pathways accordingly, enabling differentiated medical pathway allocation for patients with different conditions.
[0015] The diagnosis and treatment service and resource collaboration module constructs the registration and diagnosis and treatment process, implements a closed-loop process of resource request, service execution and resource release, and embeds a behavior judgment mechanism for patients leaving LWBS without receiving services and a dynamic adjustment mechanism for their condition, so as to realize dynamic collaboration between the diagnosis and treatment process and resource allocation.
[0016] Furthermore, the specific procedure for emergency patients is as follows: Emergency patients are categorized into two types based on their mode of arrival: those who arrive independently and those transported by ambulance. Patients who arrive independently first enter the triage assessment stage after entering the emergency department. This triage assessment stage is conducted by the triage nurse, who classifies patients into five levels based on the Emergency Severity Index (ESI).
[0017] Because of the urgency of patients being transported by ambulance, the triage and assessment process is completed in advance during the pre-hospital transport. After arriving at the emergency room, the patient enters the subsequent treatment process.
[0018] Next, patients are placed into differentiated treatment channels according to the severity of their condition. Patients with severity levels 1 and 2 are placed into the rapid emergency channel for rescue, while patients with severity levels 3 to 5 are placed into the regular treatment channel for medical care.
[0019] Patients using the regular consultation channel need to wait to enter the consultation room after registering. During this period, there is a possibility that patients may leave LWBS without seeing a doctor or that their condition may worsen.
[0020] Patients using the rapid emergency access route are taken to the resuscitation room for treatment. In the emergency room, diagnosis and treatment and auxiliary examinations are completed according to the patient's condition. The auxiliary examinations include five types of auxiliary examinations: electrocardiogram, CT scan, X-ray, ultrasound, and laboratory tests. The probability of being selected for different auxiliary examinations varies. After all diagnosis and treatment and auxiliary examinations are completed, the patient will be admitted to one of four places: hospitalization, observation, ICU admission, or discharge.
[0021] Furthermore, the simulation parameter configuration module allocates four types of core parameters: time parameters, resource parameters, service distribution parameters, and decision parameters.
[0022] The time parameter is used to define the simulation time boundary, including the warm-up period and the effective simulation period, to obtain core simulation data while eliminating the interference of the initial state on the results; at the same time, a random seed is set to ensure the repeatability of the simulation results and to ensure that the initial random state is consistent under different runs.
[0023] Resource parameters are used to clarify the allocation of emergency medical resources. On the one hand, they cover the number of doctors and nurses in different shifts and positions, the number of space resources in resuscitation rooms, general clinics, observation beds, and ICU beds, as well as the number of related equipment such as electrocardiographs, X-ray machines, CT scanners, ultrasound machines, and laboratory testing equipment. The number of various resources is dynamically adjusted daily according to the three shifts of morning, noon, and evening to form a resource allocation plan for different time periods. On the other hand, they include the number of emergency resources required for patients at different triage levels during treatment.
[0024] Service parameters are used to clarify the service time distribution patterns of each service stage in the emergency department, specifically covering key stages such as patient arrival, registration, diagnosis and treatment, examination, and patient transfer to inpatient wards. Different service stages correspond to different time distribution types, and each distribution type matches the service time characteristics of the corresponding stage.
[0025] The decision parameters include multi-dimensional probability settings for patient visit decisions, providing a quantitative basis for the decision logic of the simulation model. Specifically, they cover the following five core probability configurations: First, the probability distribution of patient triage levels: the probability distribution clarifies the proportion of patients with different ESI levels among those who arrive independently and those transported by ambulance. Second, the probability of a patient's condition escalating: This is used to indicate the dynamic changes in the condition of patients in the regular outpatient channel. Specifically, it sets the probability of two types of escalation scenarios, namely, the probability of an ESI level 3 patient escalating to level 2 and an ESI level 4 patient escalating to level 3 during the outpatient process. Third, probability of leaving without receiving service: This value is used to quantify the probability of patient behavior in the LWBS during the waiting period, and its value is positively correlated with the current waiting queue length. Fourth, the probability of various examinations for emergency patients: The examination probability setting for emergency patients adopts a two-dimensional differentiated configuration method of "patient triage level + examination item". Based on the patient's ESI triage level as the stratification basis, combined with the five types of examination items involved in the patient, independent examination probabilities are set for each type of examination item for patients with different ESI levels. That is, not only are there differences in the probabilities between different examination items, but the probability of the same examination item is also different in different ESI level patient groups. This achieves the matching of examination probabilities with the severity of the patient's condition and the type of examination item, and the sampling process of each type of examination probability is independent and does not affect each other. Fifth, the probability distribution of patient destination and treatment: Based on the patient's ESI triage level, the probability of various treatment destinations for patients of different levels after completing diagnosis and treatment is clearly defined, covering core destination scenarios such as admission, ICU admission, emergency observation, and discharge. This probability distribution can quantify the proportion of patients of different ESI triage levels who choose various treatment destinations, thus achieving a probability match between "patient classification" and "treatment destination".
[0026] Furthermore, the patient generation and arrival module specifically includes: The generation of patients arriving autonomously adopts a time-driven model, and the arrival process follows a periodic non-uniform Poisson distribution. The specific generation logic is as follows: First, based on the patient arrival rate matrix of 24 hours per day within a week constructed from historical data, the number of patients per hour is calculated and generated using a Poisson distribution. Then, within each hourly time interval, the patient arrival time is discretized using a uniform distribution, and the discretized times are sorted in chronological order to form an ordered sequence of ordinary patient arrivals. In the generation of a single autonomously arriving patient, their ESI triage level is determined by weighted random sampling.
[0027] The generation of ambulance transport patients adopts an event-driven model to simulate the random, sudden, and non-fixed-cycle characteristics of ambulance transport patients arriving at emergency clinics. The arrival process is based on an exponential distribution, specifically: the arrival interval of ambulance transport patients follows an exponential distribution with a parameter of 100 minutes. By continuously sampling this distribution, the arrival time of the next ambulance patient is dynamically generated to match the randomness of pre-hospital emergency care. For ambulance transport patients, their ESI triage level is determined by weighted random sampling.
[0028] Furthermore, the triage and pathway allocation module specifically includes: Upon arrival at the emergency department, patients first enter the triage waiting queue and initiate a triage nurse resource request through the dynamic resource scheduler. When the triage nurse resource is available, the patient leaves the queue and the triage start time is recorded. The triage duration follows a normal distribution with a mean of 5 minutes. Nurses classify patients into levels 1-5 according to the severity of their condition, from most severe to least severe, based on the International Emergency Triage Standard (ESI).
[0029] Patients transported by ambulance are considered urgent due to the fact that their triage assessment has already been completed during pre-hospital transport. Upon arrival at the emergency room, there is no need for repeated triage; they directly enter the treatment pathway allocation stage. The triage and pathway allocation module first defines the patient group based on their triage level: Level 1 and 2 patients are classified as critically ill patients, and Level 3-5 patients are classified as stable patients. Then, corresponding treatment pathways are matched for each patient. Critically ill patients are directed to the rapid emergency channel, which is equipped with a priority resource response mechanism to ensure priority supply of emergency medical resources. Stable patients are directed to the general treatment channel and treated sequentially using the "first-come, first-served" (FCFS) service rule.
[0030] Patients with a level 3 condition have a 6% chance of being upgraded to level 2 during their medical visit. Patients who are upgraded to level 2 after their condition is upgraded will be classified as level 6. Patients with a level 4 condition have a 5% chance of being upgraded to level 3. Patients who are upgraded to level 3 after their condition is upgraded will be classified as level 7. The patient's medical visit path will remain unchanged after the upgrade, but the service resource allocation standards will be adjusted in sync with the new level to ensure that the resource supply is appropriate for the current severity of the condition.
[0031] Furthermore, it also includes a module for medical services and resource collaboration; The medical service and resource collaboration module is as follows: The registration process is a dedicated pre-treatment procedure for patients in the general outpatient channel. Patients entering the general outpatient channel first join the registration waiting queue. The medical service and resource collaboration module monitors and counts the length of the current registration waiting queue in real time. It calculates the patient's departure probability at that moment using the formula "waiting queue length × preset departure probability coefficient μ". Then, it uses a Bernoulli test to determine whether the patient abandons the registration and leaves the emergency room directly. Patients who do not leave continue to wait until they successfully obtain a registration nurse resource and then the registration service is initiated.
[0032] The registration service duration follows a uniform distribution of 8-15 minutes. After the service is completed, the start and end times of the patient's registration are recorded immediately, and the registration nurse resources are released to the resource pool to ensure that the resources can be used by subsequent patients, forming a closed loop of resource recycling.
[0033] The diagnosis and treatment process is based on the patient's channel type and triage level, implementing differentiated allocation of "resource needs + service rules". The specific standards are as follows: After completing the registration process, patients in the general consultation channel enter the consultation waiting queue. The probability of leaving is calculated based on the current length of the consultation waiting queue. Resources are allocated according to the FCFS service rules, and the patient's LWBS behavior judgment is performed again. The rapid emergency channel is equipped with high-priority resource guarantee for critically ill patients. Priority management ensures that the most critically ill patients receive rescue resources first.
[0034] Furthermore, it also includes an auxiliary examination execution module. The auxiliary examination execution module takes "patient level differentiation" as its core logic. By setting an examination probability matrix and resource coordination rules, it manages five major categories of items: electrocardiogram, X-ray, CT, ultrasound and laboratory tests. The module sets differentiated examination probabilities based on the patient's triage level. The higher the level of the patient, the higher the probability of receiving complex examinations.
[0035] Furthermore, it also includes a patient destination determination module; as the final step in the emergency room patient flow process, this module is responsible for determining the final transfer direction based on the severity of the patient's condition. It achieves accurate destination determination through "tiered differentiated probability sampling," and the probability distribution of destinations for patients at different triage levels differs significantly. The specific rules and procedures are as follows: Of the patients in Level 1, there is a 75% chance of being transferred to an inpatient ward and a 25% chance of being admitted to the ICU. The outcomes for patients with grade 2 and grade 6 illnesses were as follows: 75% were hospitalized, 20% were admitted to the ICU, and 5% were kept under observation. For patients at levels 3 and 7, 55% were hospitalized, 35% were kept under observation, and 10% were discharged. For level 4 patients, observation was the main treatment, accounting for 70%, with the remaining 30% likely to be discharged. For level 5 patients, due to their milder condition, all were discharged directly.
[0036] In terms of specific procedures: admitted patients need to wait 60-36 minutes for transfer; patients under observation first request emergency observation beds, and after obtaining the beds, they enter the observation process, with the observation time evenly distributed from 30 to 300 minutes depending on the patient's level; discharged patients directly end the emergency treatment process.
[0037] Furthermore, it also includes a simulation data output module; The simulation data output module records and standardizes the output of all data from the simulation process. Specifically, the simulation data output module outputs patient full-process traceability data, covering the arrival time of each patient, the start and end time of each service link, the final treatment type and departure status, so as to realize the complete record of each patient's medical trajectory.
[0038] After the simulation is completed, the module will output the collected patient medical data to a CSV file in a standardized manner according to the preset field structure. The fields include the patient's unique ID, triage level, start time of each service link, and treatment type.
[0039] Furthermore, the system also includes a calculation and visualization module, which integrates eight emergency congestion indicators. Supported by the full dataset output from the simulation model, it forms a coherent processing flow of "data input—indicator quantification—result visualization." The calculation and visualization module specifically executes the following process: First, using the patient's entire treatment process data output by the simulation data output module as input, a unified preprocessing method is used to build the foundation for indicator calculation. This includes filling in missing data values, standardizing the time field to hourly units, and standardizing the triage level mapping, thereby forming a standardized and complete structured dataset. Second, the calculation and visualization module first calculates the core parameters required for each indicator from the preprocessed data in hourly units, including the number of patients at each level, emergency room stay duration, number of medical staff, total number of beds, and number of patients in the waiting queue. Then, based on the clinical definition or specific calculation formula of each indicator, the extracted parameters are substituted into the corresponding calculation rules to obtain the quantitative results of the indicators in the time dimension. Finally, the indicator values of each time period are integrated to form a time-series dataset corresponding to "time - indicator value".
[0040] In the results presentation stage, the calculation and visualization module uses the time-series dataset generated by the indicator calculation as a basis to carry out multi-dimensional statistical and visualization processing: First, the time-series data is normalized and mapped according to a fixed cycle of 168 hours per week, and the statistical characteristics of the indicators in each hour after mapping are calculated, thereby extracting the periodic fluctuation pattern and numerical range of the indicators; When visualizing, scatter plots and line charts are generated simultaneously with time as the horizontal axis and indicator values as the vertical axis, and a red dividing line for each 24-hour period is added to enhance the periodicity. The scatter plot clearly shows the specific numerical distribution of the indicators in each time period, and the line chart intuitively outlines the overall trend of the indicator changes.
[0041] Beneficial effects: 1. This invention provides an emergency congestion assessment system based on discrete event simulation. Based on the actual emergency patient flow, this system integrates discrete event simulation theory and uses Python as the core development tool to construct an emergency congestion assessment system that combines "full-process simulation of emergency patient flow" with "congestion indicator output." Through modular modeling of key stages such as emergency patient arrival, triage, registration, diagnosis, examination, and treatment, the system accurately simulates the dynamic operation of the emergency system, reflecting the logical connections and mutual influences between each stage more precisely and meticulously. It constructs a simulation model that balances completeness, dynamism, and accuracy, providing more effective decision support for the optimal allocation of emergency resources and congestion management.
[0042] 2. This invention provides an emergency congestion assessment system based on discrete event simulation. It integrates discrete event simulation theory with the actual patient flow, constructing a core model through "step-by-step sequential connection + dynamic resource coupling." The system embeds the 24-hour differentiated arrival rates of patients arriving autonomously and those transported by ambulance. It designs a module linking patient levels with a three-dimensional resource structure of "medical staff-equipment-beds" to achieve dynamic scheduling across steps. Simultaneously, it designs a patient "condition escalation + LWBS behavior" judgment mechanism, setting a 6% and 5% probability of condition escalation for level 3 and 4 patients respectively at the triage, registration, and treatment stages, and adjusting priorities in real time. The LWBS probability is calculated weighted by waiting queue length and determined through Bernoulli trials, synchronously feeding back to the resource scheduling system to accurately capture resource conflicts and dynamic scenarios, improving simulation accuracy. This system achieves accurate simulation of the entire emergency process: constructing a simulation model that comprehensively covers the entire process of emergency patients from arrival, registration and triage, treatment, examination, to final disposal. 3. This invention provides an emergency congestion assessment system based on discrete event simulation, establishing a multi-dimensional assessment and visualization system: A complete emergency congestion assessment system is built, comprehensively considering multiple indicators such as the number of patient arrivals, the number of waiting patients, the emergency department census (the total number of inpatients in the emergency department at a certain point in time, including waiting, treatment, and observation patients), average waiting time (AWT), average length of stay (ALOS), the emergency department workload index (EDWIN), the National Emergency Department Overcrowding Scale (NEDOCS), and the emergency department occupancy rate (EDOR). The system uses a visualization framework to intuitively display the dynamic trends of these indicators, providing comprehensive and intuitive data support for decision-making. Attached Figure Description
[0043] Figure 1 Flowchart for emergency patient visits Figure 2 A trend chart of patient arrival rate changes over one week. Detailed Implementation The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0044] This invention provides an emergency congestion assessment system based on discrete event simulation. Based on the actual emergency patient flow, this system integrates discrete event simulation theory and uses Python as the core development tool to construct an emergency congestion assessment system that combines "full-process simulation of emergency patient flow" and "congestion indicator output." The system accurately simulates the dynamic operation of the emergency system through modular modeling of key stages such as emergency patient arrival, triage, registration, diagnosis, examination, and treatment. After the simulation is completed, based on the generated patient simulation data, the system completes the numerical calculation and visualization output of core emergency congestion indicators, providing data support and decision-making reference for the optimized allocation of emergency resources and process improvement. The technical solution of this invention is described in detail below: Emergency patient visit process as follows Figure 1 As shown, emergency patients can be categorized into two types based on their arrival method: self-arrival patients and ambulance-transported patients. For self-arrival patients, triage nurses will classify them into levels 1-5 according to the severity of their condition, from most severe to least severe, based on the International Emergency Severity Index (ESI). For ambulance-transported patients, due to the inherent urgency of their condition, the triage process is completed en route, so no further on-site triage is required upon arrival at the emergency room. Next, emergency patients enter differentiated treatment channels based on their severity level. Critically ill patients identified as level 1 or 2 after triage are directly admitted to the rapid emergency care channel, where medical staff will immediately implement emergency resuscitation procedures to ensure their safety. Patients with stable conditions identified as levels 3-5 after triage receive treatment through the regular patient care channel. These patients must first complete the registration process before entering the waiting area to await their appointment. In the emergency room, five auxiliary examinations can be performed based on the patient's condition: electrocardiogram (ECG), CT scan, X-ray, ultrasound, and laboratory tests, to support clinical diagnosis. After all diagnosis and auxiliary examinations are completed, the patient will be admitted, kept under observation, transferred to the ICU, or discharged. For patients in the regular emergency room, there are two potential scenarios during their visit: first, the patient may leave the emergency room without receiving treatment due to excessive waiting time or long waiting periods (Leave Without Been Seen, LWBS); second, the patient's original condition may suddenly change, resulting in an escalation of the illness.
[0045] based on Figure 1 The diagnosis and treatment logic and process relationships defined in the emergency patient visit flowchart were used to develop and build an emergency discrete event simulation model in a Python programming environment using the Simpy discrete event simulation library. To ensure a clear model structure and controllable functionality, its overall architecture can be specifically divided into the following modules: Simulation parameter configuration module The simulation parameter configuration module serves as the basic support unit for the simulation model, and is responsible for providing the basic operating environment configuration and core parameter adjustment for the entire simulation model. Specifically, it includes four categories: time parameters, resource parameters, service distribution parameters, and decision parameters.
[0046] The time parameter defines the simulation time boundary, including the warm-up period and the effective simulation period, to obtain core simulation data while eliminating the interference of the initial state on the results. Simultaneously, a random seed is set to ensure the repeatability of the simulation results and to ensure that the initial random state is consistent across different runs. The resource parameter clarifies the allocation of emergency medical resources. This includes the number of doctors and nurses for different shifts and positions, the space resources for resuscitation rooms, general clinics, observation beds, and ICU beds, as well as the number of related equipment such as electrocardiographs, X-ray machines, CT scanners, ultrasound machines, and laboratory testing equipment. The quantities of various resources are dynamically adjusted daily according to the morning, noon, and evening shifts, forming a time-segmented resource allocation plan, as shown in Table 1. On the other hand, it includes the amount of emergency resources required for patients at different triage levels during treatment.
[0047] Table 1. Emergency Department Resource Allocation Table
[0048] Service parameters are used to clarify the service time distribution patterns of each service stage in the emergency department, specifically covering key stages such as patient arrival, registration, diagnosis and treatment, examination, and waiting for patient transfer to the inpatient ward. Different service stages correspond to different time distribution types, mainly including Poisson distribution, uniform distribution, triangular distribution, and normal distribution, with each distribution type matching the service time characteristics of its corresponding stage. Decision parameters include multi-dimensional probability settings for patient visit stages, providing a quantitative basis for the decision logic of the simulation model, specifically covering the following five core probability configurations: First, the probability distribution of patient triage level: clarifying the proportion of patients with different ESI levels among those arriving independently and those transported by ambulance; Second, the probability of patient condition escalation: focusing on the dynamic changes in the condition of patients in the general visit channel, specifically setting the probability of two escalation scenarios, namely, an ESI level 3 patient escalating to level 2 during the visit, and an ESI level 4 patient escalating to level 5. The probability of a Level 4 patient being upgraded to Level 3; third, the probability of leaving without receiving service: a coefficient is set, and this coefficient multiplied by the queue level is the probability of a patient leaving without receiving service. This probability is positively correlated with the current queue length; the longer the queue, the higher the probability of the patient leaving. Fourth, the probability of various examinations for emergency patients: For emergency patients, the examination probability is set using a two-dimensional differentiated configuration of "patient triage level + examination item." Based on the patient's ESI triage level, and combined with the five types of examinations the patient may be involved in, independent examination probabilities are set for each type of examination for patients of different ESI levels. This means that not only are the probabilities of different examination items different... Differences exist; the probability of the same examination item varies among patients with different ESI levels. This allows for a precise match between examination probability and patient severity and examination type, with each type of examination probability sampling process being independent and unaffected by others. Fifth, patient destination and treatment probability distribution: Based on the patient's ESI triage level, the probability of various treatment destinations after treatment for patients of different levels is clearly defined, covering core destination scenarios such as admission, ICU admission, emergency observation, and discharge. This probability distribution quantifies the proportion of patients choosing each treatment destination among those with different ESI triage levels, achieving a precise probability match between "patient classification" and "treatment destination." The four types of simulation parameters mentioned in this module will be specifically provided in the corresponding processes of subsequent modules.
[0049] Patient arrival generation module The patient generation and arrival module adopts a dual-patient type time-segmented differentiated arrival mode to realize the generation logic of two types of patients: those who arrive autonomously and those who are transported by ambulance. At the same time, it creates patient objects containing attribute information such as patient ID, triage level, and timestamp of the treatment process, and connects to the simulation environment through a discrete event triggering mechanism.
[0050] The generation of autonomously arriving patients adopts a time-driven model, and its arrival process follows a periodic non-uniform Poisson distribution. The specific generation logic is as follows: First, based on the "Patient Arrival Rate Matrix for 24 Hours Per Day (Table 2)" constructed based on historical data, the number of patients per hour is calculated and generated through a Poisson distribution, such as... Figure 2 As shown in the diagram; subsequently, within each hourly time interval, the arrival times of patients are discretized using a uniform distribution, and the discretized times are sorted chronologically to form an ordered sequence of ordinary patient arrivals. In the generation of a single autonomously arriving patient, their ESI triage level is determined through weighted random sampling, with the specific weight distribution as follows: Level 1 0.008, Level 2 0.083, Level 3 0.434, Level 4 0.395, and Level 5 0.08. This weight vector accurately reflects the actual distribution characteristics of patients with different disease severity levels. Furthermore, to simulate emergencies such as influenza outbreaks and sudden emergency events, the patient arrival rate matrix can be dynamically corrected by adjusting preset coefficients, thereby achieving multi-scenario simulation and simulating the number of autonomously arriving patients entering the emergency room under different emergency room load conditions.
[0051] Table 2. Arrival Rate Matrix of Patients Arriving Autonomously
[0052] Figure 2 The chart shows the trend of patient arrival rate changes over a week. The generation of ambulance-transferred patients adopts an event-driven model to simulate the random, sudden, and non-fixed-cycle characteristics of ambulance-transferred patients arriving at the emergency room. The arrival process is based on an exponential distribution. Specifically, the arrival interval of ambulance-transferred patients follows an exponential distribution with a parameter of 100 minutes. By continuously sampling this distribution, the arrival time of the next ambulance patient can be dynamically generated to match the randomness of pre-hospital emergency care. Compared with the triage level distribution of patients arriving independently, ambulance-transferred patients, due to the urgency of their conditions, exhibit a higher proportion of severe cases. The specific weight distribution is: Level 1 0.027, Level 2 0.212, Level 3 0.557, Level 4 0.176, and Level 5 0.028. In this weight configuration, the proportion of Level 1 and Level 2 severe patients is significantly higher than that of independently arriving patients, fully reflecting the special characteristics of patient conditions in emergency medical rescue scenarios and ensuring consistency between the simulation process and actual emergency room operation.
[0053] Triage and Pathway Assignment Module The triage and pathway allocation module is based on "precise classification and pathway adaptation". It undertakes two major functions: classifying patients' disease levels and allocating targeted treatment pathways. It enables the precise implementation of differentiated treatment pathways for patients with different diseases and ensures the orderly connection of the diagnosis and treatment process. The specific logic is as follows.
[0054] Upon arrival at the emergency department, patients arriving independently first enter the triage waiting queue and request triage nurse resources through the dynamic resource scheduler. When a triage nurse becomes available, the patient leaves the queue and the triage start time is recorded. The triage duration follows a normal distribution with a mean of 5 minutes. Nurses classify patients into levels 1-5 according to the severity of their condition, from most severe to least severe, based on the International Emergency Triage Standard (ESI). For patients transported by ambulance, due to the urgency of their condition, their triage assessment has already been completed during pre-hospital transport. Upon arrival at the emergency department, they do not need to undergo repeated triage and directly enter the patient pathway allocation process. The module first defines patient groups based on their triage level: Level 1 and 2 patients are classified as critically ill patients requiring priority treatment, while Level 3-5 patients are classified as stable patients requiring routine treatment. Then, corresponding treatment pathways are matched accordingly—critically ill patients are directed to the rapid emergency channel, which is equipped with a priority resource response mechanism to ensure priority supply of emergency medical resources. This mechanism means that within the rapid channel, core resources such as medical staff and examination rooms in the emergency department are allocated based on the severity of the patient's condition, rather than the order of arrival. Its core objective is to ensure that high-priority critically ill patients receive the fastest possible treatment. Stable patients are directed to the general care channel and treated sequentially according to the "First Come, First Service" (FCFS) rule. To simulate the dynamic changes in patients' conditions in clinical practice, the module synchronously sets up a dynamic adjustment mechanism for patient conditions: Level 3 patients have a 6% probability of upgrading to Level 2 during the consultation process. To distinguish them from patients whose condition was originally Level 2, these patients who upgrade to Level 2 are recorded as Level 6. Level 4 patients have a 5% probability of upgrading to Level 3. Similarly, to facilitate differentiation, these patients are recorded as Level 7. After the upgrade, the patient's consultation path remains unchanged, but the service resource allocation standards will be adjusted synchronously according to the new level to ensure that resource supply is accurately matched with the current severity of the condition, achieving a high degree of alignment between the diagnosis and treatment process and clinical reality.
[0055] Medical Services and Resource Collaboration Module The diagnosis and treatment service and resource collaboration module covers two key links: registration and diagnosis and treatment. It constructs a closed-loop process of "resource request - service execution - resource release" and embeds a behavior judgment mechanism for patients leaving without receiving services (LWBS) and a dynamic adjustment mechanism for the patient's condition, so as to realize dynamic collaboration between the diagnosis and treatment process and resource allocation.
[0056] The registration process is a dedicated pre-treatment procedure for patients using the regular patient access channel. Patients entering the regular access channel must first join the registration waiting queue. The model monitors and calculates the current queue length in real time, using the formula "queue length × preset departure probability coefficient μ = 0.035%" to determine the patient's departure probability at that moment. A Bernoulli test is then used to determine whether the patient abandons registration and leaves the emergency room directly—a behavior judgment mechanism based on the principle of "Low-Waste-Based Service" (LWBS). Patients who do not leave will continue to wait until they successfully obtain a registration nurse resource and the registration service is initiated. The registration service duration follows a uniform distribution of 8-15 minutes. Upon completion of the service, the start and end times of the patient's registration are recorded immediately, and the registration nurse resource is released to the resource pool to ensure that the resource can be used by subsequent patients, forming a closed loop of resource recycling.
[0057] The treatment process is differentiated based on the patient's channel type and triage level, implementing a "resource demand + service rules" approach. Specific standards are as follows: Patients in the general treatment channel enter the treatment waiting queue after completing the registration process. Resources are allocated according to the FCFS service rules, while the patient's LWBS behavior is assessed again (the assessment logic is consistent with the registration process, calculating the probability of leaving based on the current treatment waiting queue length). The rapid emergency channel allocates high-priority resources to critically ill patients, ensuring that the most critically ill patients receive rescue resources first, aligning with the emergency department's "prioritize the most critical cases" treatment principle. The distribution of resource usage and treatment service time for patients of different levels is shown in Table 3.
[0058] Table 3. Distribution of Patient Treatment Time and Resource Requirements
[0059] The dynamic adjustment mechanism for patient conditions is the same as the dynamic adjustment mechanism for patient conditions in the triage and pathway allocation module.
[0060] Auxiliary inspection execution module The auxiliary examination execution module, as a core component of the diagnostic support process, operates on the principle of "patient-level differentiation." It manages five major categories of tests—ECG, X-ray, CT scan, ultrasound, and laboratory examinations—through a set probability matrix and resource coordination rules. To achieve precise matching between "disease severity and examination needs," the module sets differentiated examination probabilities based on the patient's triage level. Higher-level patients have a higher probability of receiving complex examinations, aligning with the clinical need for more comprehensive diagnostic support for critically ill patients. Level 1 patients, requiring priority resuscitation, do not undergo any examinations. The execution probabilities of examinations for different triage levels are shown in Table 4 below.
[0061] Table 4. Probability of Examination Items Performed for Patients at Different Triage Levels
[0062] After patients are randomly selected to undergo specific examinations, they enter the corresponding examination waiting queue. Each examination requires one piece of equipment and one nurse. A closed-loop mechanism of "resource request—service execution—resource release" ensures an orderly flow and avoids resource conflicts. To align with actual medical procedures, the module is configured with differentiated time distribution characteristics for different examinations, as shown in Table 5. Once a patient has completed all required examinations, the module automatically releases the examination room resources occupied during the treatment process, making them available for subsequent patients and ensuring efficient workflow.
[0063] Table 5. Simulation Time Distribution of Inspection Items
[0064] Patient destination determination module The patient destination determination module, as the final link in the emergency department visit process, is responsible for determining the final transfer direction based on the severity of the patient's condition. It achieves accurate destination determination through "tiered differentiated probability sampling"—the probability distribution of destinations for patients at different triage levels varies significantly. The specific rules and procedures are as follows: For Level 1 patients, there is a 75% probability of being transferred to an inpatient ward and a 25% probability of entering the ICU; for Level 2 and Level 6 patients, the destination distribution is 75% hospitalization, 20% ICU admission, and 5% observation; for Level 3 and Level 7 patients, the distribution is 55% hospitalization, 35% observation, and 10% discharge; Level 4 patients are mainly observed, accounting for 70%, with the remaining 30% probability of discharge; Level 5 patients, due to their milder condition, are all directly discharged.
[0065] In terms of specific procedures: admitted patients need to wait 60-36 minutes for transfer (including bed coordination and transfer preparation); patients under observation need to request emergency observation beds first, and after obtaining the resources, they enter the observation process. The observation time is evenly distributed from 30 to 300 minutes according to the patient's level to ensure that it matches the observation period required for the recovery of the condition; discharged patients directly end the emergency treatment process.
[0066] Simulation data output module The simulation data output module is responsible for recording and standardizing all data during the simulation process. Through real-time acquisition and structured storage, it provides complete data support for subsequent process optimization and analysis. Specifically, the simulation model outputs full-process traceability data for each patient, covering the arrival time of each patient, the start and end times of each service step (triage, registration, diagnosis, examination, etc.), the final treatment type (hospitalization, ICU, observation, discharge, etc.), and the departure status (completed process or abandoned midway), thus achieving a complete record of each patient's medical journey.
[0067] After the simulation is completed, the module will output the collected patient visit data to a CSV file in a standardized manner according to the preset field structure. The fields include the patient's unique ID, triage level, start time of each service link, treatment type, etc., to ensure that the data format is uniform and the information is complete, providing a reliable data foundation for subsequent data analysis to calculate eight emergency congestion indicators.
[0068] Computation and Visualization Module Based on the emergency room visit simulation model constructed above, this system further integrates the calculation and visualization functions of eight emergency room congestion indicators. Using the full dataset output by the simulation model as the core support, it forms a coherent processing flow of "data input—indicator quantification—result visualization." The specific functions are implemented as follows: The eight emergency department congestion indicators targeted include: Number of Patient Arrivals, Number of Waiting Patients, Emergency Department Census (the total number of inpatients in the emergency department at a given time, including those waiting for consultation, treatment, and observation), Average Waiting Time (AWT), Average Length of Stay (ALOS), Emergency Department Workload Index (EDWIN), National Emergency Department Overcrowding Scale (NEDOCS), and Emergency Department Occupancy Rate (EDOR).
[0069] The system first uses patient visit data from an emergency room simulation model as input. A unified preprocessing step is used to establish the foundation for indicator calculations. This includes completing missing data values, standardizing time fields to hourly units, and standardizing triage level mappings, thus forming a standardized and complete structured dataset to ensure a consistent data source for indicator calculations. Secondly, addressing the differentiated definitions of the eight congestion indicators, the system employs a general calculation framework of "parameter extraction—formula mapping—time-based quantification." The system first calculates the core parameters required for each indicator from the preprocessed data on an hourly basis, including the number of patients at each level, emergency room stay duration, number of medical staff, total number of beds, and number of patients in the waiting queue. Then, based on the clinical definition or specific calculation formula of each indicator, the extracted parameters are substituted into the corresponding calculation rules to obtain the time-based indicator quantification results. Finally, the indicator values from each time period are integrated to form a time-series dataset corresponding to "time—indicator value," laying the foundation for subsequent analysis. In the results presentation stage, the system uses the time-series dataset generated by indicator calculation as a foundation to conduct multi-dimensional statistical and visualization processing. First, the time-series data is normalized and mapped according to a fixed 168-hour cycle. Then, the statistical characteristics such as the average, variance, and extreme values of the indicators for each hour after mapping are calculated, thereby extracting the periodic fluctuation patterns and numerical ranges of the indicators. During visualization, scatter plots and line graphs are generated simultaneously with time as the horizontal axis and indicator values as the vertical axis. A red 24-hour dividing line is added daily to enhance the periodicity. The scatter plot clearly shows the specific numerical distribution of indicators for each time period, while the line graph intuitively outlines the overall trend of indicator changes. The combination of these two methods makes the indicator fluctuation characteristics easier to interpret, providing an intuitive and reusable analytical basis for assessing emergency room congestion and making resource optimization decisions. This functional module, through standardized data processing procedures and modular calculation logic, can flexibly adapt to the differences in the characteristics of the eight congestion indicators, achieving efficient transformation from simulation raw data to statistical analysis results, further expanding the application value of emergency room simulation models.
[0070] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An emergency congestion assessment system based on discrete event simulation, characterized in that, The emergency congestion assessment system is constructed based on the emergency patient visit process and specifically includes the following modules: The simulation parameter configuration module is used to provide basic runtime environment configuration and core parameter adjustment for the entire simulation model; The patient generation and arrival module adopts a dual-patient type time-segmented differentiated arrival mode to realize the generation logic of two types of patients: autonomous arrival and ambulance transfer. At the same time, it creates patient objects containing patient attribute information and connects to the simulation environment through a discrete event triggering mechanism. The triage and pathway allocation module is used to classify patients by their disease severity and allocate medical pathways accordingly, thereby achieving differentiated medical pathway allocation for patients with different conditions. The diagnosis and treatment service and resource collaboration module constructs the registration and diagnosis and treatment process, implements a closed-loop process of resource request, service execution and resource release, and embeds a behavior judgment mechanism for patients leaving LWBS without receiving services and a dynamic adjustment mechanism for their condition, so as to realize dynamic collaboration between the diagnosis and treatment process and resource allocation.
2. The emergency congestion assessment system based on discrete event simulation as described in claim 1, characterized in that, The specific procedure for emergency patients is as follows: Emergency patients are categorized into two types based on their mode of arrival: those who arrive independently and those transported by ambulance. Patients who arrive independently will first undergo a triage assessment upon entering the emergency department. This assessment is conducted by the triage nurse, who classifies patients into five levels based on the Emergency Severity Index (ESI). Because of the urgency of the condition, the triage and assessment of patients transported by ambulance are completed in advance during the pre-hospital transport. After the patient arrives at the emergency room, he / she enters the subsequent treatment process. Next, patients are placed into differentiated treatment channels according to the severity of their condition. Patients with severity levels 1 and 2 are placed into the rapid emergency channel for rescue, while patients with severity levels 3 to 5 are placed into the regular treatment channel for medical care. Patients who go through the regular consultation channel need to wait to enter the consultation room after completing the registration. During this period, there is a possibility that patients may leave LWBS without seeing a doctor or that their condition may worsen. Patients using the rapid emergency access route are taken to the resuscitation room for treatment. In the emergency room, diagnosis and treatment and auxiliary examinations are completed according to the patient's condition. The auxiliary examinations include five types of auxiliary examinations: electrocardiogram, CT scan, X-ray, ultrasound, and laboratory tests. The probability of being selected for different auxiliary examinations varies. After all diagnosis and treatment and auxiliary examinations are completed, the patient will have one of four destinations: admission, observation, ICU admission, or discharge.
3. An emergency congestion assessment system based on discrete event simulation as described in claim 1 or 2, characterized in that, The simulation parameter configuration module allocates core parameters that specifically include four categories: time parameters, resource parameters, service distribution parameters, and decision parameters. The time parameter is used to define the simulation time boundary, including the warm-up period and the effective simulation period, to obtain core simulation data while eliminating the interference of the initial state on the results; at the same time, a random seed is set to ensure the repeatability of the simulation results and to ensure that the initial random state is consistent under different runs. The resource parameters are used to clarify the allocation of emergency medical resources. On the one hand, they cover the number of doctors and nurses on different shifts and in different positions, the space resources of resuscitation rooms, general clinics, observation beds, and ICU beds, as well as the number of related equipment such as electrocardiographs, X-ray machines, CT scanners, ultrasound machines, and laboratory testing equipment. The number of various resources is dynamically adjusted daily according to the three shifts of morning, noon, and evening to form a resource allocation plan for different time periods. On the other hand, they include the number of emergency resources required for patients at different triage levels during treatment. The service parameters are used to clarify the service time distribution patterns of each service stage in the emergency department, specifically covering key stages such as patient arrival, registration, diagnosis and treatment, examination, and patient transfer to the inpatient ward; and different service stages correspond to different time distribution types, with each distribution type matching the service time characteristics of the corresponding stage. The decision parameters include multi-dimensional decision probability settings for patient visit processes, providing a quantitative basis for the decision logic of the simulation model, specifically covering the following five core probability configurations: First, the probability distribution of patient triage levels: the probability distribution clarifies the proportion of patients with different ESI levels among those who arrive independently and those transported by ambulance. Second, the probability of a patient's condition escalating: This is used to indicate the dynamic changes in the condition of patients in the regular outpatient channel. Specifically, it sets the probability of two types of escalation scenarios, namely, the probability of an ESI level 3 patient escalating to level 2 and an ESI level 4 patient escalating to level 3 during the outpatient process. Third, probability of leaving without receiving service: This value is used to quantify the probability of patient behavior in the LWBS during the waiting period, and its value is positively correlated with the current waiting queue length. Fourth, the probability of various examinations for emergency patients: The examination probability setting for emergency patients adopts a two-dimensional differentiated configuration method of "patient triage level + examination item". Based on the patient's ESI triage level as the stratification basis, combined with the five types of examination items involved in the patient, independent examination probabilities are set for each type of examination item for patients with different ESI levels. That is, not only are there differences in the probabilities between different examination items, but the probability of the same examination item is also different in different ESI level patient groups. This achieves the matching of examination probabilities with the severity of the patient's condition and the type of examination item, and the sampling process of each type of examination probability is independent and does not affect each other. Fifth, the probability distribution of patient destination and treatment: Based on the patient's ESI triage level, the probability of various treatment destinations for patients of different levels after completing diagnosis and treatment is clearly defined, covering core destination scenarios such as admission, ICU admission, emergency observation, and discharge. This probability distribution can quantify the proportion of patients of different ESI triage levels who choose various treatment destinations, thus achieving a probability match between "patient classification" and "treatment destination".
4. The emergency congestion assessment system based on discrete event simulation as described in claim 1, characterized in that, The patient generation and arrival module specifically includes: The generation of self-arriving patients adopts a time-driven model, and the arrival process follows a periodic non-uniform Poisson distribution. The specific generation logic is as follows: First, based on the patient arrival rate matrix of 24 hours per day within a week constructed from historical data, the number of patients per hour is calculated and generated using a Poisson distribution. Then, within each hourly time interval, the patient arrival time is discretized using a uniform distribution, and the discretized times are sorted in chronological order to form an ordered sequence of ordinary patient arrivals. In the generation of a single self-arriving patient, their ESI triage level is determined by weighted random sampling. The generation of ambulance transport patients adopts an event-driven model to simulate the random, sudden, and non-fixed-cycle characteristics of ambulance transport patients arriving at emergency clinics. The arrival process is based on an exponential distribution, specifically: the arrival interval of ambulance transport patients follows an exponential distribution with a parameter of 100 minutes. By continuously sampling this distribution, the arrival time of the next ambulance patient is dynamically generated to match the randomness of pre-hospital emergency care. For ambulance transport patients, their ESI triage level is determined by weighted random sampling.
5. The emergency congestion assessment system based on discrete event simulation as described in claim 1, characterized in that, The triage and pathway allocation module specifically comprises: When a patient arrives at the emergency department, they first enter the triage waiting queue and initiate a triage nurse resource request through the dynamic resource scheduler. When the triage nurse resource is available, the patient leaves the queue and the triage start time is recorded. The triage duration follows a normal distribution with a mean of 5 minutes. The nurse classifies the patient into levels 1-5 according to the severity of their condition, from most severe to least severe, based on the International Emergency Triage Standard (ESI). Patients transported by ambulance are considered urgent due to the fact that their triage assessment has already been completed during pre-hospital transport. Upon arrival at the emergency room, there is no need for repeated triage; they directly enter the treatment pathway allocation stage. The triage and pathway allocation module first defines the patient group based on their triage level: Level 1 and 2 patients are classified as critically ill patients, and Level 3-5 patients are classified as stable patients. Then, corresponding treatment pathways are matched for each patient. Critically ill patients are directed to the rapid emergency channel, which is equipped with a priority resource response mechanism to ensure priority supply of emergency medical resources. Stable patients are directed to the general treatment channel and treated sequentially using the "first-come, first-served" (FCFS) service rule.
6. The emergency congestion assessment system based on discrete event simulation as described in claim 5, characterized in that, The triage and pathway allocation module is equipped with a dynamic disease adjustment mechanism, specifically: Patients with a level 3 condition have a 6% chance of being upgraded to level 2 during their medical visit. Patients who are upgraded to level 2 after their condition is upgraded will be classified as level 6. Patients with a level 4 condition have a 5% chance of being upgraded to level 3. Patients who are upgraded to level 3 after their condition is upgraded will be classified as level 7. The patient's medical visit path will remain unchanged after the upgrade, but the service resource allocation standards will be adjusted in sync with the new level to ensure that the resource supply is appropriate for the current severity of the condition.
7. The emergency congestion assessment system based on discrete event simulation as described in claim 6, characterized in that, It also includes a module for medical services and resource collaboration; The diagnostic and treatment service and resource collaboration module specifically includes: The registration process is a dedicated pre-treatment procedure for patients in the regular outpatient channel. Patients entering the regular outpatient channel first join the registration waiting queue. The medical service and resource collaboration module monitors and counts the length of the waiting queue in real time. It calculates the patient's probability of leaving at that moment using the formula "waiting queue length × preset departure probability coefficient μ". Then, it uses a Bernoulli test to determine whether the patient abandons the registration and leaves the emergency room directly. Patients who do not leave continue to wait until they successfully obtain a registration nurse resource and then the registration service is activated. The registration service duration follows an even distribution of 8-15 minutes. After the service is completed, the start and end times of the patient's registration are recorded immediately, and the registration nurse resources are released to the resource pool to ensure that the resources can be used by subsequent patients, forming a closed loop of resource recycling. The diagnosis and treatment process is based on the patient's channel type and triage level, implementing differentiated allocation of "resource demand + service rules". The specific standards are as follows: After completing the registration process, patients in the general consultation channel enter the consultation waiting queue. The probability of leaving is calculated based on the current length of the consultation waiting queue. Resources are allocated according to the FCFS service rules, and the patient's LWBS behavior judgment is performed again. The rapid emergency channel is equipped with high-priority resource guarantee for critically ill patients. Priority management ensures that the most critically ill patients receive rescue resources first.
8. The emergency congestion assessment system based on discrete event simulation as described in claim 7, characterized in that, It also includes an auxiliary examination execution module, which takes "patient level differentiation" as its core logic. By setting an examination probability matrix and resource coordination rules, it manages five major categories of items: electrocardiogram, X-ray, CT, ultrasound and laboratory tests. The module sets differentiated examination probabilities based on the patient's triage level. The higher the level of the patient, the higher the probability of receiving complex examinations.
9. The emergency congestion assessment system based on discrete event simulation as described in claim 7, characterized in that, It also includes a patient destination determination module; The patient destination determination module, as the final link in the emergency room patient flow process, is responsible for determining the final transfer direction based on the severity of the patient's condition. It achieves accurate destination determination through "tiered differentiated probability sampling," and the probability distribution of destinations for patients at different triage levels differs significantly. The specific rules and procedures are as follows: Of the patients in Level 1, there is a 75% chance of being transferred to an inpatient ward and a 25% chance of being admitted to the ICU. The outcomes for patients with grade 2 and grade 6 illnesses were as follows: 75% were hospitalized, 20% were admitted to the ICU, and 5% were kept under observation. For patients at levels 3 and 7, 55% were hospitalized, 35% were kept under observation, and 10% were discharged. For level 4 patients, observation was the main treatment, accounting for 70%, with the remaining 30% likely to be discharged. For level 5 patients, due to their milder condition, all were discharged directly. In terms of specific procedures: admitted patients need to wait 60-36 minutes for transfer; patients under observation first request emergency observation beds, and after obtaining the beds, they enter the observation process, with the observation time evenly distributed from 30 to 300 minutes depending on the patient's level; discharged patients directly end the emergency treatment process.
10. The emergency congestion assessment system based on discrete event simulation as described in claim 7, characterized in that, It also includes a simulation data output module; The simulation data output module records and standardizes the output of all data from the simulation process. Specifically, the simulation data output module outputs patient full-process traceability data, covering the arrival time of each patient, the start and end time of each service link, the final treatment type and departure status, so as to realize the complete record of each patient's medical trajectory. After the simulation is completed, the module will output the collected patient medical data to a CSV file in a standardized manner according to the preset field structure. The fields include the patient's unique ID, triage level, start time of each service step, and treatment type. The system also includes a calculation and visualization module, which integrates eight emergency congestion indicators. Supported by the full dataset output from the simulation model, it forms a coherent processing flow of "data input—indicator quantification—result visualization." Specifically, the calculation and visualization module executes the following process: First, the patient's entire treatment process data output by the simulation data output module is used as input. A unified preprocessing method is used to build the foundation for indicator calculation. Specifically, this includes filling in missing data values, standardizing the time field to hourly units, and standardizing the triage level mapping, thereby forming a standardized and complete structured dataset. Second, the calculation and visualization module first calculates the core parameters required for each indicator from the preprocessed data in hourly units, including the number of patients at each level, emergency room stay duration, number of medical staff, total number of beds, and number of patients in the waiting queue. Then, based on the clinical definition or specific calculation formula of each indicator, the extracted parameters are substituted into the corresponding calculation rules to obtain the quantitative results of the indicators in the time dimension. Finally, the indicator values of each time period are integrated to form a time-series dataset corresponding to "time - indicator value". In the results presentation stage, the calculation and visualization module uses the time-series dataset generated by the indicator calculation as a basis to carry out multi-dimensional statistical and visualization processing: First, the time-series data is normalized and mapped according to a fixed cycle of 168 hours per week, and the statistical characteristics of the indicators in each hour after mapping are calculated, thereby extracting the periodic fluctuation pattern and numerical range of the indicators; When visualizing, scatter plots and line charts are generated simultaneously with time as the horizontal axis and indicator values as the vertical axis, and a red dividing line for each 24-hour period is added to enhance the periodicity. The scatter plot clearly shows the specific numerical distribution of the indicators in each time period, and the line chart intuitively outlines the overall trend of the indicator changes.