Abstract
Simulation and analysis of patient flow can contribute to the safe and efficient functioning of a healthcare system, yet it is rarely incorporated into routine healthcare management, partially due to the technical training required. This paper introduces a free and open source patient flow simulation software tool that enables training and experimentation with healthcare management decisions and their impact on patient flow. Users manage their simulated hospital with a simple web-based graphical interface. The model is a stochastic discrete event simulation in which patients are transferred between wards of a hospital according to their treatment needs. Entry to each ward is managed by queues, with different policies for queue management and patient prioritisation per ward. Users can manage a simulated hospital, distribute resources between wards and decide how those resources should be prioritised. Simulation results are immediately available for analysis in-browser, including performance against targets, patient flow networks and ward occupancy. The patient flow simulator, freely available at https://khp-informatics.github.io/patient-flow-simulator, is an interactive educational tool that allows healthcare students and professionals to learn important concepts of patient flow and healthcare management.
Keywords: patient flow, simulation, software
Introduction
Patient flow is a key factor affecting multiple key measures of healthcare performance, including accident and emergency (A&E) waiting time, patient experience and patient outcome. As the product of multiple interacting factors, many of which are time varying, patient flow presents a significant challenge to healthcare research and management. The identification of causal factors affecting patient flow requires complex interdisciplinary analysis with investment from all stakeholders.1 Simulations of patient flow can enable low-cost experimentation, assessing interventions to improve flow and identifying possible causal factors.
Although there have been several previous studies on patient flow simulation, the clinical impact has been limited.2 3 Engagement of all stakeholders is key to the success of a modelling project,4 5 and educational resources are an important aspect of this process.6 We have developed a simple web-based simulation tool to support healthcare education in patient flow simulation and management by enabling ‘hands-on’ experience. The tool combines discrete event simulation, a widely used method used to simulate patient flow, with queue theory and graph theory. Users make multiple management decisions and explore how these changes affect the outcome of their simulated hospital. Increased exposure to patient flow simulation within healthcare service education could lead to more widespread implementation of the practice in routine care and, ultimately, to the streamlining of service delivery.
Methods
Implementation
The tool is written in JavaScript and runs entirely in the browser, so no installation is necessary. The implementation is object oriented, highly configurable and designed to be readily extensible by other developers through application programming interfaces (APIs). The tool works in any modern browser on any platform (tested on Mac, Windows, Ubuntu and Android).
Simulation
The core of the tool is a discrete event simulation, which is very well suited to patient flow and has been used in numerous studies.2 7 The simulation proceeds in steps through time, and at each step patients (1) may arrive at A&E, (2) consume treatment resources within wards, (3) are transferred between wards or (4) are discharged. Each virtual patient has a sequence of wards they must visit and an amount of treatment resources and time required in each ward. This simple abstraction allows the simulation to generate both patients who need intensive care for a short duration or limited care for a long period (or any combination in between).
The values for resource need and length of stay are drawn from Poisson distributions with configurable lambdas per ward. The required ward sequence for each patient is generated by a random walk through a user-defined probability graph where nodes are wards and weighted edges represent the overall probability of a patient being transferred from the current ward to any other. The patient journeys can therefore be arbitrarily complex. The default probabilities are designed to create a typical range of patient journeys.
As the simulation runs, patients may be diverted from their required sequence of wards (ie, to make the bed in the current ward available once their treatment needs have been met there). They must eventually return to their required path before they can be discharged. Admission to every ward is managed by a queue, where the queue policy is selected by the user from preset options (see the Results and discussion section) and can be expanded to any arbitrary policy implemented in JavaScript that conforms to a specified API.
Data availability
The tool is freely accessible with no registration at https://khp-informatics.github.io/patient-flow-simulator. The tool is open source and all code is available at https://github.com/KHP-Informatics/patient-flow-simulator Downloading the source code includes all dependencies, allowing the tool to run locally in the browser with no internet connection.
Results and discussion
Simulation setup
The aim of the tool is to achieve a simulation accurate and complex enough to be educational but simple enough to be understood and studied in the context of a workshop of 1–2 hours. To this end, various abstractions and simplifications are made. The most important generalisation applies to the ‘resources’ available to each ward. The concept of resources in the simulation is the total allocation of staff, equipment (other than beds) and consumables and is a relative measure with no absolute value.
The default configuration simulates a hospital with an emergency department plus seven specialist wards (including acute assessment, surgery, cardiology) and 220 bed capacity. Every aspect of the simulated hospital can be edited, including the number of wards and the probability of patient transfers between them. General users are not expected to adjust these settings, instead focusing on managing whatever hospital they are given by the organiser.
Settings under the ‘simulation setup’ tab are the bounds for the simulation (maximum steps or patients) and the strain on the A&E department measured by the minimum and maximum number of patients arriving per step. The final setting is the A&E waiting time target (in simulation steps, which correspond to hours by default), which allows performance against this target to be used as an outcome in measuring the performance of management decisions.
Ward management
Each ward in the hospital can be managed independently, and there are five key decisions to be made: capacity, resources, resource policy, queue policy and overflow policy. Capacity is the number of available beds per ward, and resources represent all other costs (eg, staff, laboratory tests, equipment, consumables). This broad generalisation of resources is designed to minimise the number of parameters that can be adjusted while retaining flexibility in management choices.
The resource policy determines how the total resources of the ward are divided between all admitted patients (evenly, prioritising high need, prioritising low need). The related setting ‘queue policy’ determines how each ward decides which patients to admit first if there is a queue (chronological, high-need first, low-need first). Patients who are in a queue to enter a ward will either wait in their current ward or may be transferred elsewhere to free space (if their current ward is at capacity and has a queue of patients waiting for admission). Such transfers are only possible if at least one ward has their ‘overflow policy’ set to allow the transfer of patients who don’t medically need to be there (surgical wards, for example, are used to ease overcrowding in many hospitals).
Analysis
The simulation results are automatically analysed when the simulation ends, and this analysis is presented to the user. With the default settings, simulating 1 month of activity totalling roughly 1400 admissions and populating all the analysis results typically takes less than 1 s. The results consist of basic statistics, network analysis, waiting time, occupancy and patient journeys. The basic statistics summarise the operating costs for the hospital and its performance against the waiting time target, as well as the numbers of simulated patients and unique patient journeys.
The tool generates an interactive visualisation of the patient flow network (figure 1), which can calculate and visualise several standard network statistics (in-degree and out-degree, betweenness, closeness). The percentage of patients meeting the waiting time target is one of the basic statistics, but the full waiting time distribution is also generated. Ward occupancy over time can be investigated using another interactive plot, and this analysis together with the network analysis can identify flow bottlenecks. The final analysis focuses on patient journeys and highlights the most common paths through the hospital along with their minimum, maximum and median durations and also shows the path length distribution.
Use in an educational setting
The patient flow simulator was used by 30 Health Informatics MSc students at University College London as part of a workshop on using information in healthcare management. The participants came from a mix of backgrounds, including 15 National Health Service management trainees. In this case, we chose to ‘gamify’ the session,8 9 with each student competing to achieve the highest performance against the UK’s 4-hour A&E waiting time target. Overall, the students rated the tool very highly and were quickly able to start implementing their own ideas based on the analysis output.
Future work
The tool is fully functional and ready for use in an educational setting. Future development will streamline the advanced configuration of the hospital and expand on the analysis. The current analysis could be extended to include queue analysis (eg, length over time) and to allow direct comparison of simulations run with different management decisions. Finally, the gamification could be expanded with the option of a local leaderboard for a given session. This would require the addition of user accounts and groups, which are not currently supported or required. Alongside the implementation of these features, we will continue to actively seek feedback from medical students and professionals.
Conclusion
Simulation plays an increasingly important role in healthcare education. Patient flow is a critical determinant of hospital performance and patient outcome that has proven challenging to optimise. We have developed an open source educational tool that allows healthcare students and professionals to learn several key analytical methods for patient flow modelling. Deeper understanding of patient flow at all levels of a healthcare system will facilitate future study of this critical factor in healthcare management.
Footnotes
Contributors: DMB designed and implemented the software. All authors tested the software. DMB prepared the manuscript. PT and RJBD revised the manuscript. All authors approved the final manuscript.
Funding: This paper represents independent research funded by the National Institute for Health Research (NIHR) Biomedical Research Centre at South London and Maudsley NHS Foundation Trust and King' College London. This research was supported by researchers at the NIHR University College London Hospitals Biomedical Research Centre and by awards establishing the Farr Institute of Health Informatics Research at UCL Partners, from the Medical Research Council, Arthritis Research UK, British Heart Foundation, Cancer Research UK, Chief Scientist Office, Economic and Social Research Council, Engineering and Physical Sciences Research Council, NIHR, National Institute for Social Care and Health Research and Wellcome Trust (grant MR/K006584/1).
Disclaimer: The views expressed are those of the author(s) and not necessarily those of the National Health Service, NIHR or the Department of Health.
Competing interests: None declared.
Provenance and peer review: Not commissioned; externally peer reviewed.
References
- 1. The Health Foundation. Improving patient flow. 2013. Available at http://www.health.org.uk/sites/health/files/ImprovingPatientFlow_fullversion.pdf.
- 2. Mohiuddin S, Busby J, Savović J, et al. Patient flow within UK emergency departments: a systematic review of the use of computer simulation modelling methods. BMJ Open 2017;7:e015007. 10.1136/bmjopen-2016-015007 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3. van Lent WA, Vanberkel P, van Harten WH. A review on the relation between simulation and improvement in hospitals. BMC Med Inform Decis Mak 2012;12:18. 10.1186/1472-6947-12-18 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4. Harper PR, Pitt MA. On the challenges of healthcare modelling and a proposed project life cycle for successful implementation. J Oper Res Soc 2004;55:657–61. 10.1057/palgrave.jors.2601719 [DOI] [Google Scholar]
- 5. Eldabi T, Irani Z, Paul RJ. A proposed approach for modelling health-care systems for understanding. J Manag Med 2002;16:170–87. 10.1108/02689230210434916 [DOI] [PubMed] [Google Scholar]
- 6. Cresswell KM, Bates DW, Sheikh A. Ten key considerations for the successful implementation and adoption of large-scale health information technology. J Am Med Inform Assoc 2013;20:e9–e13. 10.1136/amiajnl-2013-001684 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. Jacobson SH,Shane NH,JR S.Discrete-Event Simulation of Health Care Systems Patient Flow Reducing Delay Healthc. Deliv 2006:211–52. [Google Scholar]
- 8. Bochennek K, Wittekindt B, Zimmermann SY, et al. More than mere games: a review of card and board games for medical education. Med Teach 2007;29:941–8. 10.1080/01421590701749813 [DOI] [PubMed] [Google Scholar]
- 9. McCoy L, Lewis JH, Dalton D. Gamification and multimedia for medical education: a landscape review. J Am Osteopath Assoc 2016;116:22–34. 10.7556/jaoa.2016.003 [DOI] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The tool is freely accessible with no registration at https://khp-informatics.github.io/patient-flow-simulator. The tool is open source and all code is available at https://github.com/KHP-Informatics/patient-flow-simulator Downloading the source code includes all dependencies, allowing the tool to run locally in the browser with no internet connection.