1 Introduction

Unscheduled jobs that need prompt services often complicate a scheduling problem. This is a common problem in several industries. For example, the unscheduled repairs of airplanes, automobiles and locomotives; or unscheduled visit of patients/customers; or breaking news for broadcasting industry. These urgent service requests may disturb the existing schedules and therefore cause delays in services. A resilient scheduling system is supposed to take these future urgent requirements into consideration and reduce the cost caused by the delay. The delays of services come from not only the unscheduled tasks but also the uncertainties in the scheduled tasks. Examples of the uncertainties in the scheduled services include but not limited to underestimated or overestimated service time for each task, unexpected cancellations, unplanned tardiness and so on. Given the odd features of scheduling, stochastic programming, which handles optimization with randomness, becomes a leverage in providing a sufficient solution for the complex problem. In this paper, we address the application of stochastic programming in healthcare services. In the pandemic of COVID-19, the increase in urgent requests for the primary care clinics ask for a more resilient scheduling decision supporting system. Our work can provide some insight in preparing for and handling urgent uncertainties in healthcare services and can also be applied to similar scheduling problems in other fields.

In outpatient appointment scheduling, the open-access policy which accepts the same-day patient visit requests is widely practiced by clinics. Contrary to the traditional far-in-advance policy which usually has a long gap between the request date and the visit date, the open-access policy provides patients more convenience when they need expeditious healthcare service. The comparison between open-access policy and traditional far-in-advance policy has been discussed by [1,2,3] and is extensively studied by [4, 5]. Open-access policy shows its strength in improving patient access and satisfaction, as well as reducing patients’ no-show rate and in-direct waiting time [2]. This paper discusses a hybrid policy under which a clinic deals with three types of patients. The first type of patients are those who request their appointments before the visit day. The second type of patients schedule their appointment on the visit day. The third type of patients are walk-in patients who go to the clinic without appointments and wait to see the doctor. In the three types of patients, Type 1 patients are scheduled under the traditional far-in-advance scheduling policy. Type 2 and 3 patients are the same-day request patients under open-access policy. Both far-in-advance and same-day requests can be scheduled in a block-based framework designed in this paper, and we focus on handing the assignment of the same-day requests. Among the large number of research studies regarding outpatient clinic scheduling, open-access policy is fairly mentioned but rarely studied intensively under the three-type-patient framework. In most papers addressing open-access policy, either Type 2 requests [4] or Type 3 requests [6] are treated as the only type of the same-day requests. However, the same-day phone-call requests and the walk-in patients have the following differences. First, Type 2 patients might have positive no-show probabilities, but Type 3 patients will have zero no-show probabilities. Second, the First-Come-First-Serve(FCFS) rule is a hard constraint for Type 3 patients but not for Type 2 patients. The differences of Type 2 and Type 3 patients bring more uncertainties to the scheduling problem and make it more difficult. Addressing three types of patients together makes this paper closer to the real scheduling in the open-access clinics and increases the practical value of this this paper.

We assume that the same-day requests are scheduled over a block-based one-day period. This scheduling method divides a clinic day into several time intervals with equal or unequal lengths where each interval is a block [6, 7]. At the beginning of the day, the clinic already knows the assignment of Type 1 patients in all the blocks. At the beginning of each block, the clinic knows the assignments of same-day requests received in all previous blocks, and how many patients have overflowed from the immediate previous block to the current block. The clinic does not know how many same-day requests will arrive at the current block, or how many assigned patients will make the appointments, or how many patients can be handled in the current block. This incomplete information for the clinic is not deterministic but tractable through prediction or distribution data, and hence, we will handle it in the Stochastic Integer Programming (SIP) model. In our model, the number of Type 1 patients arrive at the clinic and the number of patients complete the service per block are set as random variables. The decision variables are defined to assign the same-day requests received in the current block to the remaining blocks. In order to solve the SIP model, we derive a transformation from SIP to integer programming. To overcome the difficulty of a large-scale sample space, a bound-based sampling method is developed. Distinguished from the traditional one-at-a-time assignment in other clinic scheduling papers, this paper establishes an aggregate assignment method with the SIP model. Besides the above features, this paper also considers patients preferences and first-come-first-serve (FCFS) rule. Practice managers often confront the dilemma of determining the number of traditional far-in-advance patients and the number of patients that they expect to see as same-day appointment requests. Good patient appointment management will help the practice managers find better balance between the two type of appointments. In this paper we not only provide a method for scheduling the same-day requests, but also inspect the impact from number of pre-scheduled type 1 patients on the assignment of the same-day requests through sensitivity analysis.

In the rest of this section, we summarize the contributions of this paper from modeling and methodology perspectives. First, it is novel to introduce stochastic integer programming into the decision of patient number and sequence in blocks. Appointment scheduling research works can be classified into two categories: a) to decide service time per patient, and b) to decide number of patients per block. Most papers adopting stochastic programming (SP) in clinic scheduling fall into the first category [8, 9]. The second category can be found in papers using Markov Chain methods or other dynamic methods based on stochastic model [2, 10, 11]. For category a) problem, the total number of patients assigned to see physicians are set as known parameters which in category b) problem is set as a decision variable. Therefore decision in category b) is a prerequisite of the decision in a). Patients’ sequence can be decided in both a) and b); however, most papers in category a) decide time allowance with predefined patient/job sequence. In this paper, we decide number of same-day request patients assigned to each block. The block order and the FCFS rule together also decide the sequence of the patient. This paper targets at deciding the number of patients per block and the patients’ sequence which makes it special in category b). It also distinguishes itself from the preceding papers in category b) by using SP model which is more common in category a). We define the “block throughput” as the number of patients that complete their appointments in a block. The block throughput is a concept directly related to patients’ service time and is also the cornerstone for overbook in order to offset patients’ no-shows. Since the block throughput directly reflects physicians’ initiative in changing their work speed according to their workload and schedule, so compared with service time per patient type, block throughput is more flexible to describe the work efficiency of physicians. Therefore, in comparison with papers using SP, we adopt a new perspective of scheduling. In comparison with papers addressing optimal assignment number, we adopt a new method.

Second, the way we tackle uncertainties in this paper is special. Under the open-access policy, a clinic has incomplete information about the following questions: 1) how many same-day requests will arrive at the current block. 2) How many assigned patients will make the appointments. 3) How many patients can be handled in the current block. For uncertainty in 1), most clinics and research work ignore it since they adopt one-at-a-time assignment, in which the assignment decision is made for each request sequentially and independently. The model we developed can be used for one-at-time assignment, however, we propose an aggregated assignment policy to replace the traditional one-at-a-time assignment policy. We suggest to make the assignment decision at the beginning of a block based on estimation of uncertain information in 1). This policy aggregates the requests spreading out over a block and achieve the best allocation plan to this group of requests. For uncertainties in 2) and 3), we treat them as random variables and exploit statistical inference to obtain distribution information before solving the decision model.

Last, we highlight the contributions of this paper by showing its comprehensiveness in including various environment factors in the model. According to review work of [12], so far no existing scheduling model, no matter online [7,8,9, 13,14,15] or offline [16, 17] methods, considers more than three of the following factors: patient punctuality, patients’ no-show, patient cancellation, random service time (in our case random block throughput), as well as patient preferences over physicians and blocks. The model we provide can handle all of them together. These factors ensure the model a high approximation level to reality.

The rest of the paper is arranged as following: Section 2 is about the comprehensive literature summary about clinic scheduling problem. Section 3 establishes a model framework under which SIP with single physician, SIP with multiple physicians, and robust optimization (RO) models are formulated. Section 4 proposes the solution method for SIP model where a bound-based sampling method is elaborated through which the SIP model and the RO model are compared in special numerical experiments. Section 5 illustrates the aggregate assignment method which is robust in tolerating inaccurate estimation of the same-day requests for the SIP model. Section 6 analyzes the importance of the same-day requests estimation and other model input parameters.

2 Literature Review

The clinic appointment scheduling is a popular topic in OR/IE studies. Since the pioneering study on clinic appointment policy in the 1950’s by [18] and [19], ample theories, methodologies and technology have been introduced for the clinic scheduling problem. The paper by [20] provides a comprehensive review on literature about clinic scheduling before 2003. The study by [21] offers a more recent update on this topic up to 2008. The most recent review study is addressed by [12] who classify the operations research in outpatient appointment scheduling into strategic, tactical and operational levels. In the following three paragraphs, we compare and contrast our work with several similar-topic/similar-method papers in detail.

As for the methods exploited for clinic scheduling, we can find analytic studies based on queuing theory [22, 23], and on top of queuing theory, the Markov-chain model [2, 24,25,26], simulation modeling [27, 28], dynamic programming [29, 30], approximation/heuristic algorithms [31,32,33,34,35], robust optimization [36,37,38], and stochastic programming (SP) as adopt in this paper [8, 9, 15, 39, 40]. Specially, it is popular to combine two or more methods mentioned above together as stochastic analytic method [2, 7, 10, 11, 13, 14, 41]. In this paper, we proposed a framework where the stochastic integer programming is the base which contains the robust optimization as a special case. Its variants can handle ample stochastic factors such as no-shows, early/later arrival, cancellation, preferences over physicians, and so on.

An important classification of scheduling is the online/offline scheduling. Online scheduling is addressed in this paper. For research focusing on appointment assignment optimization, if the decision for all patients is made before the clinic day then the scheduling is considered static or offline [16, 17]. The offline scheduling is associated with decisions made with full information about number of patients to be scheduled and their service time. In contrast, if the decision is made one by one or ahead of each block, then the scheduling is considered dynamic or online [7,8,9, 13,14,15]. This paper deals with online scheduling which has the advantage to handle the scheduling facing unknown future.

From the view of objectives of scheduling, research papers aim at reducing cost, increasing revenue or the combination of the two. The cost consists of patients’ waiting time, doctors’ idle time, overtime, and so on [20]. The revenue is usually calculated by number of patients served or scheduled [2, 42]. The combination of revenue and cost can be either cost-savings as the difference between revenue and cost [7, 13, 15], or average cost which is cost per served patient [14]. In this paper, we adopt the cost-saving objective function which considers possible revenue of appointments, the waiting-time costs and the idle-time costs associated with patient shortage as well as the overtime cost for the number of overflowed patients. This comprehensive objective function makes the model to draw a balance between “earning more revenue” and “respecting patients’ and “physicians’ feeling”.

For the patient arrival mode, literature for the optimal scheduling can be classified as non no-show arrival [40], arrival with no-show [9, 15], and arrival with no-show and cancellations [2]. This work takes no-show rates as an essential factor influencing the clinic scheduling decision, and also discusses the cancellation and lateness of patients. As for the patient choice scope, in the literature, there are patients’ preferences over blocks in a day [42,43,44], or over days [10]. This paper deals with the same-day requests, so patients’ choices are circumscribed in the current day. For the patients’ preferences over doctors, most papers we discussed here are dealing with one single physician except for [27, 33, 45] where simulation and multi-server queuing model are used. The scheduling model we proposed is very flexible be extended from single physician to multiple physicians, multiple departments or even multiple clinics as illustrated in Sect. 3.3.

For the papers which discuss open-access policy and the same-day requests in clinics, [29] discuss the same-day requests scheduling through dynamic programming method. They take the preference of patients on physicians into consideration and address the balance problem between pre-scheduled appointments and same-day requests. Nevertheless, the uncertainties of patients attendance, physician work efficiency, no-shows as well as services time are not considered in their model. They also ignore the differences between walk-ins and same-day phone call requests. [14] assume three types of patients which we adopt in this paper. They work out comprehensive stochastic formulations to depict the assignment constraints like FCFS rules, no-shows, cancellations, overtime, idle time, starting time, and waiting time. However, the subtle considerations and some nonlinear and stochastic constraints make it far from a solvable stochastic programming model. They use discrete-event simulation to determine some parameters which we suppose in our model as random variable. Genetic algorithm is used in their paper to pursue local optimal allocations for Type 2 and Type 3 patients with block capacity up to 2, and best arrangement for Type 1 patients. Their block capacity is a similar notion as block throughput in our paper, but they set it as a constant parameter. The framework we proposed in this paper can handle as many uncertain factors as in [14]. Our advantage is that, under this framework, it is possible to have exact solutions using Bender’s decomposition which we will address in another paper.

For the papers which help to decide optimal patient numbers, stochastic analytic method are widely used. [7] as well as [13] work out a sequential assignment method for multiple type of patients to clinic time blocks. For each arrived request, their algorithm assigns it to one of the blocks by trying each block one by one from the current block to the final block to find the one with the lowest average cost. The cost is calculated based on the distributions of number of arriving patients at the beginning of a block and the number of overflows among blocks which have been formulated. [15] present a very similar work to [13] with improvement in applying the method to multiple resources and calculation overflows using convolution estimation method and joint cumulative estimation method. The differences between our paper and those above are quite perceptible. First of all, they assign only one patient at a time, as the one-at-a-time mode. We propose an aggregate assignment which dominates the one-at-a-time method in robustness and tolerance on input inaccuracy. Second, their assignment method is exhaustive and based on the first order statistic, i.e., the expected value of random variables. We introduce a two-stage SIP model to handle the multiple assignment with uncertainty, which reveals more impacts of random variables on the assignment decision and is more closer to the reality.

For the SP models, [8] propose a two-stage SP model based sequential bounding approach to obtain the optimal appointment scheduling for a single server system. Their model is built on the basis of earlier research by [26] and [17]. To facilitate solving the model fast and effectively, they developed aggregation bounds for the recourse function and bounds for dual multipliers in a block. [40] also use a similar model as [17], but rather than solving it as a two-stage model, they take the approximation model as a linear model and then solve it with conjugate gradient search. [9] extend this approach in [8] to clinic appointment. They develop a multi-stage stochastic model on the basis of a two-stage model and utilize nested decomposition algorithm and customized cuts to achieve optimal solution. The SP model proposed by [39] decides both time allowance and sequence of the patients. They use L-shaped methods and progressive hedging to solve the SP model. All these SP models above have continuous decision variables, where the model we have is stochastic integer programming (SIP) which increases the computational complexity significantly. As mentioned before, we use SIP to optimize number of assigned patients which traditionally is decided by queuing theory-based methods. This is a novel application of SIP on scheduling.

Robust optimization and SP are the common tools to achieve the best decision of time allowance and sequence for predefined set of patients given their random service time. A typical difference between robust optimization and stochastic optimization is that the latter one allows various distributions of the random variables which in former one very limited [36,37,38]. However, our paper leverages SP to provide the answer to how many of the randomly arrived walk-ins and phone-call requests can be assigned in the remaining blocks. We also propose a robust optimization model for the same problem and compare the performance of the two models through a few numeric examples.

The uncertainty in data and integer decisions increase the complexity of calculation for SP model. The solution method for SP model includes the exact L-shaped method [39], sample average approximation (SAA) [46, 47] and heuristics [40]. This paper uses the sample average approximation method. The large sample space of the random variable in a SP prevents people to exhaust every possible scenario in the distribution, instead, the sampling method is widely used to shrink the number of scenarios during the calculation [48]. According to [47], there are two types of sampling methods: the exterior sampling method and the interior sampling method. The exterior sampling method deals with the deterministic approximation model of the problem generated after the sampling. For the question how to decide the sample size N for exterior sampling method, [49] discuss in detail the convergence and lower bound for the sample size N. [50] also present the formula of lower bound of it. Based on [47], the SAA which approximates the expectation function by a sample average function is an example of using exterior sampling method. The interior sampling method distinguishes from the exterior sampling method from when to do the sampling. The exterior sampling method generates samples before solving the problem, while in interior sampling method, the samples are drawn during the course of solving the SP problem [51,52,53]. For the interior sampling methods, [53] suggest that one can increase the number of scenarios by one at each iteration. For the nth step, there will be n samples drawn. When n gets large enough, one can obtain the average value of solutions as an approximation of optimal solution. [51, 52] develop a stochastic decomposition method which generates only one new sample at each iteration. Interior sampling method is flexible to be applied together with decomposition method to solve SP with more complicated features such as integer recourse [50] or nonlinear constraints [46] or multistage decisions [54]. In this paper, we develop a new interior sampling method for SIP based on bounds of objective values. Features that distinguishes our method from the existing interior methods include: 1) the simple structure of the model decides that our method is more about reducing the sample size than serving a partial rule in solving the model. For example, the interior sampling method from [46] is combined with policies dealing with nonlinear constraints. The interior sampling method from [50] is embedded in decomposition. Therefore, our method can be used as a prototype for sampling and applied with other algorithms in these complicated models. 2) Compared with other pure interior sampling methods in solving SIP, our method shows its strength in reducing the sample size which will be addressed later.

Conclusively, this paper demonstrates its strength and creativity in both the modeling and solution method parts. For the modeling part, it deals with dynamic scheduling for the same-day-request patients with no-shows and various restrictions, the comprehensiveness of the model is not found in previous literature. Especially, the aggregate assignment is novel among the online scheduling methods. For the solution method part, the bound-based sampling method designed here makes the two-stage SIP model produce reasonable solutions easily and fast.

3 Problem Statement and Formulation

3.1 Assumptions

For the block-wise scheduling, the analysis and decisions are carried out within each block. The benefit of the block-wise scheduling is that the decision maker can aggregate information and resources of one block and make decisions accordingly. The block containing the current clock time is referred as the “current block”. The blocks lying earlier than the current block on the time line are the “previous blocks”. The current block and the following blocks are the “remaining blocks”. For the convenience of calculation and demonstration, we assume that the length of blocks are equal. However, our analysis and method can also be applied to the case of unequal length blocks. This paper approximates reality from both event sequence and availability of information. We assume that the event sequence in one block is: Step 0: At the beginning of the day, the clinic observes the number of Type 1 patients assigned for each block. Step 1: At the beginning of the current block, the clinic observes the number of Type 2 and Type 3 patients assigned today before the current block. Step 2: The clinic estimates Type 2 and Type 3 requests received at this block. Step 3: The clinic makes an assignment plan for the estimated Type 2 and Type 3 requests. Step 4: The clinic starts to receive Type 2 and Type 3 requests and assign them one by one following the decision in Step 3. Step 5: The clinic starts to observe the arrivals of Type 1 and Type 2 patients in the current block. Step 6: The service for patients in the current block starts until the end of the current block. Then the successive block starts a new process from Step 1.

Based on this event sequence, we build the two-stage SIP model for Step 3 above. The first stage of SIP model tackles assignment decision with deterministic data obtained in Step 1 and Step 2 above. The second stage estimates the consequence of the assignment decision under random scenarios and gives feedback in the follow way: If the number of patients that can be served in a block exceeds the number of patients that assigned to a block, then an idle-time cost associated with patient shortage is produced; if the number of assigned patients exceeds the number of patients that can be served in a block, then an overflow cost associated with patient waiting time is generated. The actual overflows will be added to the number of patients to be served in the immediate successive block in Step 1 above. More assumptions of this model are: (1) The clinic can reject requests of Type 2 and Type 3 patients. (2) There is a delay between arrival time of Type 2 patient requests and their scheduled block. (3) There is a waiting length tolerance for Type 3 patients. (4) Type 1 patients have no-show rates, all Type 2 patients will make the visits. (5) Assignment of Type 3 patients follows a FCFS rule. (6) We know the probability distribution of uncertain data (discrete, i.i.d.). (7) Waiting time cost is generated when patients overflow from original block into the successive block. (8) All patients who make the visits will come on time. (9) All blocks have equal length. Assumption (4) and (8) make the uncertainties in the second-stage model exogenous which means they are independent of the decision variables in the first-stage model. If we assume that Type 2 patients have some no-show rates or earliness/lateness possibilities, then we have endogenous uncertainties which depend on the decision variables in the first-stage model. Solution methods for the SIP models with exogenous uncertainties are different from those for the models with endogenous uncertainties. For SIP with exogenous uncertainties in this paper, we adopt sample average approximation (SAA) method associated with the deterministic equivalent problem (DEP) which are not applicable for SIP with endogenous uncertainties. For SIP with endogenous uncertainties, we applied decomposition methods in another paper. Assumption (2), (3) and (5) show the major differences of Type 2 and Type 3 patients in this paper. To be more specific, for Type 2 patients, the assignment model shall consider the time gap between request time and service start time to give them enough time to travel to the clinic. For Type 3 patients, the assignment model should not let them wait too long before service starts. We will address these two aspects in the assignment restriction constraints. The FCFS rule of assignment is only for Type 3 patients which guarantees that the walk-in patients who arrive earlier will get service earlier. For Type 2 patients, it is possible that patients call earlier get service later than patients call later.

3.2 Two-stage Integer Stochastic Programming Model for One Block with One Physician

3.2.1 Notation

This model will use indices and parameters listed in Tables 1, 2, 3, 4, and 5.

Table 1 Sets and Indices
Table 2 Parameters
Table 3 First-Stage Decision Variables
Table 4 Second-Stage Random Variables
Table 5 Second-Stage Decision Variables

3.2.2 Formulations

Suppose the current block is the ith block of the clinic day. The SIP-i model below is the two-stage SIP decision model for block i. All the decision variables associated with the remaining blocks are indexed from 1 to h, and their original indices are from i to \(i+h\). Function and constraints (1) to (9) belong to the first stage. Constraints (11) to (13) go with the second-stage model.

$$\begin{aligned} (\text {SIP-i}) \quad&\min \quad -c_2 \sum \nolimits_{j \in J}\sum \nolimits_{k \in K} x_{jk} - c_3\sum \nolimits_{j \in J} \sum \nolimits_{t \in T} y_{jt} + \mathbb {E}\left[Q\left(X, Y, \mathbf {a}, \mathbf {b}, \omega \right)\right] \end{aligned}$$
(1)
$$\begin{aligned} \text {s.t.}\quad&\sum \nolimits_{j \in J} x_{jk} \le 1, \; \forall k \in K \end{aligned}$$
(2)
$$\begin{aligned}&\sum \nolimits_{j \in J} y_{jt} \le 1, \; \forall t \in T \end{aligned}$$
(3)
$$\begin{aligned}&x_{jk} \le A_{jk}, \quad j \in J, \; k \in K \end{aligned}$$
(4)
$$\begin{aligned}&y_{jt} \le B_{jt}z_t, \quad j \in J, t \in T \end{aligned}$$
(5)
$$\begin{aligned}&a_j = \bar{a}_{j} + \sum \nolimits_{k \in K} x_{jk}, \quad j \in J \end{aligned}$$
(6)
$$\begin{aligned}&b_j = \bar{b}_{j} + \sum \nolimits_{t \in T} y_{jt}, \quad j \in J \end{aligned}$$
(7)
$$\begin{aligned}&\sum \nolimits_{t \in T} (i+j) y_{jt} \ge \beta ^{i-1}\sum \nolimits_{t \in T} z_t ,\quad j \in J, \quad t \in T \end{aligned}$$
(8)
$$\begin{aligned}&x_{jk}, y_{jt} \in \{0,1\}, \quad a_j, b_j \in \mathbb {Z}^+, \quad j \in J, \quad k \in K, \quad t \in T \end{aligned}$$
(9)

where

$$\begin{aligned} Q(X, Y, \mathbf {a}, \mathbf {b}, \omega ) \quad = \quad&\min \quad c_f \sum \nolimits_{j \in J} q_j + c_s \sum \nolimits_{j \in J} g_j \end{aligned}$$
(10)
$$\begin{aligned} \text {s.t.} \quad&q_{j +1} -q_{j} - g_{j} = \eta (\omega )_j +a_j + b_j, \quad j \in J \end{aligned}$$
(11)
$$\begin{aligned}&q_1 = \acute{q} \end{aligned}$$
(12)
$$\begin{aligned}&q_j, g_j \in \mathbb {Z}^+, \quad j \in J \end{aligned}$$
(13)

The objective function in (1) is designed to minimize unassigned same-day requests received in the current block and minimize the overflow and patient shortage costs of the remaining blocks. The full formulation of the objective function is \(c_2 (|K|-\sum _{j \in J}\sum _{k \in K} x_{jk}) + c_3(|T|-\sum _{j \in J} \sum _{t \in T} y_{jt}) + \mathbb {E}[Q(X, Y, \mathbf {a}, \mathbf {b}, \omega )]\), where the first term is the cost of unassigned Type 2 patients, the second term is the cost of unassigned Type 3 costs, and the third term is the expectation of the second-stage objective function value. Since \(c_2|K|\) and \(c_3|T|\) are constant, we derived the simplified objective function in (1).

Constraints (2), (3) are about the decisions of accepting or rejecting patient requests. Constraints (4), (5) are about patient assignment restrictions. Preference matrix A subjects to both the preference and restriction for Type 2 patients. The restriction part can be defined using a series of arrival delay factor \(\mathbf {\rho } = \{\rho _k\}\) associated with kth patient as shown in (14). The delay factor indicates the time length in terms of number of blocks the patient between the request time and their arrival time. So any block beyond the arrival delay \(i+\rho _k\) can be chosen to serve the patient. In a similar way, matrix B consists of binary entries based on preference and waiting tolerance of Type 3 patients. Each entry of B is associated with the tolerance factor \(\delta _t\) which shows the max number of blocks the tth Type 3 patient can wait in the clinic.

$$\begin{aligned} A_{jk} = {\left\{ \begin{array}{ll} 1 \quad &{} \text {if } j+i \in [ \min \{i + \rho _k, m\} , m] \quad \& \\ &{} \text {patient } k \text { is willing to make the appointment in block } j+i \\ 0 \quad &{} \text {otherwise} \end{array}\right. } \end{aligned}$$
(14)
$$\begin{aligned} B_{jt} = {\left\{ \begin{array}{ll} 1 \quad &{} \text {if } j+i \in \left[\ j+i, \min \{ i + \delta _t, m \}\right] \quad \& \\ &{} \text {patient } t \text { is willing to make the appointment in block } j+i \\ 0 \quad &{} \text {otherwise} \end{array}\right. } \end{aligned}$$
(15)

Constraints (6), (7) are designed to store the accumulated number of patients assigned to each of the remaining blocks by the end of current block. Variables \(\mathbf {a}, \mathbf {b}\) appear in both first-stage model and second-stage model. Constraint (8) is about the FCFS rule for Type 3 patients. We do not apply this rule to Type 2 patients because of their delay restrictions. The element \((i+j)y_{jt}\) on the left-hand side gives the index of block where the tth Type 3 patient is assigned to, \(\beta ^{i-1}\) is the largest index of assigned block for Type 3 patients who arrived in the previous block. This constraint guarantees that if the tth Type 3 patient’s request is accepted, then the block assigned to this patient cannot be earlier than the last assigned block for Type 3 patients who came earlier than the current block. This constraint goes with the assumption that Type 3 patients arrived in the same block do not obey the FCFS rule.

Second-stage objective function (10) is established to evaluate the cost of overflows and patient shortage for the remaining blocks as the consequence of assigning decision in the first-stage. Constraint (11) is derived from input/output balance of each remaining blocks as a consequence of decisions made by the end of the current block. For block j, the input number of patients includes \(\nu _j\), \(q_j\), \(a_j\), \(b_j\), the number of patients that can be served (output) in it is \(\tau _j\). Especially, for the first block, \(\acute{q}= 0\). If the input number is larger than the served number, then a positive number of patients \(q_{j+1}\) will overflow to the next block, which means:

$$\begin{aligned} q_{j+1} = \max \{\nu _j + q_j + a_j + b_j - \tau _j, 0\} \end{aligned}$$
(16)

If the input number is smaller than the served number, then it generates a positive patient shortage \(g_j\) which means:

$$\begin{aligned} g_j = \max \{ \tau _j - \nu _j - q_j - a_j - b_j, 0 \} \end{aligned}$$
(17)

Given the definition of \(\eta _j\), i.e.,

$$\begin{aligned} \eta _j := \nu _j - \tau _j \end{aligned}$$
(18)

These equations lead to constraint (11). From the second-stage model, we can see that the SIP-i model has relatively complete recourse since for any \(\mathbf {\eta } (\omega ) + \mathbf {a} + \mathbf {b} \in \mathbb {Z}^{|J|}\), we can always find \(\mathbf {q}, \mathbf {g}\) such that (11) to (13) are satisfied. The relatively complete recourse feature is import for sample average approximation (SAA). In reality, distributions of the random variables of \(\nu _j\) and \(\tau _j\) can be detected by statistics inference methods from the historic data of the clinic. In this paper, we make assumptions for the distributions based on literature and historic data from a small clinic that is affiliated to our institution’s health science center as elaborated in Sect. 4. SIP-i as a framework can be extended to consider patients’ no-shows, cancellations and punctuality as described in Appendix.

3.3 Two-Stage Integer Stochastic Programming Model for Multiple Physicians

Here we extend the SIP-i model for a clinic with multiple physicians. In addition to Table 1, we define set P as the set of physicians and p as the index of physicians in set P. Some of the parameters in Table 2 and decision variables in Table 3 get one additional dimension as shown in Table 6. Under the multiple physician scenario, the patients may have preference over different physicians. If patient k prefers not to see physician p, we have \(A_{jkp} = 0 \; \forall j\). By introducing more physicians into the system, we expect less overflows among blocks since physicians work parallel and therefore block throughput is increased. If we take patient category or different clinics into consideration, we can have one dimensions on top of the model we proposed here.

Table 6 Additional Parameters And Decision Variables

The SIP-i-multi is established based on SIP-i in order to accommodate the physician settings. In this model, we assume that different physicians have different service productivity, but the cost of overflows or idle time are the same for all the physicians. However, SIP-i-multi still has the same structure as SIP-i, and therefore, in the rest of this paper, we focus on SIP-i for solution method, experiments, and sensitivity analysis.

$$\begin{aligned} (\text {SIP-i-multi}) \quad&\min \quad -c_2 \sum \nolimits_{j \in J}\sum \nolimits\nolimits_{k \in K} \sum \nolimits_{p \in P}x_{jkp} - c_3\sum \nolimits_{j \in J} \sum \nolimits_{t \in T} \sum \nolimits_{p \in P}y_{jtp} + \mathbb {E}[Q(X, Y, \mathbf {a}, \mathbf {b}, \omega )] \end{aligned}$$
(19)
$$\begin{aligned} \text {s.t.}\quad&\sum \nolimits_{j \in J}\sum \nolimits_{p \in P} x_{jkp} \le 1, \; \forall k \in K \end{aligned}$$
(20)
$$\begin{aligned}&\sum \nolimits_{j \in J}\sum \nolimits_{p \in P} y_{jtp} \le 1, \; \forall t \in T \end{aligned}$$
(21)
$$\begin{aligned}&x_{jkp} \le A_{jkp}, \quad j \in J, \; k \in K, p \in P \end{aligned}$$
(22)
$$\begin{aligned}&y_{jtp} \le B_{jtp}z_t, \quad j \in J, t \in T, p \in P \end{aligned}$$
(23)
$$\begin{aligned}&a_{jp} = \bar{a}_{jp} + \sum \nolimits_{k \in K} x_{jkp}, \quad j \in J, p \in P \end{aligned}$$
(24)
$$\begin{aligned}&b_{jp} = \bar{b}_{jp} + \sum \nolimits_{t \in T} y_{jtp}, \quad j \in J, p \in P \end{aligned}$$
(25)
$$\begin{aligned}&\sum \nolimits_{t \in T} \sum \nolimits_{p \in P}(i+j) y_{jtp} \ge \beta ^{i-1}\sum \nolimits_{t \in T} z_t ,\quad j \in J, \quad t \in T \end{aligned}$$
(26)
$$\begin{aligned}&x_{2jkp}, y_{jtp} \in \{0,1\}, \quad a_{jp}, b_{jp} \in \mathbb {Z}^+, \quad j \in J, \quad k \in K, \quad t \in T , \quad p \in P \end{aligned}$$
(27)

where

$$\begin{aligned} Q(X, Y, \mathbf {a}, \mathbf {b}, \omega ) \quad = \quad&\min \quad c_f \sum \nolimits_{j \in J} q_j + c_s \sum \nolimits_{j \in J} g_j \end{aligned}$$
(28)
$$\begin{aligned} \text {s.t.} \quad&q_{j +1} -q_{j} - g_{j} = \sum \nolimits_{p \in P}(\eta (\omega )_{jp} +a_{jp} + b_{jp}), \quad j \in J \end{aligned}$$
(29)
$$\begin{aligned}&q_1 = \acute{q} \end{aligned}$$
(30)
$$\begin{aligned}&q_j, g_j \in \mathbb {Z}^+, \quad j \in J \end{aligned}$$
(31)

3.4 Robust Optimization Model for One Block with One Physician

In this section, we proposal a robust optimization model (RO-i) under the framework of SIP-i. The differences between SIP-i and RO-i come from 1) in the objective function part, SIP-i uses the expectation of overflow and idle time costs based on the scenarios of the random variables, but RO-i directly use the cost value. 2) for the random variables \(\nu _j\) and \(\tau _j\), RO-i has constraints in (41) and (42) to define the scope of the random variables, but SIP-i uses the distributions of them. 3) overall speaking, RO-i provides the most cost-efficient assignment of Type 2 and Type 3 patients who send their requests in the current block for each of the remaining blocks given the fluctuation of \(\nu _j\) in \([\underline{\nu _j}, \bar{\nu _j}]\) and the fluctuation of \(\tau _j\) in \([\underline{\tau _j},\bar{\tau _j}]\). SIP-i gives the best assignment of Type 2 and Type 3 patients who send their requests in the current block for each of the remaining blocks considering the expected impact of overflow and idle time on the costs. RO-i is comparable to the special case of SIP-i when \(\nu _j\) and \(\tau _j\) both have uniform distribution. We did some numeric experiment on comparing the two in next section which shows that when the random variables follow uniform distribution, RO-i and SIP-i tend to make the same decision.

$$\begin{aligned} (\text {RO-i}) \quad&\min \quad -c_2 \sum \nolimits_{j \in J}\sum \nolimits_{k \in K} x_{jk} - c_3\sum \nolimits_{j \in J} \sum \nolimits_{t \in T} y_{jt} + c_f \sum \nolimits_{j \in J} q_j + c_s \sum \nolimits_{j \in J} g_j \end{aligned}$$
(32)
$$\begin{aligned} \text {s.t.}\quad&\sum \nolimits_{j \in J} x_{jk} \le 1, \; \forall k \in K \end{aligned}$$
(33)
$$\begin{aligned}&\sum \nolimits_{j \in J} y_{jt} \le 1, \; \forall t \in T \end{aligned}$$
(34)
$$\begin{aligned}&x_{jk} \le A_{jk}, \quad j \in J, \; k \in K \end{aligned}$$
(35)
$$\begin{aligned}&y_{jt} \le B_{jt}z_t, \quad j \in J, t \in T \end{aligned}$$
(36)
$$\begin{aligned}&a_j = \bar{a}_{j} + \sum \nolimits_{k \in K} x_{jk}, \quad j \in J \end{aligned}$$
(37)
$$\begin{aligned}&b_j = \bar{b}_{j} + \sum \nolimits_{t \in T} y_{jt}, \quad j \in J \end{aligned}$$
(38)
$$\begin{aligned}&\sum \nolimits_{t \in T} (i+j) y_{jt} \ge \beta ^{i-1}\sum \nolimits_{t \in T} z_t ,\quad j \in J, \quad t \in T \end{aligned}$$
(39)
$$\begin{aligned}&q_{j +1} -q_{j} - g_{j} = \nu _j - \tau _j +a_j + b_j ,\quad j \in J \end{aligned}$$
(40)
$$\begin{aligned}&\underline{\nu _j} \le \nu _j \le \bar{\nu _j} ,\quad j \in J \end{aligned}$$
(41)
$$\begin{aligned}&\underline{\tau _j} \le \tau _j \le \bar{\tau _j} ,\quad j \in J \end{aligned}$$
(42)
$$\begin{aligned}&x_{jk}, y_{jt} \in \{0,1\}, \quad a_j, b_j \in \mathbb {Z}^+, \quad q_j, g_j \in \mathbb {Z}^+, \quad j \in J, \quad k \in K, \quad t \in T \end{aligned}$$
(43)

4 Solve The SIP-i Model

4.1 Deterministic Equivalent Problem

As we mentioned before, solution method for a SP model includes decomposition, sample-based approximation as well as heuristics. In this paper, we focus on solving the sample-based approximation of SIP-i. For a SP model with any discrete distributed random variable, we can derive the deterministic equivalent problem (DEP). The DEP is obtained by associating each second-stage variable with all scenarios of the random variable.

For the SIP-i model, assume that there are N scenarios for random variable \(\omega\), the \(n^{th}\) scenario n has probability \(p_n\). Then change the second-stage decision variables \(\mathbf {q}, \mathbf {g}\) into two-dimensional matrices, i.e. \(q_j^n\) denotes overflow to block j under scenario n. The DEP model of SIP-i is presented in (44) to (46).

$$\begin{aligned} (\text {DEP-i})\quad \min \quad- c_2 \sum \nolimits_{j \in J} \sum \nolimits_{k\in K} x_{jk} - c_3\sum \nolimits_{j = 1}^h \sum \nolimits_{t \in T} y_{jt} - \sum \nolimits_{n= 1}^N p_n \bigg ( c_f \sum \nolimits_{j = 1}^m q_j^n + c_s \sum \nolimits_{j=1}^m g_j^n \bigg ) \end{aligned}$$
(44)

constraints (2) to (9)

$$\begin{aligned} \text {s.t.} \quad \quad \quad {q}_{j +1}^{n} - {q}_{j}^{n }- {g}_{j}^{n} = \eta \left(\omega \right)_{j}^{n} + {b}_{j}, \quad j \in J, \; n = 1, \cdots , N \end{aligned}$$
(45)
$$\begin{aligned}&q_1^n =\acute{q}, \; n = 1, \cdots , N \end{aligned}$$
(46)
$$\begin{aligned}&q_{j+1}^n, g_j^n \in \mathbb {Z}^+, \quad j \in J, \; n = 1, \cdots , N \end{aligned}$$
(47)

DEP-i is an integer programming problem, which can be solved using CPLEX for small N. For large size of N, it is impossible to get exact solution. The value of N can be determined using distributions of random variables \(\nu _j\) and \(\tau _j\).

4.2 Distribution of Random Variables in DEP-i

First, let us discuss the distribution of \(\nu _j\), i.e., the number of Type 1 patients arrive at block j. According to [7] as well as [20], the attendance of patients can be assumed to follow Binomial distribution. Let \(p_1\) be the no-show probability of one Type 1 patient, then let us assume that the number of Type 1 patients that arrive at the jth block follows binomial distribution \(\nu _j \sim \text {B}(r_j, 1-p_1)\) satisfying (48).

$$\begin{aligned} \text {Pr}\{\nu _j \text { Type 1 patients will make the appointment at block } j\} = {r_j \atopwithdelims ()\nu _j} (1-p_1)^{\nu _j}p_1^{r_j - \nu _i}, \quad \nu _j = 1, \cdots , r_j \end{aligned}$$
(48)

Next, let us address the distribution of the block throughput \(\tau _j\) which is the number of patients can finish the visit in block j. So far there is no direct description in the literature about the block throughput, but \(\tau _j\) depends on the service time which in the literature has the following types of distributions: Exponential, uniform, Gamma, Weibull and a few others [20]. In this paper, we assume two types of distribution for \(\tau _j\): a) Poisson distribution; b) uniform distribution. The assumption for Poisson distribution was based on the physician service time data collected through 30 days at a local clinic in 2013. We checked the Goodness of fit based on Chi-square Statistics of a few distributions such as Weibull, normal, beta, exponential, gamma, uniform, lognormal, and triangular against the data. Exponential is the Top-1 distribution in terms of Goodness of fit which can also be detected from the histogram of the data in Fig. 1. The assumption for uniform distribution is for the purpose of comparison with Robust Optimization in RO-i. Let \(l_j\) be the length of block j and \(\xi\) be mean service length per patient, the mean block throughput for \(\tau _j\) is \(\frac{l_j}{\xi }\) under the distribution Poisson and uniform. In the rest of this paper, we adopt the historic mean service length from the data, i.e., \(\xi = 24\) min or \(\frac{l_j}{\xi } = 5\), i.e., \(\tau _j \sim\) Poisson(5).

Fig. 1
figure 1

Histogram of Physician Service Time from Local Clinic

4.3 Bound-Based Sampling Method

Without loss of generality, unless particular notice, in the following part of this section, we will discuss the solution method for the assignment at the first block, i.e., \(i = 1\). DEP-1 for SIP-1 has \(m(|K|+ |T|) + |T|\) binary decision variables, \(2m + 2mN\) integer decision variables and \((m+1) (|K| +|T|) + 2m + m|T|+mN+N\) constraints. The size of the problem increases linearly with the number of scenarios. DEP-1 for SIP-1-multi has \((m(|K| + |T |) + |T |)p\) binary decision variables, \(2mp + 2mN\) integer decision variables and \((mp+1)(|K| + |T |) + 2mp + m|T | + (m+1) N\) constraints. We can see that number of decision variables especially the binary variables is increased by p times, the number of constraints is increased by \((|K| + |T |)m(p-1) + (2m-1)p\) which in comparison with the number of scenarios may not be that significant. Given the increase of number of random variables in DEP-1 for SIP-1-multi, the number of scenarios will increase exponentially. Since SIP-i-multi has the same structure as SIP-i, here we focus on SIP-i for the solution method.

Let \(\tau '\) be the smallest integer such that Pr\(\{ \tau > \tau ' \} \le 0.05\), where \(\tau\) denotes the number of patients that can be served in one block, then we can get that the number of scenarios for block j is \(r_j\tau '\), so we have:

$$\begin{aligned} N \approx \prod _{j \in J} (r_j \tau ') \end{aligned}$$
(49)

For example, if \(\tau ' = 8, r_j = 2, |J|=10\), then \(N \approx 16^{10}\). DEP-i with \(16^{10}\) scenarios is an approximation of the original problem, and it only includes \(95\%\) percent possible values of \(\tau\). This large number makes any exact optimization solver unable to solve DEP-i. Therefore, we adopt sample average approximation (SAA) method to pick a small sample size \(\hat{N}\) and draw M batches of samples. As we mentioned earlier, the existing methods for choosing proper sample size \(\hat{N}\) can be classified into exterior sampling and interior sampling. The exterior sampling method is to select/calculate a proper sample size in a designed algorithm and then solve the SAA using this sample size. The interior sampling method is to dynamically sample and solve the SAA in the designed algorithm where the most proper sample size and the optimal solution of corresponding SAA with this sample size will be achieved at the same step. In this paper, we adopt the interior sampling method which is implemented through lower and upper bound of the SIP-i model.

By solving the M approximated DEP-i models with \(\hat{N}\) scenarios in each, we can obtain the lower bound of objective function value of the original DEP-i [50]. Let \(\hat{f}_{\hat{N}}^n\) be the objective function value of the nth batch, then the lower bound is given by

$$\begin{aligned} L_{M\hat{N}} = \frac{1}{M} \sum _{n = 1}^M\hat{f}_{\hat{N}}^n \end{aligned}$$
(50)

The upper bound of the original DEP-i problem can be obtained by calculating objective function value with some feasible solution \(\hat{X}, \hat{Y}\) with \(\bar{M}\) batches of \(\bar{N}\) scenarios where \(\bar{M} \gg M\). Let \(\bar{f}_{\bar{N}}^n(\hat{X}, \hat{Y})\) be the objective function value for the nth batch, then the upper bound is

$$\begin{aligned} U_{\bar{M}\bar{N}} = \frac{1}{\bar{M}} \sum _{n = 1} ^{\bar{M}} \bar{f}_{\bar{N}}^n(\hat{X}, \hat{Y}) \end{aligned}$$
(51)

The confidence intervals of the lower and upper bounds can be determined using sample standard deviation of \(\hat{f}_{\hat{N}}^n\) and \(\bar{f}_{\bar{N}}^n(\hat{X}, \hat{Y})\) based on the central limit theorem [50].

A proper approximation of the original problem goes with a reasonable sample size which makes the model calculable and the objective function close to the “true value”. It is hard to obtain the “true value” of the original problem, but we can utilize the lower bound and upper bound of the original problem to find a good estimation of the “true value”. Algorithm 1 below is designed to obtain the proper sample size for the approximation. This algorithm aims at finding a sample size that reasonably shrinks the average gap between lower bound and upper bound of the original problem. It increases the sample size used in lower bound calculation as in (50) and compares the average gap between the adaptive lower bound and averaged upper bound. Note that the upper bound compared in Algorithm 1 is not exactly the one as shown in (51) but an average level of upper bounds. \(\bar{n}\) is the step length which indicate how much \(\hat{N}\) increases per iteration, \(n_2\) is the baseline for \(\hat{N}\), \(n_1\) is the number of iterations we have in searching for a good sample size. At the end of this algorithm, the sample size of lower bound with the smallest gap over the \(n_1\) iterations will be the suggested sample size. All the computational experiments in this paper are performed with this sample size.

figure a

We compare the results from bound-based sampling method in Algorithm 1 and the interior sampling method proposed by from [53] which is illustrated in Algorithm 2. For the method in Algorithm 2, we change the step length \(\bar{n}\) from 1 to 10 to keep it consistent with our sampling method. From the details of the two methods, we can see that Algorithm 1 distinguishes itself from Algorithm 2 in the following aspects: 1) in each iteration, Algorithm 1 uses the adaptive lower bound \(\frac{1}{M}\hat{f}_{\hat{N}}^n\) and the average upper bound \(\frac{1}{M}U_{\bar{M} \bar{N}}^n\). The original Algorithm 2 was independent of any bound. 2) Algorithm 1 gets the sample size with the minimum accumulative average gap; Algorithm 2 suggests to use the sample size with the minimum accumulative average objective function.

figure b

Figure 2 shows the comparison of our bound-based sampling method versus King and Wets’ sampling method on the DEP-1 model. For Algorithm 1, we set \(n_1 = 20, n_2 = 10, \bar{n} =10, M = 20, \bar{M} = 2000, \bar{N} = 50, |K| = 12, |T|= 13, m = 10, c_2 = c_3 = c_f = c_s = c_o = 1\). Unless specially mentioned, the computational experiments in the following context will use this setting. For Algorithm 2, besides the same model input data, we also set the same maximum iteration number as in Algorithm 1. In Fig. 2 we plot the gaps between lower and upper bounds for each iteration in Algorithm 1 and Algorithm 2. For Algorithm 1, the gap plotted is \(\bar{d}^t_{\hat{N}}\) as calculated in Algorithm 1 for each batch size n. For Algorithm 2, the gap plotted was not used to decide the proper batch size but was calculated only for the comparison purpose. It is the gap between the upper bound in (51) and the averaged objective function value \(F_{\hat{N}}\) calculated in Algorithm 2. In our experiments, the bound-based sampling method suggests using the sample size of 110, while King and Wets’ algorithm implies sample size 180. The average computational time for DEP-i with 110 scenarios is around 0.21 second. Using the same settings and equipment, the average time for DEP-i with 180 scenarios is around 0.36 second. Based on the experiments, besides the slight advantage in saving computational time, the bound-based sampling method also shows a smaller gap in bounds as 5.93 from 110 scenarios versus 6.47 over 180 scenarios. Another benefit of the sampling method is that it produces bounds for the objective function value while proposing a proper sample size. In addition, while using this algorithm, the confidence interval (C.I.) of the objective function value and the best solution can also be calculated with little cost of time.

Fig. 2
figure 2

Comparison of Sampling Methods

4.4 Comparison of DEP-i and RO-i

Here we compare the results of DEP-1 and RO-1. In this numeric experiments, we set \(|K| = |T| = \hat{t}, m = 10, c_2 = c_3 = c_f = c_s = c_o = 1, \tau \sim \text {uniform}(\underline{\tau }, \bar{\tau }) , \nu \sim \text {uniform}(\underline{\nu }, \bar{\nu })\). We set 10 different pairs for \((\underline{\tau }, \bar{\tau }), (\underline{\nu }, \bar{\nu })\) and let \(\hat{t} \in [5, 10, 15, 20 , 25, 30 , 35, 40]\). Then it means that the number of same-day requests ranges from 10 to 80. Table 7 shows the summary of differences between DEP-1 and RO-1. Column 1 shows the total number of the same-day requests received. Column 3 is about the difference in \(|X|+|Y|\), i.e., the total assigned same-day request patients. Column 4 is the ratio between column 3 and column 1. We can see that the differences in assignments between DEP-1 and RO-1 are less than 4% of the requests. It implies that SIP-i and RO-i have close performance when all the random variables follow uniform distribution. The advantage of SIP-i over RO-i is the ability to handle various distributions of random variables ranging from closed-form distributions to empirical distributions.

Table 7 DEP-1 vs. RO-1 Assignment Results

5 The Aggregate Assignment Method

In this section, we will discuss how to apply SIP-i model in reality. In real clinics, patient requests arrive one by one, so the schedule of the requests is also made one by one. We call the schedule made for each single patient request the one-at-a-time assignment [7]. Here we propose the a different method named as aggregate assignment method which schedules multiple patients at the same time. The SIP-i model developed in this paper can be applied to both one-at-a-time assignment and aggregate assignment. For the former one, we just let \(|K| + |T| = 1\) which means only one same-request is received at the block. For the latter one, the fundamental step is to estimate how many same-day requests the clinic receives in each block as elaborated in the Appendix. After the estimation, the SIP-i model is solved with the estimated number of requests. The assignment of each received request will follow the optimal solution of the SIP-i model according to the type of patient and the order of arrival. Let \(\hat{s}\) be the estimator of |K|, i.e., number of Type 2 patients send request in the current block, and \(\hat{w}\) be the estimator of |T|, i.e., number of walk-in patients arrive at the clinic in the current block. The following procedure shows how the aggregate assignment works using DEP-i. The one-at-a-time assignment procedure is shown in Algorithm 4.

figure c
figure d

Theoretically, from an overall perspective, the aggregate assignment makes a better use of the available space of the remaining blocks, since it considers optimal assignment for a group of patients instead of an individual request. The advantage of aggregated assignment method is demonstrated through the following experiment. In the experiment, we compare the two assignment methods under two cases of accuracy of request estimation: underestimation and overestimation. Table 8 shows the cost comparison between aggregate assignment and the one-at-a-time assignment for Block 1 for underestimation and overestimation.

Table 8 Person-wise Assignment Cost Comparison

For underestimation, where real number of patient requests are higher than the estimation, following Algorithm 3, we will run DEP-1 with aggregated mode for the estimated number, and then run DEP-1 with one-at-a-time mode for each of the remaining requests. In the experiment, four underestimation of request numbers are evaluated taking 16 as the real number of requests received. They are: (1) 4 same-day requests with 2 Type 2 requests and 2 Type 3 requests; (2) 6 same-day requests including 3 Type 2 and 3 Type 3 requests; (3) 8 same-day requests including 4 of each type; (4) 10 same-day requests with 5 of each type. The average assignment cost of the 16 same-day requests received in Block 1 is drawn using Algorithm 3 over 20 batches of 110 samples for the aggregated assignment. The average cost and 95% confidence interval (C.I.) of the one-at-a-time assignment are calculated using Algorithm 4. Table 8 shows the percentage of the assignment costs obtained from Algorithm 3 in different levels compared with the average costs or bounds obtained from Algorithm 4. Figures 3 and 4 illustrate the plots of the costs comparison. It is obvious that the aggregate assignment is no worse than the one-at-a-time assignment for the underestimation situation. For estimation larger than 6 requests, the aggregate assignment is significantly better than the one-at-a-time assignment on average.

Fig. 3
figure 3

Aggregate Underestimation Costs vs. Average One-at-a-time Costs

Fig. 4
figure 4

Aggregate Underestimation Costs vs. 95% C.I. of One-at-a-time Costs

For the case of overestimation, we still assume the real number of requests is 16, and the estimation of requests ranges from 16 to 20. We run the DEP-1 model with one-at-a-time mode for 20 batches of sample size 110 for 16 requests, then take the average assignment cost for the 16 requests and 95% C.I. of the costs. In contrast, we run the DEP-1 model with aggregated mode for 16, 17, 18, 19, 20 estimated requests for the first block, and then take the average assignment cost for the first 16 requests. The last column of Table 8 as well as Figs. 5 and 6 show the comparison results. The prompt observation is that in the situation of overestimation, aggregate assignment is better than one-at-a-time assignment on average. From Fig. 6, we can see that if the real request number is less than 6, then the former is no worse than the latter; if the real request number is larger than or equal to 6, then the former is dominantly better than the latter.

Fig. 5
figure 5

Aggregate Overestimation Costs vs. Average One-at-a-time Costs

Fig. 6
figure 6

Aggregate Overestimation Costs vs. 95% C.I. of One-at-a-time Costs

6 Sensitivity Analysis and Value of SIP model

6.1 Importance of Request Estimation

Although under both underestimation and overestimation, the aggregate assignment shows strength in gaining better cost level on average, the importance of accuracy of request estimation can also be detected in Figs. 3 to 6. It is not hard to discover that the performance of aggregate assignment is overwhelming when the estimation is close to the real value. So it is worth conducting more experiments to explore the effect of request estimation. In the following experiments, let \(\hat{s}\) be the estimated Type2 requests of received in the first block and \(\hat{w}\) be the estimated Type 3 patients arrive in the first block. Let \(\hat{s} = \hat{w}\) and each of them increases from 5 to 43, so the total number of requests goes from 10 to 86. Then we solve DEP-1 for each of the estimations with 20 batches each and take average results. In Figs. 7, 8, and 9, we plot the objective function value and its three components: revenue associated with total number of assigned requests, cost of overflows (as patient waiting time cost), and cost of patient shortage (as physician idle time cost). A prompt observation on the trend of objective function over increment of requests is the bowl shape. It goes down from 10 requests to 34 requests, then keeps a flat pattern between 34 requests and 68 requests, and then goes up again presenting apparently three pieces of segments with two break points: 34 requests and 68 requests. There are obvious trembles in all of the three segments which are caused by the randomness of scenarios. We can explain this bowl shape in the following way: When the estimated request number is close to the real capacity of the system, the model gradually approaches saturation status with small overflows or shortages, which produces the flatness of the second segment. In the first segment, the overflow is close to zero, and the shortage cost dominates. So from Fig. 9 we can see that the trend of objective function value follows the trend of shortage cost in the first segment. In the second segment, the overflow cost preserves an increasing trend at first half interval, then keeps a high level until the end of the second segment. The number of assigned requests also demonstrates a similar trend as an offset of the overflow cost. Together with the stable trend of shortage, they lead to a low and flat objective value level in this segment. In the third segment, the overflow level drops as a result of decreased number of assigned request, the conciliation among the three components leads to a mild increase in objective function value as compared with the second segment. These experiments are conducted with the setting of block throughput \(\tau \sim\) Poisson(5), and number of blocks \(m = 10\). Therefore, the clinic daily throughput is about 50 which is close to the center of the second interval [34, 68] where a lower level of overall cost and We can see that, if the estimation of total requests falls in the second interval [34, 68], then a low level overall cost can be guaranteed

Fig. 7
figure 7

Objective Value and Assigned Requests of DEP-1 with Different Request Estimations

Fig. 8
figure 8

Objective Value and Patient Shortage Cost (\(\mathbf {g}\)) of DEP-1 with Different Request Estimations

Fig. 9
figure 9

Objective Value and Patient Shortage Cost (\(\mathbf {g}\)) of DEP-1 with Different Request Estimations

6.2 Further Sensitivity Analysis

Besides the number of requests, a clinic manager may also be interested in the influence of scheduling parameters. With the DEP-i model and the bound-based sampling method, it is very convenient to conduct sensitivity analysis on parameters and settings. Here we choose six factors to be studied: \(r_i\), \(c_2\), \(c_3\), \(c_f\), \(c_s\), l. Each factor has five levels as shown in the second column of Table 9. Since the objective function coefficient is involved as a factor, the magnitude of the objective function is no longer a proper metric. So we utilize the components of the objective function: the average number of assigned request, the average sum of \(\mathbf {q}\) and the average sum of \(\mathbf {g}\), as the metrics for the evaluation. The third to eighth columns of Table 9 present the ranks of the impact of factors under the metrics through the entropy-based analysis addressed in [55]. The higher the information gain is, the more the factor contributes to the change of the corresponding metric. Rank 1 implies the highest information gain, and 5 is the lowest. Column 3 to 5 are the results obtained under the distribution of \(\tau \sim \text {Poisson} (\frac{l}{\xi }\)), and Column 6 to 8 are with distribution of \(\tau \sim \text {Discrete Uniform} (0, \frac{2l}{\xi }\)). We can see that under Poisson distribution of \(\tau\), unit overflow cost and patient shortage cost are the most significant factors contributing toward total overflow cost and total patient shortage cost. Since \(\xi\) is fixed in this experiment, l is proportional to the mean throughput of each block, so the mean throughput is the most important factor contributing toward assignment ratio of the same-day request. Since value of \(r_i\) decides the capacity available for the same-day request, we can say that the available capacity of each block is also important to the assignment ratio of the same-day request. The importance rank changes when we set the distribution of \(\tau\) as uniform. However, the overflow cost still dominates. This implies that the clinic needs to give more priority to controlling the waiting time cost. Given the fact that the two distributions of \(\tau\) share the same mean value, the deviation between the ranks under the two distributions reveals that the second and higher-order statistics of block throughput bring significant impact to the assignment decision. The monotonic trends of these components versus increases of the factors are depicted using \(\uparrow\) for increase and \(\downarrow\) for decrease in Table 9. The changes of the values of the three objective components are monotonic with the increase of the six factors except for the block length. For the block length, the trends of total overflow cost are convex curves for both distributions, and the trend of total patient shortage cost is also a convex curve for uniform distribution. This indicates that the clinic can find a proper block throughput to minimize the overflow and patient shortage cost in a certain scope. Except for the block length, the trends of the components keep consistent under the two different distributions.

Table 9 Rank of Importance of Parameters under Different Distributions of \(\tau\)

7 Conclusions

This paper suggests the clinic administrators who are practicing the open-access policy and block-wise assignment to adopt the aggregated assignment with SIP model. This method obeys the real event sequence of the clinic and is able to handle various real situations such as no-shows, patient preferences, FCFS rules, cancellation, earliness and lateness. It delivers a reasonable solution with the best revenue-cost balance incurring limited computational cost. Leaning on the estimation of the same-day requests in each block, the SIP model executes the aggregate assignment which is shown through numerical examples to perform better than the traditional one-at-a-time assignment for both overestimation and underestimation. Rather than exhausting every sample in the sample space of the random variables, we develop the bound-based sampling method to gain a reasonable sample size for the approximation. This sampling method provides a lower gap between upper bound and lower bound of original objective value. Using the sample size gained from the sampling method, we perform sensitivity analysis on a few parameters and settings which in practice can offer meaningful insights for clinic cost control as well as key factor identification and monitoring. The advantage of the SIP model over the first-order statistics model is demonstrated through entropy analysis for different distributions of \(\tau\).

The proposed method does not specify the orders of appointments within the blocks, but the output of SIP-i model offers sufficient information. In practice, the clinic manager can arrange the appointments based on the optimal values of \(\mathbf {X}, \mathbf {Y}\) following their requests sequence. Time allowance of each appointment can be obtained from mean service time or the ratio of block length over upper bound of block throughput. In our model, the clinic gives options for patients for the appointments, but the choice of patients is not involved. In practice, a patient can choose one of the appointment requests which are received in the same block. Apparently, the patient who sends a request earlier in the block can have more choices than those who send requests later. In implementation of the proposed method, we suggest the clinic to process and analyze historical data to gain information about the parameters such as no-show ratios, cancellation ratios, distributions of uncertain data and so on. Accuracy of these information is a prerequisite condition for the appropriate decision. It is recommended that decision makers of the clinic should pay attention to the consistency and stability of work efficiency of the block throughput, find a proper length for blocks, and make policies to reduce the waiting time cost and physician idle-time cost. What is more, better coordination of the assignment of the Type 1 patients and the same-day request patients will result in the cost-saving control. Last but not least, we show that the overall cost stays at a low level when estimation of the same-day requests is close to the “real” request number the clinic needs. Implementing the proposed method will not ask for a high level of accuracy in estimation of the same-day requests, a “scope” of the requests is sufficient.

Under COVID-19 circumstances, a lot of regular clinic schedules has been changed from office visiting into telehealth service. However, we can still find the Type 1, Type 2 and Type 3 patients in the telehealth system. Especially, Type 3 patients will wait online in the telehealth system. Although all the models and algorithms in this paper are designed for the clinic scheduling problem, it can be conveniently applied to other service reservation systems or online job shop scheduling with time window or other assignment restrictions.