1 Introduction

The Prince of Wales Hospital (PWH) is one of the largest public general hospitals in Hong Kong and the teaching hospital for the Medical Faculty of the Chinese University of Hong Kong. It provides 1,360 hospital beds, employs around 4,000 people and operates as the regional hospital of the New Territories East (serving more than 1.5 million people). In order to provide a good quality of service, PWH has to best-utilize its resources because of the large number of patients served and its limited budget due to tight government financial support. One of the departments facing this challenge head-on is the Emergency Department (ED) which provides 24-h Accident and Emergency (A&E) services. In preparation for the growing (and aging) population in Hong Kong, the ED was relocated in October 2010 to accommodate increasing patient demand.

The ED handles 420 cases a day on average. In the daytime, the department operates two independent divisions: the Walking division and the Non-walking division, respectively treating mobile patients (who can walk) and patients on a trolley or a wheel chair (thus non-walking). After 23:00, the Walking division is closed and the walking patients are diverted to the Non-walking division until 07:00 (i.e., walking patients and non-walking patients are merged to have the same treatment procedure.).

Critical patients arriving by ambulance are rushed to the resuscitation rooms and treated immediately. Otherwise, after registration, patients are assessed by a triage nurse and classified by category (level of urgency) so as to assign priorities for receiving treatments. There are five categories of patients: 1 (critical), 2 (emergency), 3 (urgent), 4 (standard) and 5 (non-urgent). In our work and the rest of this paper, we put category 5 patients into category 4 as they have the same flow and priority in real practice and there are only small portion of category 5 patients. Critically-ill patients (categories 1 and 2 patients), less urgent walking patients (categories 3 and 4 walking patients) and less urgent non-walking patients (categories 3 and 4 non-walking patients) follow different procedures of receiving treatments. Critically-ill patients have the highest priority and category 3 patients have a higher priority over category 4 patients. Within the same category, patients are seen on a first-come, first-served (FCFS) basis.

To provide 24-h A&E services, the ED employs different shifts (normally 8 hours a shift including a meal break of an hour and a short break of 20 min) of doctors to cover the patient demand over a whole day. Basically, there are three shifts: morning (08:00–16:00), evening (16:00–midnight) and midnight shifts (00:00–08:00). In addition, an off-duty doctor is on-call.

As the ED has to handle a large number of patients a day, it must operate at a very high level of efficiency and quality. Ineffective operations can lead to serious consequences such as delay of treatments or even death of critical patients. To guarantee good quality of services, the ED aims to achieve the following service targets, as recommended by the Hospital Authority of Hong Kong Special Administrative Region (2014):

  1. 1.

    Critical patients have to be given immediate care after they are admitted to the ED.

  2. 2.

    Waiting time of emergency patients should be within 15 min.

  3. 3.

    Waiting time of urgent patients should be within 30 min.

With a large number of patient visits but limited manpower, the ED has the very difficult task of trying to offer a good quality service (minimizing patients’ waiting times whilst not compromising the required attention for each patient), and making sure that valuable resources (e.g., doctors’ and nurses’ time and treatment equipment) are well-utilized. Our project team was asked by the ED to analyze and improve patient flows so as to enhance patient satisfaction. We adopt a simulation approach to provide the operations manager in the ED with estimates of values for a set of measures (e.g., patients’ waiting times and doctors’ utilization) to assess the department’s performance and evaluate the impacts on the daily operations with different policies. However, development of the simulation model was complicated by the fact that the data records kept by the department were incomplete for many key operational processes. For example, the duration of key activities (e.g., doctor’s consultations) were not recorded directly. To tackle this issue, we assume Weibull distributions for the key activities (such as consultations, triage, etc.). Next we developed two meta-heuristic search procedures to tune the distribution parameters to obtain a good estimate of the probability distribution of their duration. Our results indicate that our search procedure enabled an accurate model to be built.

This paper is organized as follows. In Sect. 2, we give a literature review on related work. In Sect. 3, we compare the original and the current layouts of the ED. In Sect. 4, we describe our simulation model and our parameter estimation procedures. Section 5 presents the results of the simulation runs with different scenarios and Sect. 6 summarizes our work.

2 Literature review

For a recent survey of applications of operations management techniques in health-care, we refer the reader to Rais and Viana (2011). Here, we focus on the applications to operational enhancements in emergency rooms.

In recent years, researchers have successfully built queueing models for analyzing and improving patient flows, and have proposed decision strategies and policies for EDs. Green et al. (2006) used a Lag stationary independent period-by-period queueing analysis to allocate staff so as to reduce the number of patients who leave without being seen. Cochran and Roche (2009) presented a spreadsheet implementation of a queuing network model with split patient flows (accounting for patient categories of different acuity and arrival patterns and volume), to help reduce patient “walk-aways” and improve service provision of the ED. Huang (2012) considered the control of patient flow, in which physicians have to choose between seeing patients right after triage (facing deadline constraints on their time-till-first-service) and those who are in process but possibly need to return to physicians several times during their ED sojourn (resulting in feedbacks to the queueing system). They also proposed and analyzed scheduling policies with two types of costs: queueing costs incurred per individual doctor visit and congestion costs accumulate over all visits during patient sojourn-times. Saghafian et al. (2012a, b) proposed patient streaming (based on their likelihood of being admitted to the hospital) and complexity-based triage (an up-front estimate of patient complexity) for improving operations in EDs. In both papers, they used a combination of analytic and simulation models to show the effectivenesses of the policies. While there has been much work on deriving analytical models for helping operations enhancements in EDs, we adopt a simulation approach for improving patient flows in the ED of PWH as it can incorporate randomness into the model and is easier to examine many “what-if” scenarios with the complex system of the ED (such as time and category-dependent arrival rates of patients, different service-time distributions and time-varying staffing levels). Moreover, compared with analytical approaches, simulation is less sensitive to model parameters (Sinreich and Marmor 2005). Simulation is also particularly suitable for systems of patient care where resource availability is important (Davies and Davies 1994), where EDs are usually this case (e.g., insufficient medical staff). More importantly, a simulation approach is more convenient for real implementation since practitioners, who are not necessarily equipped with advanced mathematical and programming knowledge, can easily understand and make changes in the system (by changing some input parameters of the simulation model once it is successfully established) within a user-friendly graphical interface. Thus, users can “foresee” outcomes, which are basic statistical performance measures such as maximum and average waiting time of patients and utilization of staff, under complex scenarios.

The applications of simulation in the area of health-care management have been studied for more than half of a century, e.g., Fetter and Thompson (1965); and the academic literature on simulation in health-care is immense. We refer the reader to Günal and Pidd (2010) and Jun et al. (1999) for an overview. According to Brailsford et al. (2009), the number of articles related to health-care simulation or modelling is currently expanding at the rate of about 30 articles a day, nonetheless Jahangirian et al. (2012) found that only 8 % of the papers actually applied simulation to a real problem where real data was used. This proportion is substantially smaller than the corresponding percentages in the areas of commerce (49.1 %) and defense (39.4 %). This highlights the fact that real implementations of simulation models in practice in the health-care sector are still rare and we still need to put more effort on promoting the use of simulation for advancing health-care management. In this paper, we present a real case of analyzing and improving patient flows in an ED in Hong Kong with the use of simulation. In EDs, reported successful cases of applying simulation models were mainly to improve the efficiencies of daily operations. A major proportion of work with the use of simulation in EDs is staff scheduling. The approaches are mainly to evaluate process performance with different staff shift schedules, e.g., Evans et al. (1996), Rossetti et al. (1999) and Wang et al. (2013). Some other papers integrated optimization techniques with simulation. Ahmed and Alkhamis (2009) presented a simulation–optimization approach to determine the optimal number of doctors, lab technicians and nurses required in the ED to maximize patient throughput and to reduce patient time in the system subject to a set of constraints imposed on budgets, patient waiting time and number of servers. Centeno et al. (2003) integrated simulation (for establishing the staffing requirements for each period) and integer linear programming to help ED managers optimize staff schedules so as to maximize utilization within given budgets. Yeh and Lin (2007) utilized simulation and a genetic algorithm to obtain a near-optimal nurse schedule based on minimizing the patients’ queue time. There has also been work on examining queueing priorities in EDs by running simulation experiments. Connelly and Bair (2004) developed a simulation model for system-level investigation of ED operations and to compare a fast-track triage approach with an acuity-ratio triage approach. Other related applications include policy/decision making. Hoot et al. (2008) used simulation of patient flow to predict near-future ED operational measures and to forecast ED crowding. Lane et al. (2000) used simulation to analyze the functioning of the ED system under different policies, different bed capacity and demand pattern scenarios. Baesler et al. (2003) developed a simulation model to estimate the function of patients’ time-in-system and the maximum level of patient demand that the system can absorb. Wang et al. (2009) developed a simulation model by using ARIS and ARENA to identify process bottlenecks and adjust resource allocation or staff dimensioning. They also proposed doctor’s efficiency improvement and quick pass process to reduce waiting time. Abo-Hamad and Arisha (2013) developed an interactive simulation-based decision support framework to examine the impacts of different potential alternatives (opening a short stay unit, increasing number of trolleys, adding an additional senior house officer overnight shift, and their combinations) on some key performance indicators such as average waiting time, length of stay and resource utilizations.

The development of our simulation model of the ED was challenged by the fact that the service-time distributions are not directly obtainable. There has been much work in the literature on estimating service-time distributions. For example, Babes and Sarma (1991) used Weibull, Gamma, and exponential distributions to estimate the service-time distributions in a health center. May et al. (2000) and Spangler et al. (2004) estimated the surgical procedure times by fitting lognormal distributions. However, in these papers, the actual service durations (i.e., the time differences between services started and ended) were recorded so that the service-time distribution could be directly estimated. When real data are incomplete or not available so that service durations cannot be directly estimated, researchers may need to use indirect approaches to model or estimate. A major research on handling missing data is using imputation (Enders 2010). The basic idea is to fill in the missing data with some plausible values, such as mean substitution (Donner 1982), hot-deck imputation (Ford 1983), expectation maximization (Dempster et al. 1977), and multiple imputation (Rubin 2009). However, most of the work in this research direction deals with the cases that, given a set of variables (or attributes) associated with a dataset, only a proportion of, but not all, the values are missing so that some statistical tools such as regression or maximum likelihood function can be used to estimate the missing values. In our application, the service end times of patients were not recorded in the computer system of the ED so that service durations of patients could not be directly calculated and hence traditional imputation approaches could not be applied. In the literature, if no records of the required activity durations are available, researchers may need to make further assumptions. For example, Zhang et al. (2004, 2005) used fuzzy numbers instead of probability distributions to describe activity durations in a building construction simulation model. For simulation model validation, Kleijen (1999) suggested different approaches in three different situations: (1) no real data, (2) only real output data, and (3) both real input and output data. Although in our application the service durations of patients could not be directly calculated from the historical data, we had some other time stamps which enable us to derive an indirect approach to estimate the service-time distributions. In this paper, we propose a simulation–optimization approach (an integration of simulation and meta-heuristics) to obtain a good estimate of the required parameters for our simulation model, when records are missing and such parameters cannot be directly estimated.

3 Comparisons between the original and current settings

Before we introduce our simulation model, we first present some real operational enhancements made by the ED. In October 2010, the ED of PWH was relocated to a new building with a new layout. Several changes were also made in the new system to accommodate the increasing patient demand. In this section, we analyze two major changes in the operations and compare the efficiencies of the original and current systems. To make fair comparisons, we present some of the real data of the month of December 2009 (when operating in the old location) and December 2010 (after relocation) provided by the ED. The data were stored in the computer system of the ED and contain the triage category, arrival time, start times of service activities (triage and consultation) and departure time of each patient. All of the data were recorded by the staff at the service stations. In the data, there were 12,945 patient visits in December 2009, and 13,287 patient visits in 2010, which translate to around 418 and 429 cases per day respectively. (The reason why we did not choose the first month after the relocation to make comparisons is that a “warm-up” period was needed since initially most of the staff needed time to get used to the new layout, system and settings.) Below, we describe two key changes in layout and operations and their impacts.

3.1 A closer sub-waiting area for consultation in the walking division

After the relocation of the ED, the waiting area for doctor’s consultation in the Walking division was moved from the main waiting area to a new sub-waiting area, which is closer to the consultation rooms than before. This aims to shorten the walking time of patients. More importantly, this enables the nurses to more easily notify the patients that they will soon be seen by a doctor, so that they would not leave the waiting area (e.g., for a meal) while waiting. Consequently, this reduces the inactivity times of doctors waiting for “missing” patients, and hence reduces the waiting times of subsequent patients seen.

We compare the net times from triage to consultation for category 4 patients, who are mostly walking patients, before and after the relocation. Comparing the data of 2009 and 2010, although there was an increase of 2.64 % in the total number of patient visits, the average net time from triage to consultation for category 4 patients decreased from 112.91 to 107.77 min (a 4.55 % decrease). We conducted a two-sample t test, at the 0.05 level of significance, to test whether the average net time from triage to consultation for category 4 patients decreased from 2009 to 2010.

\(H_0\)::

There is no difference between the average net times from triage to consultation for category 4 patients in 2009 and 2010.

\(H_1\)::

The average net time from triage to consultation for category 4 patients in 2010 is less than the one in 2009.

The t statistic is 3.31 (larger than 1.645) and the \(p\) value is 0.001 (less than 0.05), and hence the null hypothesis is rejected at the 0.05 level of significance. This suggests that walking patients benefit from the change of the layout of the waiting area in the Walking division.

Fig. 1
figure 1

Net time from triage to consultation for category 4 patients

From Fig. 1, we observe the distribution of net time from triage to consultation for category 4 patients in December 2009 has a heavier tail. The percentage of category 4 patients who had net time from triage to consultation more than 3 hours decreased from 21.57 to 16.01 % (a 25.78 % decrease). This indicates the increase in walking time of patients could amplify the waiting times of patients.

3.2 Consolidation of the walking and non-walking divisions in nighttime

Before the relocation, the walking and non-walking divisions operated independently, each with its own staff and resources. After the relocation, the ED started to implement the policy that during nighttime (from 23:00 to 07:00) the Walking division is closed and the walking patients would join the system of the Non-walking division. It aims to better-utilize the reduced workforce (about half of the workforce of daytime) due to the low arrival rates of patients in nighttime.

Fig. 2
figure 2

Average net time from triage to consultation for less urgent patients by arrival time of day

Figure 2 depicts the average net time from triage to consultation for less urgent patients (i.e., category 3 and 4 patients) by arrival time of day in 2009 and 2010. From 07:00 to 20:00, the net times were similar in the two years. From 20:00 to 07:00, a significant improvement was observed. An interesting finding is that patients arriving after 20:00 but before 23:00 also benefited from the consolidation of the divisions. We believe it is due to the fact that some of these patients might need to wait for consultation for more than 3 hours so that they might start consultation after 23:00 and hence benefited from the change.

4 Simulation model

The system of the ED consists of many stochastic components such as patient arrivals and service durations. Although a queueing theory approach may be appropriate to model the uncertainty in the system, as also reported by other researchers, it is very difficult to build analytical models for EDs as there are many complicating factors in reality (such as time and category-dependent arrival rates of patients, multiple shift-times of doctors and re-entrant flows to the many “service stations” of the system). On the other hand, a simulation approach can incorporate uncertainty into the model of the ED and also include those complicating factors. From a modeling point of view, if we would like to evaluate the impacts of some changes in the system (e.g., priority rules and changes of layout) on the ED performance, we do not have to rebuild a completely different model, but instead, only need to modify some modules of the simulation model. More importantly, practitioners without advanced mathematical knowledge, who may find analytical approaches difficult, can also easily understand and make changes in the simulation model in a user-friendly interface. By using simulation, we can explore possible changes without jeopardizing patient care. For this reason, we adopt a simulation approach which facilitates examination of many “what-if” scenarios, and provide valuable indications as to where the major bottlenecks of the system might be.

In this section, we discuss the technical issues when developing our simulation model. In Sect. 4.1, we present our time and category-dependent patient arrival process. In Sect. 4.2, we discuss the challenges that some key parameters in the simulation model are not directly obtainable and our parameter estimation procedure to search for the necessary input parameters for the simulation model.

4.1 Time and category-dependent arrivals

From the data provided by the ED at PWH, the interarrival time of each patient category is observed to follow an exponential distribution. We also observe that the arrival rates of different categories are heterogeneous. From the ED at PWH, the numbers of categories 1 and 2 patients are relatively low whereas the vast majority of the patients are from categories 3 and 4. Another finding from the data is that the arrival rates vary over time. These two findings are consistent with the literature (e.g., Kumar and Kapur 1989; Rossetti et al. 1999).

The arrivals of patients with time-dependent arrival rates can be regarded as non-homogeneous Poisson processes (NHPP), which has been well-studied (see e.g., Cinlar 1975; Leemis 1991; Eick et al. 1993), although analytical results are known for only specialized cases. In our simulation, we model the arrival events by category and by time of day. To simulate an arrival of a patient, we generate an interarrival time, which follows an exponential distribution with arrival rate \(\lambda\), corresponding to the arrival rate in the time period of the previous arrival for the particular patient category. Specifically, we let \(\lambda _k(t)\) be the arrival rate of patient category \(k\) at time \(t\) and \(A_{k,n}\) be the arrival time of the \(n\)-th patient of category \(k\). If \(A_{k,n} = t\), we let \(I_{k,n}(t)\) be the interarrival time between the \(n\)-th patient and the \((n+1)\)-th patient from category \(k\). The time of the next arrival from the same category is \(A_{k,n+1}=A_{k,n}+I_{k,n}(t)\) , where \(A_{k,1}\sim Exp(\lambda _k(0))\) and \(I_{k,n}(t) \sim Exp(\lambda _k(t))\). Whenever we generate an interarrival time, we use the arrival rate that was in effect when the previous arrival occurred. This allows us to incorporate the effects of the non-stationary time-varying arrival rates of patients. To verify our category-dependent arrival procedure, we simulated the arrivals of a month. Figure 3 shows that the proportion of patients observed in the simulation in each category were quite close to the actual data. We present in Figs. 4 and 5 the actual and simulated arrival rates of categories 3 and 4 patients (which comprises the majority of patients), respectively, by time of day.

Fig. 3
figure 3

Proportion of patients in each category: actual data versus simulated results

Fig. 4
figure 4

Arrival rate of category 3 patients by time of day: actual versus simulated

Fig. 5
figure 5

Arrival rate of category 4 patients by time of day: actual versus simulated

To further validate the time-varying arrival procedure, we conducted a two sample Kolmogorov–Smirnov (K–S) test to compare the actual and simulated interarrival times of category 3 patients for each hour. We choose to report the interarrival times of category 3 patients because the sample size of category 3 patients is large enough to be analyzed; there were very few category 1 and 2 patients in each month (less than 10 samples in some hours). Another reason is that the time stamps stored by the computer system of the ED were corrected to the minute (i.e., discrete); category 4 patients have a very high arrival rate (more than 20 patients), or equivalently a very small average interarrival time (2–3 min), in peak hours so that the actual data are not precise enough to be compared with the simulated results.

For each hour, we conduct the following K–S hypothesis testing for the actual and simulated interarrival times of category 3 patients.

\(H_0\)::

The actual and simulated interarrival times follow the same distribution.

\(H_1\)::

The actual and simulated interarrival times follow different distributions.

Table 1 gives the \(p\) values of the K–S hypotheses. Of the 24 K–S hypotheses, 22 of the null hypotheses are not rejected at the 0.05 level of significance. Here, we note that the arrival times of patients obtained from the ED do not represent the exact arrival times because the ED recorded patient arrivals at the time of registration (i.e., patients may have to queue after their arrivals) and, as mentioned, the system has all the time stamps only corrected to the minute. Given these considerations, we believe that the simulated arrivals match the actual arrivals fairly.

Table 1 \(p\) values of the K–S hypotheses on the actual and simulated interarrival times of category 3 patients

For an illustration purpose, we also present the actual and simulated interarrival times of category 3 patients in the two time periods which have the median arrival rates (19:00–20:00 and 21:00–22:00) in Figs. 6 and 7, respectively.

Fig. 6
figure 6

Interarrival time of category 3 patients in the period of 19:00–20:00: actual versus simulated

Fig. 7
figure 7

Interarrival time of category 3 patients in the period of 21:00–22:00: actual versus simulated

4.2 Service activities

Service activities refer to the operations such as registration, triage, consultations and resuscitation for walking and non-walking patients, where the duration of each service activity has its own probability distribution. To accommodate the variety of distributions, we assume that the service times follow Weibull distributions, which can fit many continuous functions on the positive real line. For example, when the shape parameter equals one, a Weibull distribution reduces to an exponential distribution, which is commonly used to model service durations (e.g., De Angelis et al. 2003; Siddharthan et al. 1996). Weibull distributions can also fairly approximate normal distributions with some values of the shape parameter (Rinne 2008). Some literature also reported that their service durations follow Weilbull distributions (e.g., Rohleder et al. 2011). We notice that some literature assumes that their service durations follow other probability distributions such as uniform distributions (e.g., García et al. 1995), triangular distributions (e.g., Draeger 1992; Yeh and Lin 2007) and log-normal distributions (e.g., Hoot et al. 2008). Although in our implementation we assume that the service activities follow Weibull distributions, our parameter estimation procedures described in Sects. 4.3 and 4.4 are very general (not restricted only to Weibull distributions) and can also be applied with any continuous probability distributions.

Let \(S_{i,n}\) be the service time for the \(n\)-th execution of service operation \(i\). We assume that \(S_{i,n} \sim Weibull (\alpha _i, \beta _i)\). For each service operation, we choose the appropriate distribution parameters \(\alpha\) (the scale parameter) and \(\beta\) (the shape parameter). We assume the service rates, hence \(\alpha\) and \(\beta\), are constant for all time periods for a given service operation. Implicitly, this assumes that the doctors and nurses maintain the same level of effectiveness throughout their shifts.

To build an accurate simulation of the ED, we need the probability distributions of its activities. Ideally, these distribution parameters can be obtained from historical data. However, data from the ED at PWH on patient movements were incomplete. The available data included only the time-stamps when patients started service for the activities (triage, consultation, etc.) in the ED. Unfortunately, the time-stamps when patients completed the service were not recorded, so the service times cannot be measured directly. Figure 8 illustrates the time-stamps we obtained from the computer system.

Fig. 8
figure 8

Time-stamps recorded when a less non-urgent walking patient visits the ED

In the following, we present some search methods to estimate the parameters for the distributions required for our simulation model, and discuss the challenges of such parameter estimations.

4.3 Estimation of service-time distributions

The available data we have are the times in between the start of two different services for each patient (such as from triage to consultation). This “time difference” consists of the service time in triage and the waiting time before consultation. Thus, the actual service durations are not measured, and hence their distribution parameters cannot be directly estimated. Suppose we simulate with a “guesstimate” for the parameters of the service durations (e.g., for triage and for consultation), the resultant “time differences” can then be measured from the simulation. If the patterns of the time differences are consistent with the ones of actual data, it is likely that a good estimate of the parameters of service times was used for the simulation model. Since the parameters for different service distributions interact with each other to influence these “time differences”, the whole set of parameters has to be considered simultaneously to determine if the parameters for all the service durations are estimated accurately. By trying different sets of values of \(\alpha _i\) and \(\beta _i\) for ALL the different distributions needed for the simulation model, we choose the set for which the simulated results are most consistent with the actual data.

Specifically, we let \(\alpha\) and \(\beta\) be the vectors of parameters \(\alpha _i\) and \(\beta _i\); we denote by \(\alpha \beta\) the appended vector \(\alpha \beta =\left( \begin{array}{c}\alpha \\ \beta \end{array}\right)\). Let \(\overline{x}_{k,n}\) and \(x_{k,n}^{\alpha \beta }\) respectively be the actual and simulated time differences with parameters \(\alpha \beta\) from triage to consultation for the \(n\)-th patient from category \(k\) respectively, where \(k \ne 1, 2\). (Since patients from categories 1 and 2 can receive immediate treatment, with no triage and no waiting time, these categories are not considered in our consistency measure.) Let \(\overline{\mu }_k\) (\(\mu _k^{\alpha \beta }\) respectively) and \(\overline{\sigma }_k\) (\(\sigma _k^{\alpha \beta }\) respectively) be the average and the standard deviation of these \(\overline{x}_{k,n}\) ( \(x_{k,n}^{\alpha \beta }\) respectively).

Instead of simply comparing means, we use a more detailed consistency measure to compare the distribution profiles. We divide the domains of the probability distributions into intervals. Let \(\overline{p}_{k,j}\) (\(p_{k,j}^{\alpha \beta }\) respectively) be the proportion of patients with \(\overline{x}_{k,n}\) ( \(x_{k,n}^{\alpha \beta }\) respectively) in the \(j\)-th interval \([l_j, l_{j+1})\), i.e., \(\overline{p}_{k,j}=\frac{\overline{N}_{k,j}}{\overline{N}_k}\), where \(\overline{N}_{k,j}=|\{n:l_j \le \overline{x}_{k,n} < l_{j+1}\}|\) and \(\overline{N}_k\) is the total number of patients in the actual data. Similarly, \(p_{k,j}^{\alpha \beta }=\frac{N_{k,j}^{\alpha \beta }}{N_k^{\alpha \beta }}\), where \(N_{k,j}^{\alpha \beta }=|\{ n:l_j \le x_{k,n}^{\alpha \beta }< l_{j+1}\} |\) and \(N_{k}^{\alpha \beta }\) is the total number of patients in the simulation with parameters \(\alpha \beta\). We use the following function to measure the consistency between the actual data and the simulated result.

$$\begin{aligned} c\left( x^{\alpha \beta }, \overline{x}\right)&= \gamma _1 \sum _k w_{1,k} \frac{|\mu _k^{\alpha \beta }-\overline{\mu }_k|}{\overline{\mu _k}}+\gamma _2 \sum _k w_{2,k} \frac{|\sigma _k^{\alpha \beta }-\overline{\sigma }_k|}{\overline{\sigma _k}}\\&\quad +\,(1-\gamma _1-\gamma _2) \sum _k w_{3,k} \sum _j a_j \frac{|p_{k,j}^{\alpha \beta }-\overline{p}_{k,j}|}{\overline{p}_{k,j}} \end{aligned}$$

where \(0 \le \gamma _i, w_{m,k}, a_j \le 1\), and \(\sum _k w_{m,k}=\sum _j a_j =1\). The function \(c(x^{\alpha \beta }, \overline{x})\) is a weighted average of the absolute values of the relative errors of the mean, standard deviation and the proportions of classes for each category of patients. The last term of the consistency function measures the difference between the actual and simulated distribution profiles. The lower the value, the higher is the consistency between the data and the simulated result.

4.4 Search procedure for parameter estimation

In the literature on simulation models in health-care, we did not find much discussion on the problem of service times not directly measurable. One related work is De Angelis et al. (2003), who estimated the parameters of the approximated function of average time a patient spent in the system, using simulation and optimization routines. In our case, the estimation problem is more complicated since we are estimating parameters of probability distributions and not just a deterministic function; the parameters of the Weibull distributions to be estimated do not explicitly appear in our consistency function \(c(x^{\alpha \beta }, \overline{x})\).

We estimate the set of parameters jointly using a search procedure. Starting with an initial guess of the distribution parameters, we compute the consistency function to evaluate “goodness of fit”. We explore iteratively a search neighborhood by adding/subtracting an increment to/from the current set of parameters, until the stopping criterion is satisfied, and retain the set of parameters with the smallest value of the consistency function. We tested two widely-used search methods—the Descent Method and Simulated Annealing—and report on their effectiveness in identifying parameters for our simulation model.

4.4.1 Parameter estimation by descent method

In the descent method (DM), one moves along a search direction until no improvement can be made. At that point, the algorithm selects another search direction. The procedure stops when there is no further improvement in all directions examined. In our implementation, a search direction corresponds to increasing or decreasing the value of a single parameter. i.e., Given a current combination of parameters \(\alpha \beta\), the new combination of parameters is obtained from \(\alpha \beta\) by increasing or decreasing a single parameter. Then we run simulations to evaluate the new \(x^{\alpha \beta }\) and hence \(c(x^{\alpha \beta }, \overline{x})\). If an increase (a decrease) in the parameter value improves the consistency objective \(c(x^{\alpha \beta }, \overline{x})\), i.e., the consistency objective value is smaller, then the algorithm keeps increasing (decreasing) the value until there is no improvement. When the algorithm cannot reduce the consistency objective value when moving in that direction, it selects another parameter to adjust and repeats the above search procedure. The algorithm terminates when it cannot reduce the consistency objective value by changing any one of the parameter values or reaches the preset maximum number of iterations. We remark that the increments of the search step should be small enough to be able to identify optima in the search neighborhood, but at the same time not too small to make our search procedure inefficient. The procedure is summarized as follows.

figure a

Using a more general search direction (instead of co-ordinate direction only) may improve convergence and find better local optima, but determining the search direction may not be straightforward. It would certainly be interesting to considering more general descent directions in our future research.

By the DM, we can obtain a “good” solution quickly. However, the solution can become trapped at a local optimal point, and global optimality is in general not guaranteed. Therefore, we apply a “hill-climbing” meta-heuristic—simulated annealing—to resolve the problem.

4.4.2 Parameter estimation by simulated annealing

Simulated annealing (SA), introduced by Kirkpatrick et al. (1983), is a probabilistic meta-heuristic widely-adopted for global optimization problems, especially in combinatorial optimization. SA is designed to avoid the search process being trapped at a local optimum. To apply the algorithm, a neighborhood structure is defined. If there is an improvement when moving from the current solution to a neighboring point, we always make the move. However, if the move would worsen the objective value, the move is still accepted with some probability, which depends on the change in the objective function and the current number of iterations. A temperature, \(T\), is used to determine how the acceptance chance of a worse move changing with the number of iterations. Thus, our SA search procedure is almost the same as our DM, except that some worse moves (i.e., increasing or decreasing a parameter value will increase the consistency objective value) might be accepted by chance. For comparison with the DM, we define the neighborhood as differing by one parameter value only. We summarize our SA search procedure as follows.

figure b

Note that the acceptance criterion ensures that all improved moves are accepted since \(e^{\frac{\delta }{T}}>1\) as \(\delta >0\). The temperature \(T\) acts to control the search process. As the number of iterations increases, \(T\) becomes smaller and smaller, so non-improving moves have a lower chance of being accepted and the algorithm tends to resemble the DM. When the algorithm terminates, we can also save the final solution as an initial solution to restart the procedure again. A good initial guess of the parameters \(\alpha \beta\) can lead to a good solution using the above two methods. In our computations, the initial values of the Weibull parameters were estimated based on discussions with the ED operations manager at PWH.

For each iteration to evaluate a set of parameters, we ran a simulation of 34 days with a warm-up period of 3 days, i.e., a simulation of 31 days starting from a non-empty system. This can produce around 13,000 patient records to make comparison with the real data. We notice that the simulated results would be more accurate if we increase the number of replications. However, a large number of replications will make the search procedure inefficient. We applied both the DM and SA to search for the best parameters to fit the real data. DM made no improvement after 2,000 iterations, with a final consistency value of 0.1736 (i.e., an average absolute relative error of 17.36 %). We let the SA run 5,000 iterations, then used the final solution to restart the process again, and repeated this process 3 times. The best combination of parameters found by the SA has a consistency value of 0.0738. In comparing the DM and SA for parameter estimation, we observed that the DM became trapped at local optima, as other researchers have reported. We also observed that this solution was quite far from the solution that we obtained by the SA, in terms of the objective value. However, one advantage of using the DM is that the algorithm terminates in a relatively short time since local optima can always be found easily by just moving in a beneficial direction. In terms of solution quality, the SA provides a better solution but the solution time may be long. Figures 9 and 10 illustrate the comparisons between the actual data and simulated results (with the best parameters found) of the time spent from triage to consultation for categories 3 and 4 patients. The figures suggest we obtained reasonably good estimates of the parameters.

Fig. 9
figure 9

Time spent from triage to consultation for category 3 patients: actual versus simulated

Fig. 10
figure 10

Time spent from triage to consultation for category 4 patients: actual versus simulated

With the parameter estimation procedure, we developed a very detailed model of the new ED to analyze patient flows. Our simulation model captures: all relevant treatment processes (triage, consultation, lab tests, etc.), the complexities of intertwining and re-entrant patient-flows, complicated arrival rates that vary by time and patient category and adjustable staff deployment (shift, breaks, etc.). The necessary input parameters/data are arrival rates, probability distributions of service times, available resources and schedules of doctors and nurses. The outputs are the key performance measures such as patients’ waiting time, queue lengths, utilizations of doctors, which help us to study and understand the performance of the ED. The key modules in our simulation model and their uses are as follows:

  • Patient arrivals (CREATE modules): Each module generates patients of the same category according to the arrival time of the previous arrival.

  • Patient attributes (ASSIGN modules): Each module assigns attributes (e.g., triage duration, consultation duration, binary values to indicate if further examinations are needed) to a patient according to his/her category.

  • Walking or Non-walking division determination (DECIDE module): This module decides if a patient goes to walking or non-walking division, according to his/her mobility and the current time (the Walking division is closed from 23:00 to 07:00).

  • Triage (PROCESS modules): Two modules, respectively for Walking division and Non-walking division, request for a triage nurse (using Seize Delay Release) to examine a less urgent patient and assign triage category.

  • Consultation (PROCESS modules): Two modules, respectively for Walking division and Non-Walking division, request for a physician (using Seize Delay Release) to provide medical service to a less urgent patient.

  • Resuscitation (PROCESS module): This module requests for two physicians from Non-walking division (using Seize Delay Release) to resuscitate a critically-ill patient.

  • Lab tests (PROCESS modules): Each module requests for a resource (using Seize Delay Release), e.g., an X-ray test technician, to provide an extra test to a patient.

  • Discharge (DEPOSE module): A patient can be discharged from the ED after all the required medical services.

Through the simulation model, we can identify potential enhancements of the system and hence improve the service quality. To further validate our simulation model, we presented the model and the simulated key performance indicators such as waiting times of patients to a consultant in the ED. He believed the model was sufficient to capture all the key activities and those values agreed with his estimations. Our simulated results are also consistent with the findings in an independent research of a 5-year study of PWH ED (Wai et al. 2009).

5 Simulation results

By running simulations, we have a way to obtain performance measures for the ED under different scenarios and, thus, to evaluate possible policies and changes in the system. We used the current arrival rates and the actual staff schedule as the input parameters for our base case. We did a series of simulation runs to evaluate different possible scenarios. For each scenario, we ran 100 replications of simulations of 34 days with a warm-up period of 3 days, which is equivalent to 100 simulations of 31 days starting from non-empty systems, and recorded the net times from registration to consultation for less urgent patients. The net times from registration to consultation indicate how long after arrival the patients can receive medical treatments.

5.1 Ten-percent growth in patient arrivals

The population in Hong Kong keeps increasing [with an annual growth of around 1 %, according to the end-year population report for 2012 issued by the Census and Statistics Department of the Hong Kong Government (Census and Statistics Department, the Government of the Hong Kong Special Administrative Region 2013)], mainly due to an influx of immigrants. Moreover, more and more non-immigrant visitors from Mainland China also come to Hong Kong for a better quality of medical treatments. Thus, the demand for medical services in Hong Kong is expected to have significant growth in the coming future. This is of particular concern for the EDs, which are often viewed as inexpensive clinics by the non-critical patients who visit them.

To study how the growth of patient visits impact on the daily operations in the ED, we increased the arrival rates of all patient categories by 10 % (which is equivalent to the percentage increase in 3–4 years using the estimated annual increase of 2.64 %) and keep all the capacities and resources at the current levels.

Table 2 Net times (in minutes) from registration to consultation for less urgent patients based on the current arrivals and the simulated scenario (10 % growth in patient arrivals)

From Table 2, we observe that a 10 % growth of patient arrivals leads to a big increase in the net times from registration to consultation and larger variances of these net times (as indicated by the half widths). The net times from registration to consultation increase more than 45 % for all less urgent patient categories. Non-walking patients would suffer from a longer time from registration to consultation (more than doubled) due to the increase in the number of patients. As expected, a larger increase in this net time is observed for category 4 patients since a lower priority is given to them. The 10 % growth in patient arrivals leads to an increase in doctors’ utilization, from 86.60 to 95.90 %. Some doctors are overloaded with utilization of more than 100 % (i.e., some doctors are always busy in their scheduled work shifts plus some extra time to finish providing medical services to the last patient of their work shifts). Moreover, it is important to point out that, based on the above results, the service target of “waiting time of urgent patients should be within 30 min” set by the Hospital Authority of Hong Kong probably cannot be met after 10 % growth of patients arrivals if the capacities and resources of the ED are kept at the current levels.

5.2 Adding an extra doctor

In order to analyze the impacts of adding additional resources on the ED performance, we evaluate the time for patients to receive medical treatments if an extra doctor is hired, based on the current arrival profile. This activity is useful to determine the optimal trade-off between the cost of additional workforce and the services provided.

Before adding an extra doctor to the simulation model, we calculated the utilization of every doctor in order to assess which doctors are overloaded. We observe a significant overuse of the doctors working the afternoon shift in the Walking division and those for the mid-night shift. Therefore, we simulated the two scenarios when an extra doctor is added to each of the shift.

Table 3 Net times (in minutes) from registration to consultation for less urgent patients based on the current situation and the simulated scenario (an extra doctor added to the afternoon shift in the Walking division)

Table 3 lists the net times from registration to consultation for less urgent patients if we add an extra doctor to the afternoon shift in the Walking division. Not surprisingly, on average, the relative time reduction for category 3 patients from registration to consultation is smaller than category 4 patients’ as category 3 patients have a higher priority. An interesting finding is that non-walking patients also benefit from the addition of an extra doctor to the Walking division because more walking patients are cleared before the consolidation of the walking and non-walking divisions at 23:00 (i.e., Walking division is closed).

Table 4 Net times (in minutes) from registration to consultation for less urgent patients based on the current situation and the simulated scenario (an extra doctor added to the mid-night shift)

Alternatively, if we add an extra doctor to the mid-night shift, we observe a more significant reduction in the net times for the patients in the Non-walking division (see Table 4). Although the walking patients are directed to the Non-walking division for consultation in nighttime, we can only make a less significant reduction in the waiting times for walking patients after adding an extra doctor to the mid-night shift. We believe this is due to the fact that the consultation is still not fast enough to clear the patients of the lowest priority, who are category 4 walking patients. Another possible reason is that patients usually experience longer waiting times during afternoon but not nighttime, which is shown in Fig. 2. Finally, we report that having an extra doctor can contribute to a decrease in doctors’ utilization from 86.60 to 80.46 %.

5.3 Reallocation of doctor

Although adding more resources to the ED is the best way to improve the patient flows, the financial issue is one of the major concerns of the hospital management. Given limited budgets, one way to improve the patient flows is to best-utilize the current resources. Therefore, we would like evaluate how the schedules of the doctors, who are the most valuable resources in the ED, might be changed to improve the efficiency of the ED. By measuring the utilizations of doctors in the current scenario, we can find out the doctors with the heaviest and lightest workloads. They are the doctors in the Walking division and Non-walking division, respectively, in the afternoon. An interesting scenario would be to assign the doctor who has the lightest workload to the shift of heaviest workload. (i.e., In the afternoon shift, extract a doctor in the Non-walking division and assign him/her to the Walking division.) The results are shown in Table 5.

Table 5 Net times (in minutes) from registration to consultation for less urgent patients based on the current situation and the simulated scenario (reallocation of doctor)

As expected, walking patients benefit from this reallocation. A significant reduction in the net time from registration to consultation is observed for walking patients. However, this net time for non-walking patients increases as a doctor is removed from the Non-walking division. The reallocation of doctor, of course, benefits the majority, but at the same time, hurts the more urgent minority. To decide whether we should employ this schedule, we have to determine the optimal trade-off. Simulation is a tool for decision makers to “predict” how good or how bad a change impacts the system in order to make the right balance. We would like to point out that, although there is an increase in the time to receive consultation for category 3 non-walking patients after this reallocation, the absolute increase (0.46 min) is still small enough to be within range of the target waiting time set by the Hospital Authority for patients of this category. Moreover, this increase is comparably much smaller than the absolute reduction for the category 4 walking patients (86.71 min). As the majority of patients are category 4 walking patients, a reduction in total average waiting time is achieved after the reallocation. Nonetheless, this balance between benefits to the majority and urgency of service to those in need is a difficult decision for the hospital management.

5.4 Staggered shifts

In a setting of staggered shifts, staff start and finish at slightly different times (but the durations of shifts are usually the same). The use of staggered shifts has been proven to be effective in better-allocating workforce to match demands. For example, Sinreich and Jabali (2007) adopted staggered shifts to downsize and restructure the workforce in an ED while maintaining the original operational measures. In this research, we explore, with our simulation model, the benefits of an employment of staggered shifts for physician scheduling in the ED of PWH. By observing the arrival patterns in Fig. 5, we adopt six different shift staring times, staggered 30 min from 07:00 to 09:30, to replace the original starting time at 08:00.

Table 6 Net times (in minutes) from registration to consultation for less urgent patients based on the current situation and the simulated scenario (adopting staggered shifts)

Table 6 shows the net times from registration to consultation for less urgent patients when adopting the staggered shifts. The adoption of staggered shifts benefits most of the patient categories with reductions in the net times ranging from 0.18 to 5.71 %. Staggered shifts not only better-matches manpower with patients’ demands, but also enhances quality of services provided, since staff members would have some overlaps of shift times so that they can hand over the tasks to those of the following shift. Thus, the adoption of staggered shifts is expected to benefit the overall operational performance of the ED more than what the simulation results show. Finally, we remark that even though a proper use of staggered shifts is usually beneficial to operations, it may be difficult to implement in practice. For example, staff members may complain about unfair work schedules (e.g., some people starting very early) and it is hard for the ED to conduct a briefing before the staff members start to work.

5.5 Having nurse practitioners

A nurse practitioner (NP) is an advanced practice registered nurse who has completed clinical education beyond that required of a regular registered nurse, and can diagnose and treat a wide variety of medical problems. Lenz et al. (2004) found in their 2-year follow-up study that outcomes of patients assigned for their primary care to a NP practice do not differ from those of patients assigned to a physician. Other research (e.g., Blunt 1998; Chamberlain and Klig 2001; McGee and Kaplan 2007) have also proven that the use of NPs can provide high quality, efficient and cost-effective care in EDs. In this investigation, we evaluate the benefits from replacing the regular registered nurses at the triage stations by NPs. According to Niska et al. (2010), 4.0 % of the patients were seen by NPs in EDs in U.S. and we assume in our simulations that this percentage of patients can be discharged after being seen by a NP.

Table 7 Net times (in minutes) from registration to consultation for less urgent patients based on the current situation and the simulated scenario (having nurse practitioners)

Table 7 shows the benefits of replacing regular registered nurses by NPs at the triage stations. Note that, in Table 7, the statistics of the scenario of having NPs exclude those patients who could be discharged immediately after being treated by a NP. There are reductions in the net times from registration to consultation for most patient types. Although there is a slight increase in this net time for category 3 walking patients, this increase is not statistically significant by observing the corresponding half widths. We observe that, for some patient types, the benefits of having NPs are more significant than having an extra doctor. For example, the reductions in the net times for category 4 walking and category 3 non-walking patients when having NPs are greater than those when having an extra doctor in the mid-night shift (see Tables 47). Although a NP (with an average annual salary of USD 91,450 in 2012 according to the 100 Best Jobs, Money, U.S. News 2014) is, in general, less expensive than an emergency physician (with an average annual salary of USD 270,000 in 2012 according to Emergency Medicine Physician Compensation Report, Medscape 2013), replacing all the regular registered nurses (with an average annual salary of USD 67,930 in 2012 according to the 100 Best Jobs, Money, U.S. News 2014) by NPs at the triage stations for all shifts can be more expensive. Thus, when there is an additional financial support given to the ED for increasing workforce, the ED has to consider all the benefits to different groups of patients and the total costs of hiring different types of staff. A rough estimate of the cost of replacing all the regular registered nurses by NPs at the triage stations is (USD 91,450–USD 67,930) \(\times\) 5 (one triage nurse each at walking and non-walking divisions for the morning and afternoon shifts, and one triage nurse for the mid-night shift) \(=\) USD 117,600, which is less expensive than an emergency physician. This appears that having NPs is more cost-effective for the ED. Thus, our simulation model allows the human resources managers of the ED to examine the trade-offs between having different workforce plans.

To summarize, although reallocation of doctor (in the afternoon shift, extract a doctor in the Non-walking division and assign him/her to the Walking division) has a significant reduction in the time to receive medical treatments for category 4 walking patients, the category 4 non-walking patients experience a significantly longer time for waiting for consultation. It appears that the implementation of staggered shifts is better if the ED does not want to increase the waiting time of any patient category. If there is only a tight financial budget for the ED to hire medical staff, replacing regular registered nurses by NPs at the triage stations seems to be more cost-effective. However, if the ED has a generous financial support, hiring an additional physician for the afternoon shift in the Walking division can reduce a significant amount of time for patients for waiting for consultation (since adding more NPs than sufficient would not bring more benefits). Although we just presented some of the issues examined, the simulation model could be used by the operations manager in the ED to evaluate many other possible changes in the system, such as layout, capacities and resources.

6 Conclusions

This paper presents a case study of analyzing patient flows in a hospital ED in Hong Kong. We analyzed the enhancements of the system changes after the relocation of the ED in October 2010. We also developed a simulation tool for the ED to evaluate the impacts on patient flows with different scenarios. When developing our simulation model, we faced the challenge that the data kept by the ED were incomplete so that the service-time distributions were not directly obtainable. We propose a simulation–optimization approach, which integrates simulation with meta-heuristics (descent method and simulated annealing), to search for a good estimate of the input parameters. Computational results show that our proposed solution methodology is effective in producing good estimates of parameters. With a good estimate of parameters, we did a series of simulation runs to evaluate different possible scenarios. Although we just presented some of the issues examined, the simulation model could be used by the operations manager in the ED to evaluate many other possible changes in the system, such as layout, capacities and resources, which can also throw some light on key issues of decision making for the operations manager.

Finally, it is important to remark that, in general, it is very difficult (or nearly impossible) to build a simulation model for an ED to capture all the activities and events in the system, particularly when key parameters cannot be estimated directly. However, the inclusion of the major activities and events, as captured by our simulation model, was already sufficient to let operations managers in EDs “foresee” the impacts on the daily operations due to possible changes, and consequently enable them to make much better decisions.