Estimating the waiting time of multi-priority emergency patients with downstream blocking

To characterize the coupling effect between patient flow to access the emergency department (ED) and that to access the inpatient unit (IU), we develop a model with two connected queues: one upstream queue for the patient flow to access the ED and one downstream queue for the patient flow to access the IU. Building on this patient flow model, we employ queueing theory to estimate the average waiting time across patients. Using priority specific wait time targets, we further estimate the necessary number of ED and IU resources. Finally, we investigate how an alternative way of accessing ED (Fast Track) impacts the average waiting time of patients as well as the necessary number of ED/IU resources. This model as well as the analysis on patient flow can help the designer or manager of a hospital make decisions on the allocation of ED/IU resources in a hospital.

By observing more than 20 million patient visits to emergency departments over five years, Guttmann et al. in [5] determined that the risk of death and hospital readmission increases with the degree of crowding in the emergency department, and estimated that about 150 fewer patients would die in Ontario each year if the average waiting time to access the emergency department was less than an hour.
The issue of what constitutes timely access to emergency care is obviously dependent on the acuity of the patient. Without an accurate triage and acuity scale, patients who need immediate emergency care will experience a delay in treatment that may aggravate their condition. The Canadian government published its own acuity guidelines in 1998, and subsequently revised them in 2004 and in 2008. In these guidelines, the severity of patients is classified into five levels: resuscitation, emergent, urgent, less urgent and non urgent [6]. This classification is based on a patient's presenting complaints, vital signs (including the hemodynamic stability, hypertension, temperature, level of consciousness, respiratory distress, etc.), pain severity, and injury level. For patients in each severity level, their target waiting time to see a physician is detailed in Table 1.
However, strict adherence to the priority system may mean that a low priority patient may wait a long time to receive a relatively simple procedure that would tie up ED resources for very little time whereas the higher acuity patients have complex needs that require significant resources. As a means of addressing this issue, many hospitals have introduced a fast-track system for the lower (less urgent and non-urgent) priority patients on the premise that they can be served quickly and easily without tying up too many resources. This policy essentially means that a single queue is broken into two and the ones who inevitably suffer from such a policy are the patients at the end of the first queue (priority III patients). Thus, though the impact of Table 1 Triage levels for emergency department [9] Triage level Expected waiting time to see a physician I: Resuscitation Immediate II: Emergent <15 min III: Urgent <30 min IV: Less urgent <60 min V: Non urgent <120 min the fast-track system is to reduce over-crowding by serving low acuity patients quickly, it is our contention that, unless resources are increased, this is accomplished at the cost of increasing the wait times for priority III patients. This contention has been partially confirmed. Cooke et al. in [7] and Miquel et al. in [8] show that the fast track can reduce the waiting time for patients who are qualified to access the fast track but will slightly lengthen the waiting time of the other patients. In this paper, we therefore concentrate on a standard priority system without a fast-track but also provide some results for a system with a fast track.
Even with a good acuity scale in place, insufficient resources can still cause overcrowding. As shown in Fig. 1, the resources available in the ED and in the inpatient unit (IU) will influence patient flow potentially leading to long wait times to access the ED. While the lack of ED resources can block patients in the waiting room, an insufficient number of IU resources may block transfers to the IU further delaying other patients in the waiting room from accessing the ED. Limited budgets however mean that it is inefficient to carry too many resources either in the ED or the IU. Thus, it is imperative that a methodology be developed that correctly estimates the necessary resource capacity in a hospital in order to provide timely access to the ED both to avoid overcrowding and idle time. In this paper, we concentrate on bed capacity in the ED and the IUs. Clearly there are other resources that play a role in determining the service time in the ED such as lab capacity and testing equipment.
The assumption here is that other resources are not the rate limiting step to meeting the targets set out in Table 1.
In this paper, we develop a queueing model to estimate the waiting time of patients to access the ED as well as the necessary amount of resources to achieve the wait time targets for each priority class. This queueing model is composed of two queues: the first one is a M/G/c 1 /∞ with five priorities. In the above notation, the M refers to the assumption that the arrival of demand follows a Poisson distribution, the G means that the service rate can follow a general distribution and the c 1 refers to the number of available resources in the ED. This queue characterizes the patient flow from accessing the ED to departing the ED. The five priorities represent five severity levels classified by Table 1. The second queue is a G/GI /c 2 /c 2 (general arrival distribution, general but independent service times with c 2 servers and c 2 capacity in IU) without priority and no buffer, and it characterizes the patient flow from accessing the IU to discharge.
Additionally, in order to represent the coupling effect that occurs when patients are blocked from entering the IU, we estimate the probability of all servers being busy in the second queue and the probability of patients in the ED waiting for transfer to the IU being blocked. Building on this queueing model, we attempt to estimate the necessary number of ED and IU resources to achieve the performance targets of Canadian Triage And Acuity Scale (CTAS), shown in Table 1.

Related work
Studies relevant to the estimation of the necessary amount of ED resources can be classified into two stages: (1) Rough estimation stage and (2) further adjustment stage. First, the ED manager needs to estimate the average resource requirements over an extended period of time. Studies in this stream usually estimate the number of resources by the steady state of their estimation models providing a  [1] long run average estimation of the resource requirements. This would constitute the first stage. Afterwards, the ED manager may need to adjust the resource assignment to meet the daily fluctuations in demand that are characteristic of ED departments [10][11][12].
From the perspective of methodologies, while the studies of the first type often utilize queueing [2,[10][11][12] and Markov chain models [3] to estimate the necessary amount of ED resources in the steady state, the studies of the second type usually utilize an autoregressive integrated moving average model (ARIMA) [13][14][15], Monte-Carlo simulation [1,17], or Markov decision process (MDP) [16,19,20] to dynamically analyze the necessary amount of resource as a function of time. From the perspective of the length of the planning horizon, the adjustment stage studies can further be classified into short-term estimation and long-term estimation. For short-term estimation (the length of the planning horizon is at most one day) the variation of arrival rate is measured at the hourly level [13][14][15][16]. For long-term estimation (the length of observation ranges from more than one day to a few months), the daily variation or even seasonal variation is factored into the planning decisions [19,20].
Our study is of the first type, namely, estimating the steady state resource requirements in a hospital in order to provide timely access to the ED. To our knowledge no paper has dealt with both the coupling effect between two resources (such as the ED and IU) as well as the presence of multiple priority classes in the demand stream. Patrick et al. in [19,20] present how to estimate the required capacity for a diagnostic imaging department dealing with multiple priority classes but deal with only a single resource. Kolb et al. in [1,17] take into account the coupling effect between the ED and the IU but do not consider the different triage levels of patients. Similarly, Koizumi et al. in [21] present a model that deals with a series of resources with potential blocking but with no acuity scale differentiating patients. For the purposes of estimating resource requirements in the ED to achieve priority-specific performance targets, it is important to propose a model that takes into account both factors. The model proposed in the next sections achieves that goal.

Models of patient flow
In this section, we present the arrival process of emergency patients as well as the model to describe this process. Building on this model, we estimate the average waiting time of an emergency patient accessing the ED.
Patients arrive at the ED either as walk-in patients or ambulatory patients. After entering the main entrance, the patient moves from the greeter desk to triage to registration before waiting for a physician consult. In our model these steps are combined under the heading 'Patients waiting to access the ED' (see Fig. 1). Once a patient accesses the ED, they are assigned a bed by a nurse. After a pre-examination by the ED nurse, the patient will see a physician for further examination, tests and treatments. If the physician determines the patient can be discharged after examination, an ED nurse facilitates the process of releasing the patient who then departs the ED. If the physician decides to transfer the patient to the inpatient units (IUs), a consulting physician from the IU will arrange the admission. Depending on the availability of IU beds, the patient is either transferred immediately or has to wait in the ED till an IU bed becomes available. These steps in our model are combined under the heading 'Patients staying in the ED'. A patient in the IU will receive tests and treatments until he/she is deemed ready for discharge. After a final examination by a physician, the patient will depart the IU. These steps in our model are combined under the heading 'Patients staying in the IU'.
3.1 Arrival process of demand accessing the ED and the IU Demand for ED service fluctuates significantly throughout the day. In consequence, Koizumi et al. in [21] divide the whole day into several segments such that the arrival rate in each segment can be assumed to be constant. They demonstrate that the arrival process of emergency patients in most time segments can be modeled as a Poisson process with varying rates.
As mentioned in the previous section, our model looks to provide the steady state resource requirements over a longer period than a day and thus we do not take into account the within day variations. Given the results from our model, a further model (perhaps using a Markov Decision Process approach) could be used to allocate the available resources in order to take into account the within-day fluctuations in demand.
The data presented in Table 2 was provided by a local hospital and represents the average arrival rate of patients entering the ED per hour (broken down by CTAS) and the

Queueing models to estimate the waiting time
Building on the flowchart of patients accessing and departing the ED (shown in Fig. 1), we use queueing theory to estimate the waiting time of a patient to access the ED with the waiting time of a patient referring to the time between arriving at the waiting room until treatment. To estimate the waiting time, we need to model two patient flows. (1) The patient flow from arriving at the waiting room until departing the ED can be viewed as a M/GI /c 1 /∞ queue to model the patient flow arriving at and departing from waiting rooms or ambulances since the size of the waiting room is rarely the limiting factor. A M/GI /c 1 /∞ queue has a Poisson arrival process, independent and identically distributed service times with a general distribution, c 1 ED beds and infinite buffer capacity. (2) The patient flow into the IU through to discharge can be viewed as a G/GI /c 2 /c 2 queue, which has a general arrival process, independent and identically distributed service times with a general distribution, c 2 IU beds and no buffer capacity.
Model for patient flow in the ED Let λ represent the arrival rate of emergency patients and μ 1 represent the average service rate in the ED without taking into account the coupling effect. Due to the potential for patients being blocked from leaving the ED, we can adjust the average service time in the ED, 1/μ, (represented by a M/G/c 1 /∞ queue) as where T i (i = 1, 2 · · · c 2 ) is the waiting time until ith inpatient is discharged and P b is the blocking probability to access the IUs. The rate of patients transferring to the IU is xR d , where R d = min{λ, c 1 μ} and x is the proportion of patients transferred into the IU. Thus, this modified average service time represents the actual service in the ED plus the time spent waiting in the ED for an IU bed. The time waiting to access the IU equals the average length of waiting until the next inpatient departure, denoted as min To incorporate the priority classification system of emergency patients, we use the theory for a preemptive resume multi-priority M/G/c 1 /∞ queue to calculate the length of waiting time to access the ED. The rationale for using preemptive resume queue models is that high priority (Level I or level II) patients must receive immediate service. If no physician is available when such a patient arrives, a physician treating a lower priority patient (or stabilized higher priority one) must leave his/her current patient and resume only after they offer the emergency treatment to the high priority patient. The detailed calculation on the length of the waiting time is presented in Section 4.
Model for patient flow in the IU The flow of patients accessing and departing the IUs can be modeled as a G/GI /c 2 /c 2 queue [22]. In this queueing model, we focus on the blocking probability P b , that is, the probability that there are no available beds in the IUs. This can be determined by where c 2 is the number of beds available in the IUs, λ d is the arrival rate of patients directly accessing the IUs and μ is the service rate. Other parameters in Eq. 2 can be calculated as: where C 2 a is the squared coefficient of variation (SCV) of the service time at inpatient units and (·) and ϕ(·) are the cumulative distribution function (CDF) and probability density function (PDF) of a standard normal distribution.

Steady state conditions of queuing models
In this paper, we employ queueing models to represent the steady state of a queueing system to access the ED. As shown in Fig. 1, the patient flow for accessing and departing the ED is represented by two coupled queueing models. In the following, we will explore the conditions for both queueing models to reach the steady state.
Given the arrival rate λ, the necessary and sufficient steady state condition for the first queue is λ ≤ c 1 μ, and that for the second queue is xR d + λ d ≤ c 2 μ I . Given the parameters of these two queues, we can decide whether these queues can reach steady state if we know the exact μ, which determines both the service rate in the first queue and the arrival rate of the second queue. Unfortunately μ is interdependent with another unknown parameter P b (shown in Eqs. 1 and 2), and neither of them can be shown in a closed form. Thus, the key to attaining the necessary and sufficient steady state conditions for both queues is to calculate μ. In the following, relaxing the constraints, we first present a sufficient (not necessary) condition as well as a necessary (not sufficient) condition without requiring the exact μ. Second, we develop an iterative algorithm to numerically compute μ from which a necessary and sufficient steady state condition can be approximated. Sufficient (but not necessary) and necessary (but not sufficient) conditions As the blocking probability satisfies 0 ≤ P b ≤ 1, we can obtain constraints on μ as μ min ≤ μ ≤ μ max , where (3) where μ min is the value of μ (refer to Eq. 1) when P b = 1 (the worst case in which an ED patient transferring into IU is always blocked), and μ max is the value of μ when P b = 0 (the best case in which an ED patient transferring into IU is never blocked). Thus, the sufficient steady state condition of the first queue is λ ≤ c 1 μ min , and its necessary steady state condition is λ ≤ c 1 μ max . Correspondingly, the sufficient steady state condition of the second queue is x min{λ, c 1 μ min } + λ d ≤ c 2 μ I , and its necessary steady Necessary and sufficient condition In the following, we will discuss the necessary and sufficient steady state conditon.
First of all, we represent Eq. 1 as where and y 0 = 1/μ 1 . In the following, we show that there is at least one feasible solution to Eq. 5, and this solutionμ ∈ [μ min , μ max ].
If there is only a single solutionμ, then it is easy to show the necessary and sufficient steady state condition as λ ≤ c 1μ for the first queue and x min{λ, c 1μ } + λ d ≤ c 2 μ I for the second queue.If there are multiple solutions, then no necessary and sufficient steady state condition exists. In the latter case, we can at least find a tighter sufficient condition and a tighter necessary condition by replacing μ min and μ max byμ min andμ max , respectively. Please note thatμ min andμ max are the minimal and maximal feasible solutions. The detailed process of searching for the minimal and maximal feasible solutions is shown in Algorithm 1.
Ifμ min andμ max 1 are the same, the sufficient and necessary condition exists and this condition is: λ ≤ c 1μ for the first queue and x min{λ, c 1μ } + λ d ≤ c 2 μ I for the second queue. Otherwise, there is no sufficient and necessary condition, and we can use the tightest sufficient condition: λ ≤ c 1μmin for the first queue and x min{λ, c 1μmin }+λ d ≤ c 2 μ I for the second queue to guarantee the stability of the queue.

Estimation of the waiting time using the queueing models
In this section, we present the estimation of the waiting time in the ED. As shown in Eq. 1, this waiting time is dependent on mean(min i T i ), namely, the average waiting time to be transferred to the IUs. In the following, we first estimate mean(min i T i ) and then estimate the waiting time in the ED.
Also we take into account two cases: patient flow with a fast track and without a fast track. Specifically, we present the estimation of waiting time in the case of no fast track in IV. B., and the case with a fast track in IV. C.

Estimation of the waiting time to be transferred into the IUs
In this section, we discuss how to calculate the average waiting time to access the IUs, namely, mean(min i T i ).
Given F i (z) as the cumulative distribution function (CDF) of T i (i = 1, · · · , c 2 ), which is estimated as a triangular distribution in [17], the CDF of min i T i (denoted as F min (z)) 1 Searching for the closest solution from the starting point can be done by any standard method. We use the Matlab function 'fsolve' to carry out the search, and its default internal algorithm is the trust-region dogleg algorithm [23].
Building on Eq. 6, we can calculate the mean of min i T i as By substituting Eqs. 6 and 7 into Eq. 1, we can attain the expression of the modified average service time 1/μ. Table 2, emergency care patients can be classified into 5 categories. Patients with severity level I and II are provided priority over ambulatory patients waiting for admittance to the ER. The prioritizing frequently includes pre-empting or suspending service for patients fitting the profile of categories IV and V so that appropriate care can be provided in life threatening situations [29]. From the perspective of queuing models, a pre-empting multiple-priority queue is appropriate for this scenario [28][29][30].

As presented in
As presented in III.B.(1), we will use a M/G/c/∞ queue to characterize the patient flow. Few studies provide the exact closed-form expression of waiting time in a M/G/c/∞ queue. The exact waiting time is difficult to calculate because such a queue does not possess an embedded Markov chain [24]. Instead, most studies focus on an approximation of a M/G/c/∞ queue. Hokstad in [25] and Miyazawa in [26] both suggest using a probability generating function (PGF) to generate an approximation of M/G/c/∞ queues. Tijms et al. in [27] propose a regenerative approach to simulate a M/G/c/∞ queue. The aforementioned approximation methods are reliable but all require knowledge of the exact distribution of the service time, which is not applicable in our scenario because the distribution of our modified service time is unknown (shown in Eq. 1).
By using heuristics, Bondi et al. in [31] present the estimation of the waiting time in a preemptive resume multipriority M/G/c 1 /∞ queue. Given the number of priorities K, the mean waiting time of patients with priority k (k = 1, · · · , K), W k c 1 , can be estimated as [31] where W k 1 represents the mean waiting time of patients with priority k in a preemptive resume multi-priority M/G/1/∞ queue, W F 1 represents the waiting time of a FCFS M/G/1/∞ queue and W F c 1 represents the waiting time of a First-come, first-served (FCFS) M/G/c 1 /∞ queue. Here we note that the priority increases with k such that priority k represents the triage level K +1−k, shown in Table 1. In the following, we focus on computing W F 1 , W F c 1 , as well as W k 1 .

Estimation of W F 1 The waiting time in a FCFS M/G/1/∞ queue can be easily computed following [32]
where ρ = λS, λ represents the arrival rate of patients across all priorities, S represents the mean service time for patients across all priorities and S 2 represents the second moment of the service time of patients across all priorities.
Estimation of W F c 1 The waiting time in a FCFS M/G/c 1 /∞ queue has been estimated in [33] as where C 2 represents the SCV of the service time for patients across all priorities, λ represents the arrival rate of patients across all priorities and S represents the mean service time for patients across all priorities. P Q represents the probability given in [33] as where ρ = λS c 1 .
Estimation of W k 1 The waiting time in a preemptive resume multi-priority M/G/1/∞ queue has been well studied. Specifically, given the number of priorities K, for each priority k = 1, · · · , K, the mean waiting time is expressed in [32] as where ρ k = λ k S (k) , λ k represents the arrival rate of patients with priority k, S (k) represents the mean service time for patients with priority k (after taking into account the coupling effects), is the second moment of the service time of kth-priority patients.
Estimating the mean and second moment of service time in the ED Building on Eqs. 10, 11 and 12, the estimation of W F 1 , W F c 1 , and W k 1 are determined by the mean and second moment of service time for patients in each priority as well as the average across various priorities. Building on Eq. 1, we can attain the mean and second moment for kth-priority patients as in Eq. 13 below. and where S (k) represents the emergency service time in the ED, and S 2 (k) represents the second moment of emergency service time in the ED.
The average service time of the first queue across various priorities, μ, equals the average of the mean service time of each priority. Namely, μ = 1 To compute the mean and the second moment of service time for patients in each priority, we develop a numerical algorithm, shown in Algorithm 2. The Algorithm 2 iteratively calculates S (k) , S 2 (k) , P b , and μ until the estimation of S (k) and S 2 (k) in two consecutive iterations has a difference below a threshold. If the output is not 'No solution', then, this output can be viewed as an estimation of the exact mean and second moment of the service time within an acceptable difference. Building on this algorithm as well as Eqs. 10, 11 and 12, we can attain the estimation of the waiting time of patients to access the ED, W k c 1 .

Estimation of waiting time for an ED with a fast track
While the previous sections investigated the case of ED without a fast track, we now turn our attention to the case with a fast track. A fast track is designed for patients with less serious illnesses and injuries to shorten both waiting and treatment times for these patients. More specifically, after evaluation by a triage nurse, patients with less emergent issues (triage level IV and V) are placed in the fast track [34]. In our model, a system with a fast track places paitents at triage level IV and V on an express line, and the other patients will be put on the regular line. Also c 1 beds in ED will be split into two parts: one part for Fast Track (the number of beds is denoted as c I 1 ) and one part for regular line (the number of beds is denoted as c I I 1 ). According to Eqs. (1) and (2), the averge service time (denoted as 1/μ I ) in the Fast Track and the average service time (denoted as 1/μ I I ) in the regular line are shown as Eq. 14.
where P b is shown in Eq. 2. The average service time (denoted as 1/μ F ) across all triage levels is shown in Eq. 15 1/μ F = 1 P I r μ I + P I I r μ I I P I r + P I I r = 1 (15) where P I r is the probability of a patient whose triage level is at level I-III, while P I I r is the probability of a patient whose triage level is at level IV-V.
By substituting Eq. 15 into Eq. 8, we can estimate the average waiting time of Fast Track by setting the number of beds in ED as c I 1 , while estimating the average waiting time in the regular line (acute side) by setting the number of beds in ED as c I I 1 . Definitely, both of these waiting times are dependent on the proportion of patients who are switched over to the fast track, namely, the probability of a patient whose triage level is at level I-III P I r .

Result and discussion
In the following we investigate the necessary capacity of ED and IU in various scenarios to meet the waiting time targets from arrival to first physician assessment in the ED (shown in Table 1). For triage level I, we replace 'immediate' by '<3 min'. The other parameters in our model include the arrival rate λ as the average arrival rate of emergency patients throughout the day (shown in Table 2) and the arrival rate λ as the average arrival rate of patients that directly access the inpatient units throughout the day (shown in Table 2). In addition, the distribution of the service time in the ED is triangular with a lower limit of 0.1 hour, upper limit of 1 hour, and mode of 0.5 hour (see Section 4.1). The distribution of the service time in the IU is triangular with a lower limit of 1 day, upper limit of 7 days, and mode of 4 days. Building on Eq. 8, we can estimate the waiting time to access the ED without a fast track as well as with a fast track, and compare the results in both scenarios in Section 5.4. The other parameters in Eqs. 1-10 can be calculated from the aforementioned parameters.

Relationship between ED and IU resource requirements
Given a set of priority specific wait time targets, the model presented here can be used to estimate the necessary capacity both in the ED and the IU in order to meet the performance targets. Figure 3 shows the impact of changes in the available IU capacity on the necessary ED capacity. In our queueing model, the average of length of stay in the IU is 4 days, the arrival rate to access the ED is 7.572 patients per hour, and we assume here that there is no fast track. Also our analytical results are verified by Monte-Carlo simulations, in which we mimic two individual queues which link with each other and calculate the necessary capacity of ED resources by repeating the simulation 50000 times. Unsurprisingly, the necessary ED capacity increases as the size of the IU decreases. However, the impact of additional IU capacity on ED resource requirements decreases significantly as the IU increases suggesting that there is a threshold size of the IU beyond which additional increases cease to be advisable. However, attempting to reduce the size of the IU below that threshold leads to a steep increase in the required ED capacity in order to meet the same targets and therefore is likely not cost-effective.

Capacity of resources and length of stay in the IU
Clearly, the probability of congestion in the IU leading to backlogs in the ED is dependent on the rate of turnover in the IU which is regulated by the length of stay of patients. Thus, it is of interest to analyze changes in the necessary capacity of the IU/ED resources as the length of stay in the IU is varied. In the queueing model, we first vary the average length of stay in IU through 110-150 hours. Given a number of ED resources, we can determine the necessary IU resources as the length of stay in the IU is varied. Secondly, by varying the number of ED resources through 10-20, we can obtain the 3-dimensional plot which determines how the necessary ED/IU resources change as the length of stay in the IU varies (shown in Fig. 4). In both cases, we fix the arrival rate to the ED at 7.572 patients per hour and assume that there is no fast track.
With the increase in the length of stay in the IU, the capacity of both IU resources and ED resources will, of course, increase. However, the rate of increase in the necessary IU resources as the length of stay is increased is significantly higher than for the ED (shown in Fig. 4). In other words, an increase in the length of stay in the IU causes a larger increase in the necessary IU resources. Thus, in the face of greater uncertainty in the length of stay of patients, it is preferable to carry additional or "excess" IU capacity rather than hoping to manage this problem by using the ED as a holding bay for the IU; a reality that is surprisingly common in practice.

Capacity of resources and arrival rate of ED patients
Obviously, the necessary ED and IU resources to guarantee an acceptable waiting time to see a physician are dependent on the arrival rate to the ED, so it is of interest to investigate the impact on ED and IU resource requirements of increases in this arrival rate. We focus on how much additional ED/IU capacity should be anticipated as necessary given a forecast of increasing demand. In the queueing model, we first fix the number of IU resources at 125 and determine the necessary ED resources as the arrival rate to the ED is varied. Secondly, we fix the number of ED resources at 20 and determine how the necessary IU resources change as the arrival rate to the ED is varied. In both cases, we fix the length of stay in IU at 150 hours and assume that there is no fast track. With the increase in the arrival rate to the ED, the required capacity of ED and IU resources will, of course, increase. However, the rate of increase in the necessary IU resources as the arrival rate is increased is significantly higher than for the ED (shown in Fig. 5). In other words, an increase in the arrival rate to the ED causes a larger increase in the necessary IU resources. Thus, again in the face of greater uncertainty in the arrival rate of ED patients, it is preferable to carry additional or "excess" IU capacity rather than hoping to manage this problem by using the ED as a holding bay for the IU.

Average waiting time to access the ED with and without a fast track
The aforementioned discussion assumes that a hospital does not implement a fast track for patients at triage level IV and V. In the following, we focus on the influence of a fast track on the average waiting time to access the ED. In this scenario, the average length of stay in the IU is 4 days, and the number of IU resources is 125. In the scenario with a fast track, we allocated 20 % of ED capacity to the fast track.
As shown in Fig. 6, a fast track reduces the average waiting time across all patients to access the ED by approximately 0.3-1 hour. The explanation is as follows. The fast track provides for the prompt treatment of patients with nonlife-threatening injuries. In a non-fast track system, these patients are forced to queue behind patients whose complexity requires long service times. The fast track provides short wait times for a cohort of patients who otherwise would have the longest wait, thus reducing the average wait time.
However, the reduction in the average waiting time across all patients comes at the cost of increasing the waiting time of patients who do not qualify for the fast track. As shown in

Limitations of our patient flow model
The patient flow model in our paper has the following limitations: firstly, we assume that the inpatient unit can accommodate all types of patients, but in reality, a few specialized units can only accommodate a specific type of patient. For example, an injured patient cannot stay in a cardiovascular disease unit. Secondly, in our model, we assume that one resource can only be offered to one patient, so c patients will consume c resources in the ED. However, in real scenarios, EDs with c beds can accommodate more than c patients by using hall beds and internal waiting rooms [35]. Thirdly, our model employs steady-state and average arrival rates, which do not take into account that the arrival rate is non-stationary. Finally, our model does not

Conclusions
In this paper, we develop a two-stream model to characterize the coupling effect between patient flow to access the ED and that to access the IU. Building on this patient flow model, we employ queueing theory methods to estimate the average waiting time across patients as well as the necessary ED and IU resources in order to meet target waiting times for patients at each triage level. In addition, we investigate the influence of a fast track stream on the average waiting time of patients. Our model improves on previous research by taking into account both the reality of multiple priority classes competing for ED resources and the strong potential for downstream congestion impacting on the timely access of patients to the ED.
In addition to providing hospital management with a means of determining the necessary capacity in the ED and the IU in order to meet priority specific wait time targets for timely access to the ED, this paper also provides the following insights. (1) There is a threshold size for the IU such that reductions in the IU below that threshold lead to steep increases in the necessary ED capacity in order to meet the same targets. Thus, there exists a "optimal" IU capacity such that either increasing or decreasing IU resources will lead to higher costs associated with the same performance. (2) Uncertainty in the LOS in the IU or in the arrival rate to the ED is best accommodated by carrying extra IU capacity rather than by increasing the size of the ED. (3) While a fast track can reduce the average waiting time across patients from all the triage levels, it is accomplished by a large reduction in the wait times of patients from triage levels IV and V that offset a concurrent increase in the wait times of patients from triage level III. In other words, a fast track actually worsens the ability of an ED to provide timely access to patients whose conditions could potentially progress to a more serious problem requiring emergency intervention, such as asthma, vaginal bleeding, moderate trauma, Gastrointestinal (GI) bleeding, and acute pain. These three insights are partially verified by relevant research literature [7,8,36]. Erik et al. in [36] explain that increasing IU resources instead of ED resources with the aid of "IU buffers" can solve the problem of overcrowding and shows the "best buffering capacity" in IU, but this paper does not take into account the triage levels of patients. Also Cooke et al. in [7] and Miquel et al. in [8] show that the fast track can reduce the waiting time for patients who are qualified to access ED but will slightly lengthen the waiting time of the other patients. However, these two papers do not consider the coupling effects between the ED and IU.
We would like to extend our results by varying the proportion of ED resources allocated to the fast track, and develop a general rule to determine the optimal allocation depending on the proportion of demand that is eligible for the fast track and the relative resource consumption of the two groups. We would like to explore whether there exists an optimal proportion of ED resources to allocate to the fast track in order to minimize the demand of IU resources and satisfy all CTAS time requirements.