A discrete event simulation procedure for validating programs of requirements: The case of hospital space planning

Abstract This paper introduces a Discrete-Event Simulation (DES) tool developed as a parametric CAD program for validating a program of requirements (PoR) for hospital space planning. The DES model simulates the procedures of processing of patients treated by doctors, calculating patient throughput and patient waiting times, based on the number of doctors, patient arrivals, and treatment times. In addition, the tool is capable of defining space requirements by taking hospital design standards into account. Using this tool, what-if scenarios and assumptions on the PoR about space planning can be tested and/or validated. The tool is ultimately meant for reducing patient waiting times and/or increasing patient throughput by checking the match of the layout of a hospital with respect to its procedural operations. This tool is envisaged to grow into a toolkit providing a methodological framework for bringing Operations Research into Architectural Space Planning. The tool is implemented in Python for Grasshopper (GH), a plugin of Rhinoceros CAD software using the SimPy library.


Motivation and problem statement
Discrete event simulation (DES) is a method that mimics the operations of real and/or proposed systems as an ordered series of events. During the simulation, each event shows a specific change in the system's state at separate points in time. DES allows decision-makers to build complex models of operations, to quickly test what-if scenarios on their operations, and to explore alternative ways of implementing new strategies [1]. Space is almost always constrained and that indeed provides a sense of maximum efficiency/throughput. However, in addition to space, hospitals are the kind of buildings whose operations might be much more costly than their building/space in their lifetime. The tool provides the means to simulate the volumes of operations in terms of flows of people and waiting times etc. such that space planners and/or architects can 'engineer' the program of requirements before realizing it; i.e., to get a sense of scale and time-wise implications of decisions to provide the right amount of spaces for certain uses. DES has been widely used in hospital planning [2,3] for modeling patient flow processes, estimating patient satisfaction, optimizing the healthcare human/physical resources and reducing healthcare costs [4,5]. In patient flow models, the most commonly considered inputs are patient admission schedules, admission rules, patient routing, flow schemes, facility, and staff resources; the most common outputs are patient throughput, patient waiting times, physician utilization, staff and facility utilization [6][7][8]. In particular, DES has been mostly utilized to model outpatient areas in the literature. Zhao and Lie [9] proposed the DES to model patient flow in the emergency department for resource utilization and reducing department crowding. Oddoye et al. [10] modeled medical assessment unit (MAU) using the DES for evaluating the length of stay and bed utilization. Reynolds et al. [11] modeled the outpatient dispensing process by using the DES and evaluated the staffing levels and workload. Haji and Darabi [12] modeled Ear, Nose, Throat clinic and the appointment system using the DES for reducing outpatient waiting times. Al-Araidah et al. [13] utilized the DES method for reducing delays in the ophthalmology outpatient department. Rau et al. [14] focused on the strategic capacity planning of an outpatient physical therapy service using the DES to reduce waiting times and length of stay. Weerawat et al. [15] built a DES model for an orthopedic outpatient area for the assessment of wait times to see doctors. Baril et al. [16] used the DES to model outpatient flows and appointment scheduling in an orthopedic clinic to reduce patient lead times, maximize the number of patients seen by the orthopedist doctor. Best et al. [17] used the DES to improve patient flow, improve patient throughput and reduce the length of stay in emergency and acute care. Pan et al. [18] proposed a DES model to represent the patient and information flow in an ophthalmic outpatient department and aims at reducing patient waiting times. Baril et al. [19] utilized the DES for improving patient trajectories in a hematology-oncology department by reducing patient delays. Dan et al. [20] applied the DES to outpatient pharmacy queuing problem where the factors to evaluate queue system are average waiting time, the average length of the queue, average utilization of servers and length of busy time. Babashov et al. [21] developed a DES model of the patient journey for reducing the patient waiting times to consult or treatment in radiation oncology department. Shin et al. [22] implemented a DES model to characterize the patient flow in an emergency department with the aim of minimizing patient length of stay (LoS), number of handoffs, staff utilization levels, and cost. Recently, Moretto et al. [23] used the DES to improve service planning in orthopedic and neurosurgical outpatient department. Baril et al. [24] built the DES model to analyze ambulatory patient length of stay in an emergency department with a resource and staff planning. In Cho et al. [25], authors proposed a decision support framework for a clinician's schedule using the DES for an outpatient area of a hospital by assessing the patient waiting times for consultation.
The system is not meant to make decisions but to help the planners engineer their space plans. Hospital operations consist of a critically important sequence of medical activities and procedures where any delay in patient care may prove fatal. However, often it is unavoidable. Therefore, the fitness of the building for the planned operations of the hospital plays an important role in the layout design [26]. DES provides an explicit mechanism for testing the degree to which the building matches with its operations [6], i.e. by simulating the patient flow patterns and thus hinting towards how estimated patient waiting times can be reduced by a functional/logical layout during the conceptual design phase of a hospital. In other words, DES provides an explicit way of modeling and understanding the functionality of the building, which can be used to inform the process of shaping the building accordingly.
Space requirements pertain to hospital design standards, such as minimum space area constraints and light requirements. Therefore, such requirements are among important factors that should be fed to the layout design process (a.k.a. space planning). The area requirements generally differ based on several medical staff. For example, according to the hospital design standards of Turkey, outpatient waiting areas must be minimum 12 m 2 for 1 doctor, and a minimum of 24 m 2 for 2 doctors and an additional 5 m 2 should be considered for each additional doctor [27]. On the other hand, space requirements must also handle people's expectations e.g. waiting areas must be large enough for the [estimated] number of visitors waiting in a queue.
The motivation for this paper can be summarized as follows: • Hospital standards affect their design considerations (space requirements).
• Patient flow and waiting times can be estimated through DES.
• Space requirements differ from one context to another (country-specific regulations, the size of the program of requirements, etc.).
• Space requirements can be adjusted to reduce the waiting times (or wider waiting area can be needed if patient waiting times are too high) using what-if scenarios in DES.
• DES provides a clear understanding of critical procedures within a building and thus can inform the spatial layout process.
Utilizing DES in architectural design was suggested by Wurzer et al. [42], especially for early-stage conceptual design. Their approach integrates DES simulation into a hospital space planning tool. In addition, Vos et al. [26] presented an evaluation method using Discrete Event Simulation for the assessment of hospital layout design from the viewpoint of operations management to test if the building design provides for the efficient operation of patient care.

Contributions
The primary contribution of the paper is that users of this tool will be able to utilize the abovementioned functionalities in a Parametric Modeling environment, called Grasshopper (a plug-in of Rhinoceros CAD software). Using this tool, architects/decisionmakers/designers can practically define space requirements to design a hospital considering hospital design standards. Rapid integration of meter square information to the model plays an essential role to define the program of requirements during the conceptual design phase in this tool. Providing real-time Discrete-Event Simulation at the same time, the tool can give feedback on the performance indicators (patient waiting times, patient throughput), which is translatable into the likely functional/logical performance of the hospital plan layout patterns. Furthermore, the outputs of this tool can be used in architectural design optimization models as an input to be minimized or maximized.
We applied the tool to a hospital in Izmir, Turkey (to be a newly built hospital in Seljuk). Therefore, minimum space requirements for each hospital department are taken from Turkey's hospital standard using an assumed building program. The DES part of the tool was applied to outpatient departments. In this part, patient throughput and patient waiting times are taken as outputs, which can be also defined as performance indicators of our tool. The number of staff is considered as an input, which also affects the spatial configuration and space area of the outpatient departments. The mutual interaction between the operational planning of the hospital and its spatial planning is central to our approach. Throughout this work, we show how DES models can be used as design-decision-support tools to create a bridge between architecture and hospital management. Specifically, the tool can help answer these questions: (1) How to test the match of the layout with the operational planning of the hospital to reduce the patient waiting times and increase the patient throughput in a day? (2) How to scale and adjust the program of requirements (PoR) of hospitals through DES and hospital standards that are affected by hospital operational planning?

Software description
The core functionality of this tool is to validate the program of requirements of a hospital referring to the patient-flow model by discrete-event simulation and hospital design standards and make this tool compatible with parametric design models created in GH algorithmic modeling for Rhinoceros CAD software. The first functionality is to simulate patient flows in the outpatient area. An outpatient department consists of many subsections with distinct specialties, and thus it has some special properties distinct from other departments in a hospital in its operations; and so it is a commonly modeled area by DES in the literature for capacity planning [2]. The outpatient department is typically the most active area in terms of human flow with many types of uncertainties in patient arrivals, treatment patterns and service time. Waiting times can be defined as the time that patients arrive in the clinic and wait until doctors call them for treatment. And they are depending on both operational and space planning of the hospital. For the patient-flow modeling with DES, Simpy library [43] is used in GH_CPython [44] component that implements CPython (the standard implementation of Python3.7) codes inside Grasshopper (GH). Therefore, GH_CPython scripting is used in this tool. Fig. 2 shows a screenshot from the GH interface. The component named as DES_PoR tool in this figure is run a python code, which is available in Table 1 Besides, both waiting areas and treatment rooms have strict hospital design standards as described above. Therefore, we formulate another desired functionality as an automatic generation of area requirements based on hospital design standards. It is straightforward to adjust input parameters (e.g. staff planning) in the proposed tool and to quickly see the change in performance indicators e.g. area requirements. Simply, this tool is easy to use by architects/designers since it is compatible with GH. Users of this tool can write scripts inside the GH_CPython component and update the model according to the needs of the focused hospital. For example in our case study, the hospital is planned as 16 outpatient departments with a discrete waiting area for each of them. Components are also adjustable that means if one more input is needed, users can add it easily e.g. this situation can happen if the number of doctors varies in each outpatient area.
To sum up, this tool facilitates the conceptual [digital] design phase of hospital space planning through computational tools. The intent here is not to present a fully working space planning tool, but rather to supports architects/designers as a decisionsupport tool in the early design-decision making process and to highlight the use of hospital management tools in spatial design. The components of this tool are illustrated in Fig. 1.
As a test-case for the tool, we consider hospital standards pertained to its spatial planning as follows [27]: • Outpatient rooms must be min 16 m 2 .
• Outpatient waiting areas must be  • There must be min 6 elevators in 60-200 bed hospitals. • There must be min 9 elevators in 201-350 bed hospitals.
• One-bed patient rooms must be min 9 m 2 . • Patient wards must be min 7 m 2 per each bed. • One-bed delivery patient rooms must be min 12 m 2 .
• Delivery patient wards must be min 10 m 2 per each bed. • ICU units must be min 12 m 2 per each bed. • Neonatal ICU units must be min 6 m 2 per each bed.

Table 2
The procedure implemented in the DESPoR tool.
• Administrative offices must be 8-12 m 2 for each personnel.  Table 1 and the pseudo-code of this tool is given in Table 2.

Illustrative examples
The presented method has been implemented as a computational tool and is currently being tested with a sample hospital. Since we were considering Turkey's hospital standard, we selected a hospital in Izmir as a case study, which is going to be newly built in Seljuk. There are 16 specialties in the outpatient department and 2 inpatient departments as surgery and medicine.
We construct a DES model based on the procedures for patients to be treated by some doctors in outpatient departments in a hospital. In the DES model shown in Fig. 2, input values are taken the same for all outpatient departments. The number of doctors is input for every outpatient department as part of the resource planning process in this paper. In the literature [9,14,45,46], the patient inter-arrivals to an outpatient department have typically been modeled as Poisson arrivals and the treatment time durations, which refers to the duration of consultation with the physician for this case, have been mostly modeled as exponential.  Therefore, in this paper, we assumed that the interarrival times are followed a Poisson process with 5 min mean value and the treatment times are exponentially distributed with 7 min mean value. We took 5 replications with 5 different seed numbers for the simulation. Minimum, maximum, average and standard deviation of the waiting time results in each replication have been recorded in Table 3.
According to the simulation results, the minimum waiting time is obtained as 11.87 min in replication-5 with a seed number of 50. In this case, there are 72 patients treated in a day in each department. When the number of doctors is increased to 3, patient waiting time is reduced to 1.57 min. Then, the area required for the outpatient area is changed from 896 to 1232 m 2 .
On the other hand, when the number of single-bed rooms in the inpatient department is changed from 20 to 30, the area required for the inpatient department is increased from 460 to 550 m 2 .
When the mean value of treatment time is taken as 12 min and the number of doctors is taken as 3 in each outpatient department, the total waiting time of patients is 89.5 min so that 1232 m 2 is needed for all outpatient departments in the hospital. After simulating with 4 doctors, waiting time is reduced to 3.5 min and the required area for outpatient departments is increased to 1568 m 2 . The latter case requires 336 m 2 more area for the outpatient department with 86 min less waiting time. Furthermore, when the number of doctors is taken as 5, the maximum estimated waiting time becomes zero. This case has great advantages from the point of waiting time, however, the outpatient area is very large (1904 m 2 ), which may not be handled with space available constraint, which is 1800 m 2 in this case. Therefore, decision-makers could be recommended to plan 4 doctors in each outpatient department. As an example of sizing an inpatient department, when the number of single rooms is 20 and the number of beds in multiple rooms is 40, the required area is 460 m 2 for patient wards. If the number of single rooms is increased to 30 and the number of beds in multiple rooms is reduced to 30, then the area requirement amounts to 480 m 2 . In the second scenario, the area requirement is slightly larger than the first one. It could be concluded that it would be more advantageous to select the second scenario for inpatient departments as it has 10 more single inpatient rooms; because single patient rooms reportedly have a better effect on the patient healing process then the multiple-bed rooms. This is how the tool allows for checking different scenarios during the decision-making process of hospital space planning (see Fig. 3).

Impact
This tool is designed to handle two main research questions introduced in Section 1. Since this tool is created in a procedural modeling environment, it can be utilized to test the match of the building layout with the operational planning of the hospital in computational design workflows. Specifically, what-if scenarios on hospital planning can be tested through an interactive inputoutput connection over this tool. During such tests, changes in (patient-focused) performance indicators can be interactively observed by a decision-maker/architect by changing the decisions regarding input parameters. Our tool enables both identifying and validating building programs based on performance indicators obtained by the DES model and hospital design standards. In particular, it helps to answer the existing research question introduced by Vos et al. [26]. This tool represents a step towards closing the gap between these two worlds by representing a more practical way from the point of architectural design practitioners. The tool is a plug-in of Rhino CAD software, i.e. the de facto standard environment of choice for computational design in architecture, and at the same time portable to open environments because it is a Python script also implemented in a Jupyter notebook. This tool can be used in space planning of hospital designs in practice (as a Rhino/Grasshopper plugin) as well as in research studies (as a Python script). It is envisioned to be an extensible and open-source tool for hospital planning. As it is freely available on a public domain (https://github.com/CemreTUDelft/DES_PoR_ Tool), users can extend the tool to their liking or integrate it in their works, such as focusing on different case studies (types of hospitals) and system models (e.g. queue model) or different users (e.g. administrative people flow). In addition, users of this tool can estimate the flowrates between each space with the help of the DES. More flows between spaces require more closeness between their locations. Therefore, these flowrates are significant parameters to identify closeness ratings between each space, which also helps to create relationship charts (REL-charts) to be used during the space planning process. To the authors' knowledge, currently, there does not exist any publicly available DES model and building PoR test tool for hospitals in GH, especially for computational design and space planning.

Conclusions
This paper introduced a new plug-in tool for grasshopper algorithmic modeling (GH) in the Rhinoceros CAD program. This tool is envisioned as a part of a larger suite of tools to bridge the gap between Operations Research and Architectural Design, specifically for computational space planning of hospitals. A discrete event simulation (DES) is implemented in this tool for patientflow modeling. Outputs of the DES model facilitate the validation of the match between space planning elements such as PoR and REL charts and the operational logic of the building. For future work, hospital standards of different countries will be added to the model. Different users such as nurses can be added to the model. DES model can be improved considering different types of scenarios, such as patient-flows in an emergency. Eventually, this tool can be generalized for other types of complex buildings such as airports.

Limitations
We focus on the outpatient department in this paper. In intensive care units or inpatient departments, patient flow logic is different. Treatment processes are different. Also, outpatient departments are working 8 h a day. Simulation runs for 8 h. Other departments' operations run for 24 h in a day. Therefore, the DES is specialized for outpatient, where the waiting times are the most important in these places.