A Decision Support System for Elective Surgery Scheduling under Uncertain Durations

Featured Application: A software tool for helping doctors in the automatic scheduling of elective patients is proposed. The tool has been developed considering the organizational structure of Spanish hospitals. However, it may be easily extended to any hospital (public or private) working under operation room block booking criterion. Abstract: The operation room (OR) is one of the most expensive material resources in hospitals. Additionally, the demand for surgical service is increasing due to the aging population, while the number of surgical interventions performed is stagnated because of budget reasons. In this context, the importance of improving the efﬁciency of the surgical service is accentuated. The main objective of this work is to propose and to evaluate a Decision Support System (DSS) for helping medical staff in the automatic scheduling of elective patients, improving the efﬁciency of medical teams’ work. First, the scheduling criteria are ﬁxed and then the scheduling problem of elective patients is approached by a mathematical programming model. A heuristic algorithm is proposed and included in the DSS. Moreover, other different features are implemented in a software tool with a friendly user interface, called CIPLAN. Considering realistic data, a simulation comparison of the scheduling obtained using the approach presented in this paper and other similar approaches in the bibliography is shown and analyzed. On the other hand, a case study considering real data provided by the Orthopedic Surgical Department (OSD) of the “Lozano Blesa” hospital in Zaragoza (HCU) is proposed. The simulation results show that the approach presented here obtains similar occupation rates and similar conﬁdence levels of not exceeding the available time than approaches in the bibliography. However, from the point of view of respecting the order of the patients in the waiting list, the approach in this paper obtains scheduling much more ordered. In the case of the Orthopedic Surgical Department of the “Lozano Blesa” hospital in Zaragoza, the occupation rate may be increased by 2.83%, which represents a saving of 110,000 euros per year. Moreover, medical doctors (who use this tool) consider CIPLAN as an intuitive, rapid and efﬁcient software solution that can make easier the corresponding task.


Introduction
The Operation Room (OR) is one of the most expensive material resources of the hospitals (in Spain being about 40% of the total hospitalization cost [1]) and approximately 60% of patients need it at some point during their hospital stay [2]. On the other hand, the demand for surgical services is increasing due to the aging population. In Spain, the average life expectancy is about 81.8 years being one of the highest in Europe [3].
Moreover, as a result of the economic crisis in 2008, the number of surgical interventions performed annually in Spanish public hospitals has stagnated at 3.5 million. This situation has also contributed to a continuous increment in the number of patients in the surgical waiting lists, reaching 600,000 in 2017 [4]. In some cases, these huge lists lead into waiting times greater than six months, which is becoming a serious problem for the healthcare system. Being difficult to increase the surgical resources, the importance of improving the efficiency is accentuated. New management techniques, scheduling methods, and specific information systems could help to improve the efficiency of the surgical services and, consequently, could reduce the surgical waiting lists.
The main objective of this work is to provide a DSS for managing surgical services in hospitals. In particular, a software tool (called CIPLAN from the Spanish words PLANificación de CIrugías) is presented that may be used by medical doctors to automatically perform a scheduling of the patients. It is assumed that the uncertain parameters (surgery duration and cleaning time) follow a normal distribution and, consequently, the expected total duration of a surgical block also follows a normal distribution. In this way, the probability of exceeding the working time can be introduced as a capacity chance constraint. Even if the lognormal distribution may give better approximations of the surgery times [5], the optimization problem has nonlinear constraints, being difficult to solve. Since, in general, acceptable error is obtained for normal distribution, this work assumes this type of distribution.
The following three criteria have been considered for the scheduling problem. C1. Maximize the occupation of the ORs. Since the ORs with their associated cost constitute the bottleneck of the system (they can be open only during a given period of time every working day and their cost is high), the first scheduling criterion is to maximize the occupation of the ORs. In this way, the underutilization of the ORs is prevented and the use of resources is maximized.
C2. Ensure with a minimum confidence level that the total available time in a time block is not going to be exceeded. On contrary to C1, an over-scheduling of the ORs is not desired since the last scheduled surgeries can be canceled if the medical personnel believes that the time of the time block will be exceeded. Among other problems, such cancellations reduce the real occupation rate in the ORs.
C.3 Respect as much as possible the order of the patients in the waiting list. Due to ethical and common sense reasons, patients with the same urgency level should spend a similar time in the waiting list. For that, once the patients in a waiting list are ordered depending on the urgency level and the admission date, the third scheduling criterion is to respect as much as possible the order of the patients in the waiting list. For example, in the Orthopedic Department of the HCU, each team has assigned two time blocks per week for the elective patients, so the difference of scheduling a patient in the first time block with the sixth one is 21 days.
Mathematical programming is an optimization technique [6] commonly used in managing hospitals [7], not only for surgery scheduling problems [8], but also for other problems such as bed management [9], nurse scheduling [10], or management policy decisions [11]. This paper proposes first an Mixed Integer Quadratic Constrained Programming problem for performing the scheduling of patients based on the three criteria presented before. It is well known that the computational complexity to obtain the optimal solution is high and a heuristic method is proposed called Specific Heuristic Algorithm (SHA) [12]. The software tool, in addition to helping doctors in the scheduling task, has also been developed for managing medical doctors, medical teams, OR timetable, and patients.
A preliminary version of this work has been reported in [12] where a first version of the SHA has been proposed. In this paper, the heuristic SHA is improved by adding a post arranging of the time scheduled blocks. This improvement provides solutions respecting the order of the patients in the waiting list more. Additionally, the DSS is explained (not only the part related to surgery scheduling but also related to management tasks), and the solution is compared using real data from the HCU with two other methods in literature.

Related Work
In literature, many researchers studied the problem of planning and scheduling of elective patients (see [8,13] and the references herein for an overview while for an overview of the problems see [14]). Almost all the works consider criterion C1 presented before. Criterion C2 (of using chance constraints for the scheduling) is considered also in some contributions presented in the last years. For example, in [15], integer stochastic formulations are proposed for two sub-problems in which the original problem is decomposed. The approach to solve them is based on neighborhood search techniques and Monte Carlo simulation. In [16], a two-stage robust optimization model is proposed that is solved based on a column-and-constraint generation method. A similar method is used by the authors in [17] to deal with uncertain surgery duration and emergency demand, while, in [18], the authors use particle swarm optimization for the scheduling of surgeries.
The approaches presented in [19,20] are the most related to the one presented in this paper. The authors in [19] present an optimization framework for batch scheduling within a block booking system that maximizes the expected utilization of ORs subject to a set of probabilistic capacity constraints. They propose an algorithm that iteratively solves a series of mixed-integer programs that are based on a normal approximation of cumulative surgery duration. In [20], constructive and local search heuristics for maximization of ORs utilization and minimization of the overcoming risk are proposed. In their model, to address the randomness of surgery processing times, a planned time slack is reserved in each scheduling block, which is a function of total mean and variance of surgeries assigned to the corresponding block. When determining an appropriate size of the planned slacks, the authors assume that the sum of surgery duration follows a normal distribution.
Both approaches in [19,20] require setting in advance the patients that are going to be scheduled in the next blocks. Therefore, in these approaches, all considered patients must be scheduled in one of the available blocks. For this, both approaches start with an initial scheduling obtained through the scheduling rule: first-fit probabilistic. Following this rule, sequentially each surgery is assigned to the first available block for which the probabilistic capacity constraint is satisfied after the assignment. Once the initial scheduling is obtained, the expected occupation rate of the first blocks is improved by rescheduling the surgeries. In this way, the last blocks are totally or partially released.
Unlike [19,20], the approach presented in this paper does not require to know in advance the set of patients that should be scheduled in the next surgical blocks, since any patient on the waiting list may or may not be scheduled. Another big difference with [19,20] consists of the usage of two balanced terms in the cost function that favor patients to be scheduled in an orderly manner at the same time that the expected occupation rate of the OR is maximized. An exhaustive numerical comparison using realistic data is performed and analyzed showing that the approach presented in this manuscript provides better solutions to the considered problem than the one in [19,20]. In particular, even if the results show similar occupation rates and similar confidence levels, the approach presented in this paper respect the preference order of the patients in the waiting list more. Therefore, criterion C3 is better considered. In the case of the hospital in which the approach is implemented, the number of available time blocks per week for each medical team is equal to two, while, on average, three patients are scheduled in a time block, making it very important to keep, if possible, the order of patients in the waiting lists. This is one of the main differences of the approach presented in this paper with the other approaches.
DSS are used for managing tasks in different fields of applications, as for example in stormwater management [21], dental manufacturing production line [22], offshore wind farms [23] and healthcare systems [24,25]. Moreover, a DSS for OR scheduling was proposed in [26] based on a Mixed Integer Linear Programming (MILP) problem [27,28] that takes into account the preference order of the patients. However, this approach does not consider the variability on the uncertain parameters (surgery duration, cleaning time, etc.) and consequently can not manage the risk of exceeding the total time. The DSS proposed in this work uses an heuristic algorithm allowing to impose a minimum confidence level of not exceeding the total time in a surgical block. In this way, doctors not only can manage the risk but also can know in advance the probability that each block exceeds the available time. The DSS proposed in this paper can also perform the management of medical teams and OR time table. Moreover, it is possible to perform iterative scheduling which is useful if, for example, after obtaining a first scheduling, some patients can not attend the day of their surgeries. Furthermore, after a surgery is performed, the DSS automatically updates and customizes the average and standard deviation of the surgery duration. Finally, in order to provide a safe environment to work and better security of the medical data, different access levels are provided to every user.
The second main contribution of this paper is the presentation of a DSS that can help medical doctors not only for scheduling of surgeries, but also it can be used for management tasks of patients, medical teams, hospital resources, etc. Finally, the scheduling approach presented is compared with real historical data from the studied hospital, this being a third contribution of this manuscript.

Preliminaries and Problem Definition
Let us assume that each surgical team of a hospital department has some surgical blocks booked for performing the surgeries of their elective patients list. Thus, the problem of scheduling can be divided into different independent sub-problems: one for each medical team. In this process, some patients are assigned from the waiting list to the next time blocks previously booked. Currently, in many Spanish hospitals, the scheduling is performed manually, so the schedulers (normally medical doctors) are guided by their own intuition and experience to assign the patients.

Scheduling Problem Statement
In this subsection, the Scheduling problem is introduced formally. First, the notation, terminology, and assumptions are fixed and then the scheduling criteria are transformed to cost function and constraints.
Let S = {s 1 , s 2 , . . . , s |S| } be the set of surgery types that can be performed in the medical department and let us assume that the duration d(s k ) of each type of surgery s k ∈ S is a random variable with normal probability density function (pdf) d(s k ) = N(µ d(s k ) , σ d(s k ) ), where µ d(s k ) is the average and σ d(s k ) is the standard deviation.
On the other hand, let Dt be the delay with respect to the starting time of a block and let Ct be the cleaning time duration of the OR after a surgery is performed. It is assumed that Dt and Ct are also random variables with normal pdf, i.e., Dt = N(µ Dt , σ Dt ) and Ct = N(µ Ct , σ Ct ).
Furthermore, let us consider W = {w 1 , w 2 , . . . , w |W | } an ordered list of patients such that, if w j ∈ W, j is the preference order of the patient w j in the waiting list.
In addition, let us assume an ordered set of time blocks B = {b 1 , ..., b |B| } to schedule, where b |B| is the block corresponding to the latest date. Each block b i ∈ B has a fixed duration denoted by l(b i ).
For each time block b i ∈ B to schedule, there exists a binary decision vector S i ∈ {0, 1} 1×|W | with a dimension equal to the number of the patients in the waiting list. If S i [j] = 1, then surgery of patient w j should be performed in working day i ≤ |B|.
Let S b i be the set of surgeries scheduled in the time block b i ; then, the total duration T b i of the time block b i can be computed by Equation (1). That is the sum of: (i) the delay with respect to the starting time (i.e., Dt), (ii) the duration of the surgeries scheduled in the time block b i , and (iii) the cleaning time duration Ct between two consecutive surgeries. Notice that the cleaning time after the last surgery is not considered: Because all these variables are assumed to follow a normal distribution, the total duration T b i of the time block b i also follows a normal distribution The goal of the scheduling problem is the assignment of the patients from the waiting list W to the set of time blocks B considering the scheduling criteria C1, C2 and C3. Let us define the following further notations: • µ w be a row vector containing the average duration of surgeries of the patients in the waiting list W. For example, µ w (j) represents the average duration of the surgery corresponding to the patient w j .

•
Po be a row vector containing the preference order of the patients. Assuming that patients are ordered according to their priority, then Po(j) = j. • Cl is the minimum confidence level of not exceeding the total time.
then: Criterion C1 is formalized by objective O1 given by Equation (2). This equation maximizes the expected surgery time in each block (µ w · S i ) giving more importance to the first ones (|B| + 1 − i): Criterion C2 is imposed by the chance probability constraint given by Equation (3). It ensures with a minimum confidence level Cl that the total duration T b i in each time block b i ∈ B does not exceed the available time l(b i ): Finally, criterion C3 is formalized by the objective O2 given by Equation (4). Here, by minimizing the sum of the preference order of the patients scheduled in each time block (Po · S i ), preference to the first patients in the waiting list is given. Moreover, multiplying by the term (|B| + 1 − i), first patients should be scheduled in the first time blocks:

Optimal Mathematical Programming Model
A Mixed-Integer Quadratic Constrained Programming (MIQCP) model is proposed (5) for solving the patients Scheduling problem. In this model, the objectives given in Equations (2) and (4) are mixed in a linear cost function with two terms balanced by the value of the parameter β: Subject to: The MIQCP model has two sets of constraints. The first one is related to the chance probability constraint given in Equation (3), while the second one imposes that each patient in the waiting list is scheduled at most once. Development of the chance constraint (3) quadratic constraints is obtained [29].
Moreover, the decision variables S i are binary, so the computational complexity of the MIQCP model is really high. In order to obtain scheduling in a reasonable time, heuristic approaches are needed.

Specific Heuristic Algorithm
Two heuristic approaches have been discussed for implementation in the DSS. The first one is a Receding Horizon Strategy (RHS) which obtains a sub-optimal solution sequentially (similar to [30]), while the second one is a Specific Heuristic Algorithm (SHA) based on list scheduling techniques [31][32][33].
The SHA for the scheduling of patients problem is composed of three parts: (i) a previous data analysis; (ii) the scheduling of the time blocks; and (iii) a re-assignment of time blocks.
Part (i): A previous data analysis. This part is composed of two steps executed sequentially once at the beginning of the scheduling.
Step 1. Classify the set of surgeries S in a given number t of disjoint subsets such that S = S 1 ∪ . . . ∪ S t , t being an input parameter. This classification is done based on two conditions: (1) the average duration of all surgeries in a subset S i ∈ S, i = 1, 2, . . . , t − 1 must be less than or equal to the average duration of all surgeries in subset S i+1 ∈ S, and (2) the expected number of patients in each subset S i ∈ S should be similar. In order to compute the expected number of patients for each S i ∈ S, the probability of occurrence of all surgeries in S should be known, and it is obtained using historical data of the studied department.
For example, if there exist three types of surgeries S = {s 1 , s 2 , and the occurrence probabilities are 0.25 for s 1 and s 2 and 0.5 for s 3 , a valid classification for Step 2: Obtain the set of possible scheduling types for each time block b i ∈ B. In this step, all multisets from set S = {S 1 , S 2 , . . . , S t } are obtained from the possible scheduling type for the time block b i . Formally, a possible scheduling type is a tuple (S, m), where S is the underlying set of the multiset and m : S → N ≥1 is a function giving the multiplicity of the elements in the multiset. A multiset belonging to the possible scheduling type of block b i should satisfy the chance constraint (3). In order to check that the chance constraint (3) is satisfied, the surgeries with lower average duration are considered.
For example, a possible scheduling type for time block b i could be {S k , S k , S j } meaning that, in block b i , two surgeries from set S k may be scheduled and another one from set S j . If s 1 k is the surgery type with the lowest average duration from S k and s 1 j is the surgery type with the lowest average duration from S j , according to the total duration in (1), the minimum total duration of the time block b i is where Dt is the delay with respect to the starting time and Ct is the cleaning time duration after each surgery. As observed before, T b i is following a normal distribution with mean and standard deviation Since {S k , S k , S j } is a possible scheduling type, the chance constraint (3) is satisfied. In order to check this equation, based on normal distribution property [34], the following inequality where V Cl is the value corresponding to the normal variable (x ∼ N(0, 1)) with a cumulative distribution function Cl, i.e., P[x ≤ V Cl ] = Cl and this value is tabulated. Part (ii): Scheduling of the time blocks, consisting of the following four steps executed sequentially for each time block b i to schedule.
Step 3: For each possible scheduling type of time block b i , obtain the sets of real scheduling. Given a possible scheduling type, a real scheduling is composed by a set of patients with the types of surgeries equal to the possible scheduling types.
For example, considering the scheduling type {S k , S k , S j }, a real scheduling is composed from two patients w and w on which a surgery s k ∈ S k should be performed and one patient w on which a surgery s j ∈ S j should be performed. The first real scheduling corresponding to {S k , S k , S j } is chosen by taking the patients with a lower number of preference order (corresponding to the higher preference). However, all other combinations of patients satisfying the chosen scheduling type having no patients with preference order greater than the maximum preference order of the patient in the first real scheduling will be considered.
Let us assume, for example, the list of patients given in Table 1 with W = {w 1 , w 2 , w 3 , w 4 , w 5 , w 6 } such that patients w 1 , w 3 , and w 5 have assigned the surgery s 1 , the patient w 2 has assigned the surgery s 2 , the patient w 4 the surgery s 3 , and the patient w 6 the surgery s 4 . Assuming the set of The maximum order of patients in this real scheduling is 4 (corresponding to w 4 ), hence the following real scheduling will be considered as well: {w 1 , w 3 , w 4 } and {w 2 , w 3 , w 4 }. For the scheduling type {S 1 , S 2 , S 3 }, the first real scheduling is {w 1 , w 4 , w 6 }. Since the maximum preference order of patients is 6, the following real scheduling will be considered as well: {w 2 , w 4 , w 6 }, {w 3 , w 4 , w 6 } and {w 4 , w 5 , w 6 }. All of this real scheduling is shown in Table 2. Table 1. Surgery data and waiting list of patients used for explaining part 2 of the SHA.

Surgeries Data
Waiting List S Types Average Duration Step 4: Evaluate the real scheduling and select the best one for each scheduling type. First, the real scheduling not fulfilling the chance constraint (3) is removed and the check is similar to the one in Step 2. For the remaining real scheduling, the expected occupation rate r is computed by summing the average duration of all surgeries in the real scheduling divided by the time block duration l(b i ) (multiplied by 100 if percentage). Furthermore, the average preference order Ap is computed by summing the preference order of all patients in the real scheduling divided by the number of patients in the real scheduling. The real scheduling with the minimum value of the following fitness function is chosen: where Min Ap is the minimum average preference order of all real scheduling; Max r is the maximum occupation rate r of all real scheduling; and β is a balancing parameter between the two terms (one for preference order and one for occupation rate). For example, in Table 2, the computations of the occupation rates are given, preference order, and fitness function (fifth column) for the set of real scheduling considered before. In this example, a value of β = 2.6 is used and the time block duration are assumed to be l(b i ) = 420 (min), corresponding to 7 h. In this step, the real scheduling w 1 w 2 w 4 is chosen for the possible scheduling type S 1 S 1 S 2 and w 2 w 4 w 6 is chosen for S 1 S 2 S 3 .
Step 5: Evaluate the best real scheduling chosen in Step 4 (one for each scheduling type) and select the best one for the current time block b i . From the set of selected real scheduling in the previous step, the one with minimum value of the fitness function (6) is chosen. Notice that the value of the fitness function of a real scheduling in this step is, in general, different by the one computed in step 4. In particular, Min Ap and Max r have different values since are computed based only on the best real scheduling computed in step 4.
The sixth column of Table 2 is showing the computation of the fitness function on the two selected real scheduling instances on the previous step. Hence, in this step, Min Ap = 2.33 corresponding to w 1 w 2 w 4 while Max r = 88.09 corresponding to w 2 w 4 w 6 . According to them, patients w 2 w 4 w 6 are selected for the time block l(b i ).
Step 6: Remove the scheduled patients. The patients scheduled in Step 5 are removed from the waiting list, and the procedure is iterated for time block b i+1 from Step 3.
By using the case study in the HCU hospital, it has been observed that values of t = 3 and of β = 2.6 are appropriate. However, for different medical departments, a previous study is necessary in order to better choose these design parameters.
Part (iii): Sorting the time blocks with the same available time. First, the time blocks are grouped depending on their available time l(b i ). Then, the time blocks of each group are sorted in ascending order according to the average preference order of the scheduled patients (indicator Ap). At the end, for each date, a time block is assigned sequentially starting with the closest one.

Decision Support System
In this section, the main features of the proposed DSS are discussed. Each doctor in the hospital department has his own list of patients and the waiting list of a team is composed by the merged list of doctors belonging to the team. Each team must schedule the patients from its waiting list during the time blocks previously booked by the head of the department. Thus, the main objective of the DSS is to help medical doctors perform a fast efficient and dynamic scheduling of the elective patients. The DSS uses as a core for the scheduling of patients the SHA approach presented in the previous subsection. However, other features are also included which enable (a) managing the medical teams and the OR time-table; (b) updating the waiting lists; (c) dynamic planning; and (d) improving the problem parameter by updating the surgeries duration.
Manage medical team and OR time-table. Normally, the medical teams are composed of the same medical doctors. However, sometimes medical doctors could move from one team to another. The head of the department is responsible for updating the medical teams and including this information in the DSS. Moreover, the head of the department should define the ORs time-table in the DSS. The OR, the date, the starting time, and the ending time of each time block assigned to each team is the information that must be included in the DSS.
Updating the waiting list. Generally, the new arrived patients are included at the end of the waiting list. However, depending on medical criteria, the surgeon could decide to advance the patient into a higher position in the waiting list. The DSS automatically orders the waiting list of patients. There are two parameters influencing directly the position of the patient in the waiting list.

1.
The first parameter is related to the waiting time for surgery. A score S 1 of 10 is given to the patient with the highest number of waiting days, while the newest patient has a score of 0. A proportional score between 10 and 0 is given to other patients. In the calculation of total score (denoted S T ), the score S 1 has a weight of p.

2.
The second parameter has to do with the surgery priority. Although non-urgent surgeries are scheduled with the DSS, three levels of priorities 1, 2, and 3 are considered by doctors depending on the urgency. A corresponding score (S 2 ) of 0, 5, and 10 is associated respectively.
The final score is obtained as follows: Finally, the patients are ordered according to their total score. The patient with the highest total score will be the first, while the patient with the lowest punctuation will be the last one.
Iterative planning. The scheduler of each medical team performs the scheduling for the next |B| time blocks (this is done by using the SHA). The secretary calls the patients scheduled and asks them for their availability on the scheduled date. The secretary gives back this information to the team scheduler who should schedule the empty gaps again. This process is repeated until the |B| time blocks are completely scheduled with all patients confirmed.
During the iterative scheduling, if a patient confirms the attendance, she/he is fixed in the corresponding time block. However, in the case that a patient cannot be contacted or she/he cannot be hospitalized, then the patient is not considered for the scheduling of the next |B| time blocks.
Thus, in the next iteration, the patients previously confirmed and the patients who cannot be hospitalized are not considered in the waiting list. The SHA schedules new patients in the gaps of the uncompleted time blocks.
Updating and customizing the average duration. The average duration and standard deviation of each type of surgery should be computed using historical data from the hospital department. Considering two years, a sufficiently high number of surgeries of each type is obtained, and the average duration is representative. However, depending on the skills and experience of the surgeons, significant differences could exist between their average duration. Moreover, for the same medical doctor, a continuous decrease of the average duration, due to the experience occurring, so these input values should be dynamically updated.
When a surgery is finished, the name of the surgeon and the time spent are introduced in the DSS. The DSS registers this information in a database and updates the average duration.
Overview of the DSS. All the previously explained features are integrated into the DSS whose flowchart is given in Figure 1. When a new patient arrives at the service, she/he is introduced into the waiting list of a medical doctor. Each surgeon is responsible for including their patients in the system. The DSS recognizes the surgeon (using a personal password) and she/he must enter some personal information of the patient, the pathology and the priority of the surgery. Additionally, the DSS saves the actual date (to compute the waiting time in the list) and the surgeon to whom the patient belongs. When a team scheduler wants to perform a scheduling, she/he is recognized by the DSS and automatically composes the ordered waiting list of his patients.
The DSS has a database, which is updated every time that a surgery is performed. The pathology and its surgery durations are saved in the database. Thus, considering this information, the tool assigns average theoretical duration and standard deviation to each surgery in the waiting list. In this way, the vectors µ w and σ w are generated. On the other hand, the DSS saves the OR time-table introduced previously by the head of the department-that is, the time blocks booked for each team as well as their duration defined as l(b i ). The DSS performs an operation scheduling in an iterative way. The input data that the team's manager has to introduce in the DSS to schedule the next time blocks are: (i) the minimum confidence level Cl and (ii) the number of time blocks to schedule |B|.
When a patient has been scheduled, his/her state changes from "pending" to "scheduled". Once a specific surgery is performed, the surgeon indicates this situation in the DSS and the corresponding patient is removed from the waiting list. Additionally, the surgeon introduces the operating time in the tool and these new input data are used to update the average duration. If finally a scheduled surgery is not performed, the DSS changes the state of this surgery from "scheduled" to "pending".
Based on the previously described DSS, a Software tool for scheduling elective patients in Spanish Hospitals called CIPLAN has been developed. A first version of this software was described in [12].
CIPLAN has been developed in JAVA language and has a SQL database. Moreover, in order to provide a safe work environment and a better security of the medical data, different access levels are provided to the users. The preferences and concerns of medical doctors in the OSD have been considered not only at the surgery scheduling level but also at the user interface level. Thus, a friendly interface divided into six main panels was proposed. These panels are based on the DSS and the first five are shown with color boxes in the flowchart of Figure 1: (1) Medical teams, (2) Patients, (3) Surgeries, (4) OR timetable, (5) Scheduling, and (6) User. Figure 2 shows the interface of the scheduling panel.

Simulations
In this section, some scheduling results derived of simulation are described and analyzed. The approach presented here is compared with two approaches in literature.

Simulation Methodology
In order to test the SHA and to compare it with the approaches proposed in [19,20], a discrete event simulation model of the scheduling has been implemented. It is used to simulate scheduling decision for a medical team in the Orthopedic Surgery Department (OSD) at the HCU. One year and the half length (78 weeks) is set for each simulation run. The new patients are assumed to arrive according to a Poisson distribution with an average of six per week. We assume initially a waiting list of 100 patients and every week the new arrived patients are added to the list.
During the last two years, considering historical data in the OSD, the occurrence probability of each surgery type and their duration have been computed. These values are considered in the simulation for generating the surgery of the arrival patients. Figure 3 shows the occurrence of the most common surgeries performed in the OSD while Table 3 indicates their average and standard deviation. Notice that seven types of surgeries represent around 73% of the total surgeries performed; however, all of them are used in the simulations.   For each set of simulations, 50 replications are performed. Each replication is a schedule of 156 time blocks (78 weeks × 2 time blocks per week) all of them having the same time duration of l(b i ) = 390 min (6.5 h). The average values of the probability of not exceeding the total time (confidence level) and the occupation rate are computed. Moreover, the total overtime and the total number of treated patients per year are considered.
In order to be able to compare two different schedules from the point of view of the order of the patients, indicator Ω is defined. This indicator measures the disorder of the patients in the obtained scheduling, so, the smaller it is, the more ordered are the patients. To compute this value, for each time block, an interval [ f i , l i ] is defined. If the preference order of the surgeries scheduled in the time block b i belongs to the interval [ f i , l i ], Ω is not increased. On the contrary, each patient w j with a preference order j outside the interval increases the value of Ω. The formal calculation of Ω is given in Algorithm 1, where N p is the total number of patients scheduled and Pd = N p |B| is the average number of patients scheduled per time block.
Algorithm 1 computes first the lower ( f i ) and upper (l i ) preference orders of the patients that should be ideally scheduled in the time block b i . However, we allow one block before and one block after without any penalization and, for this reason, f i = Pd · (i − 2) and l i = Pd · (i + 1). Then, for all patients scheduled in b i , if their preference order in the waiting list does not belong to [ f i , l i ], Ω parameter is increased with a value depending on the deviation (step 4).

Algorithm 1 Calculation of Ω parameter in a scheduling of |B| time blocks
Input: B, Pd Output: Table 4 shows a comparison between the scheduling obtained by using: (1) the first-fit probabilistic rule (commonly used in hospitals), (2) the batch scheduling approach in [19], (3) the constructive algorithm proposed in [20], and (4) the SHA approach presented in this paper. The scheduling is obtained following the simulation methodology explained in the previous subsection for a minimum confidence level Cl = 70%. The average value of probability of not exceeding the total time, occupation rate, and the order of the patients (Ω) are analyzed. Moreover, the total overtime and the total number of treated patients per year are shown. The three approaches analyzed in Table 4 improve the occupation rates obtained by using the first-fit probabilistic rule. However, the improvement in the occupation rate of the time block implies a decrement in the confidence level. For example, the Batch Scheduling approach [19] achieves the highest occupation rate (79.06%) and the highest number of treated patients (447.78), and, consequently, the lower confidence level (75%) and the highest total overtime (1183[min]) are obtained. Taking into account the pairs of values occupation rate and confidence level, the Batch Scheduling approach obtains the better solution with: (1) the highest occupation rate and (2) a confidence level within the allowed.

Simulation Results
The SHA approach presented in this paper obtains a little worse occupation rate (78.28%) than the Batch Scheduling (79.06%). However, considering the order of the patients given by the indicator Ω, it can be checked that the SHA approach by far obtains the best scheduling (Ω = 395). Medical doctors of the OSD consider that the scheduling obtained using the SHA approach is the best one since it maintains the order of the waiting list better. Due to patients having more orders with SHA scheduling, it is possible to provide an estimation period for the patients in the list and this is a possible extension.

Case Study Results
This section presents a comparison between a scheduling obtained manually in the OSD and the scheduling obtained by using CIPLAN.

Case Study Description
Hospital Description. The HCU is a public hospital located in Zaragoza, Spain providing health services to around 325,000 people, and it is a reference center of specialized attention of a population over 1 million inhabitants. The hospital has 800 beds and 15 ORs for major surgery, which is performed by eight different surgical departments. The case study considers the Orthopedic Surgical Department (OSD).
The OSD is composed of five medical teams and has assigned 3 ORs (OR 1 , OR 2 and OR 3 ) from 8:30 a.m. to 3:00 p.m. every day. Although there are other time blocks available for the department, the case study considers only these three ORs because the other ones have a variable time-table depending on the urgent surgeries. OR 1 and OR 2 are used to perform surgeries of elective patients, while OR3 is assigned to perform urgent surgeries. Table 5 shows an example of the weekly OR time-table of this OSD. According to Table 5, each medical team has two time blocks per week for performing surgeries on the elective patients.
Methodology of the case study. The main objective of the developed software tool is to improve the efficiency and quality of the surgical service. Thus, in the case study, the scheduling obtained manually is compared with the scheduling obtained by using CIPLAN. The methodology is as follows: 1. Analysis of manual scheduling. Considering historical data of one medical team of the OSD, 36 consecutive OR time blocks of elective patients are analyzed. For each time block, the following information is obtained: • the type of surgeries performed, • the starting and ending time of each surgery (real duration), • the expected and real occupation rate, • the confidence level of not exceeding the available time, • the real ending time of each block.
The effective time in a surgery block is the time of using the OR for surgeries; therefore, the occupation rate in a time block is computed as the effective time divided by the total time.
2. Create the waiting list. The manual scheduling and consequently the surgery types in the waiting list are known. However, the preference order of each surgery in the waiting list is unknown. In order to be able to obtain an ordered waiting list from which the scheduling using CIPLAN is performed, it is assumed that the position of the patients (surgeries) in the list corresponds to the order in which they were operated by using the manual scheduling. That is, the first patient in the waiting list is the first patient operated in the first time block. Thus, considering the surgeries performed in the 36 time blocks, an ordered waiting list containing 111 patients is created.
3. Scheduling using CIPLAN. The data necessary to perform the scheduling using CIPLAN are included in the tool and then the scheduling is performed:

•
All elective surgery types are added to CIPLAN including their average duration and standard deviation (computed considering historical data of the team during last two years).

•
A new medical team (team 1) is added to the tool. Moreover, a new doctor is added to the team.
• All patients in the waiting list constructed using the 36 time blocks are assigned to the doctor.

•
For the next three months, two time blocks are booked weekly from 8:30 a.m. to 3:00 p.m., in total being 24 time blocks. • Using CIPLAN, the 24 time blocks previously booked are scheduled considering a minimum confidence level of not exceeding the total time equal to 69%. This value is fixed by doctors.
4. Analysis of the scheduling performed using CIPLAN. For each time block scheduled, the following parameters are obtained: • the expected occupation rate, • the confidence level of not exceeding the total time, • the real occupation rate, • the real ending time.
The scheduling obtained by using CIPLAN has not been applied in practice. Thus, to compute the real occupation rate, the time spent when the surgeries were performed (manual scheduling) has been considered. Moreover, in order to obtain the real ending time, 20 min of cleaning time between two consecutive surgeries and 10 min of delay with respect the starting time have been considered. Figure 4a shows the expected occupation rate in each time block. The average value obtained using CIPLAN (77.44%) is greater than using the manual method (75%). Moreover, in the scheduling obtained using CIPLAN, the values of the expected occupation rate in each time block are more concentrated around the average value (σ = 3.61) than using the manual scheduling (σ = 7.42). In Figure 4b, the real occupation rate obtained in each time block is shown. Again, the average value obtained using CIPLAN (77.86%) is greater than the average value using the manual method (75.03%). Using CIPLAN, the improvement in the occupation rate with respect to use the manual method is 2.83%.

Real Case Study
In Figure 4b, it is also possible to see that using CIPLAN there are some time blocks (1, 2, 23, and 24) with occupation rates too high (about 90%) and could lead to exceeding the available time. This does not happen in manual scheduling. Analyzing the results, it has been observed that it happens because the scheduler (in the manual method) knows the surgery skill of the surgeon and can estimate better the expected duration of the surgery depending on the surgeon. However, the CIPLAN scheduling algorithm initially uses the average duration of the surgeries. These average durations are computed considering historical data, independently from the surgeon. As the tool is used, the time spent in each surgery as well as the surgeon who performs it will be registered in CIPLAN. Thus, the surgery duration will be more and more customized depending on the surgeon and better results will be obtained.
In Figure 4c, the confidence level of not exceeding the available time is shown. The corresponding values are computed by considering the average duration and the standard deviation of each surgery. It can be seen that using CIPLAN does not exist time blocks with a confidence level lower than 69%. However, using the manual method, there are several time blocks with a really low confidence level. For example, in time block 4, the confidence level of not exceeding the available time is only 23.3%. Again, these low values are obtained since the scheduler knows the surgery skills of the surgeon. Particularly, in time block 4, three knee arthroplasties have been scheduled. Considering the average duration and the standard deviation based on historical data, the expected occupation rate is 94.8% and the confidence level that will not exceed the available time is 23.3%. However, the scheduler knows that the surgeon who has to perform the knee arthroplasties needs 25 min less than the average duration of the team. Consequently, the real occupation rate obtained is 73.3% and the time block ends at 13:52. Figure 4d shows the ending time of each block. It can be observed that, using CIPLAN, there are four time blocks (1, 2, 13, and 24) ending around 3:00 p.m. and the time block 23 exceeding the available time 30 min (ending 15:30). This situation does not happen in manual scheduling.
According to the results obtained in the case study, the quality of the service decreases, because some blocks exceed the available time. However, this situation will be solved when the average duration and standard deviation of the surgeries will be customized depending on the surgeon. This customization will allow that the real occupation rate will be more similar to the expected one and, consequently, not only the number of blocks exceeding the available time will decrease, but also the total exceeding time.
In Figure 5, the time execution of the manual (a) and automatic (b) scheduling are shown by two bar-graphs.
Each row is composed by boxes that represent different actions in one surgical time block. Colored boxes represent surgeries while white boxes are idle times. The idle time could be: (i) delay regarding the starting time if the box is at the beginning or (ii) cleaning time if the box is between two surgeries. On the other hand, to check how much the order of patients in the waiting list is respected, the preference order of the patients inside the colored boxes has been included. Since the waiting list of patients has been constructed considering real surgeries, in Figure 5a, the patients are perfectly ordered. However, considering the automatic method (Figure 5b), although the SHA tries to make the scheduling respecting as much as possible, the order of the patients in the waiting list results in being a little disorderly. In order to see it visually, three colors have been used with a different meaning:

•
The patients delayed or advanced at most a time block respect to the manual scheduling (perfectly ordered) are given in green boxes.

•
The patients delayed or advanced two or three time blocks with respect to the manual scheduling are shown in orange or red boxes, respectively. Remember that the waiting list has been constructed considering the real surgeries performed in 36 surgical blocks, obtaining a waiting list composed of 111 patients. Considering the manual scheduling, patients with preference order from 1 to 73 have been scheduled in the first 24 time blocks. Using CIPLAN, patients with preference order from 1 to 76 (except 65 and 71) have been scheduled in 24 time blocks. The number of patients advanced or delayed two time blocks (orange) is 14 while the number of patients advanced or delayed three time blocks (red) is 9. However only three patients (15,18, and 57) have been delayed three time blocks and seven patients (22,25,47,54,58, 60, and 64) have been delayed two time blocks. This means: • 4.05% of the patients are delayed three time blocks with respect to the preference order; • 9.45% of the patients are delayed two time blocks with respect to the preference order.

The Use and Experiences with the Scheduling Software Tool
Medical doctors who have used CIPLAN consider it an intuitive, rapid, and efficient software solution that can make easier the scheduling task. With the manual method, the confidence level of not exceeding the available time is unknown before building the schedule. However, with CIPLAN, they find an important advantage that the input parameter is the confidence level and the tool maximizes the occupation rate respecting this confidence level. Moreover, they said that the time spent for scheduling is drastically reduced, a check of the obtained solution being necessary.
Using CIPLAN, from an economic point of view, the improvement in the occupation rate using the manual method is 2.83%. Only considering the OSD, this 2.83% implies an increment ∆ Oc of 95.65 effective hours per year in the use of the ORs:

Future Work
Doctors propose two new features that could improve significantly the tool. The first one is a new panel to give the possibility of performing virtual scheduling in which all patients included in a waiting list are scheduled. These provisional scheduling will allow doctors to give patients an estimated date of surgery from the moment when he/she is included in the waiting list. On the other hand, the virtual scheduling allows the head of the department to know the number of time blocks necessary to schedule all patients in the waiting list. Thus, he/she will be able to demand from the health administration the exact blocks needed to operate all patients in a certain period of time.
The second feature proposed is to include a new panel in the tool that, once a time block has finished and the starting and ending time of each surgery performed has been introduced in the tool; a comparison between the expected scheduling and the real execution of the time block is shown. In this way, it will be possible to detect the causes of time deviation between the expected and the real durations.

Conclusions
In Spanish hospitals, doctors are responsible for scheduling of elective patients. Currently, this task is performed manually and has three main problems: (i) doctors need to spend their time in the administrative task (scheduling); (ii) usually under or overutilization of the ORs is obtained; and (iii) objectivity can be questioned due to fact that the scheduling is done by a human. This paper presents a Decision Support System (DSS) that uses a specific heuristic algorithm SHA, in order to help the hospital managers in the scheduling of the elective patients.
Considering the duration of the surgeries and of the cleaning time as random variables with normal probability density function, the SHA with some statistics concepts can be used to schedule the elective patients from the waiting list to the next time blocks in such a way that: (i) the occupation rate of the time block is maximized; (ii) ensures a minimum confidence level of not exceeding the available time; and (iii) respect as much as possible the order of the patients in the waiting list. In addition, the DSS also includes features enabling the management of the medical teams and the OR time-table, updating the waiting list of patients, iterative planning, and automatic improvement of the input data.
In collaboration with the Orthopedic Surgery Department of the "Lozano Blesa" Hospital in Zaragoza, a software tool (CIPLAN) based on the proposed DSS has been developed. The preferences and concerns of doctors have been considered not only at the surgery scheduling level, but also at the user interface level. Thus, a friendly interface divided into six main panels is proposed in CIPLAN. It has been developed in Java language and uses a SQL database. Moreover, in order to provide a safe environment to work and better security of the medical data, different access levels are provided to every user.
Finally, in order to check the impact of the software tool in the efficiency and the quality of the surgical service, a case study considering real data from the Orthopedic Department of the HCU has been discussed. The results show that, using CIPLAN, an improvement in the occupation rate of the ORs can be reached.
However, it has been observed that there are significant differences in the surgery duration depending on the experience and on the surgery skill of the surgeon. Thus, if the SHA works with general average duration, over and under occupation rates are obtained more frequently than if it works with customized data. It would be convenient to customize the data of the surgical durations depending on each specific surgeon. In this way, the expected occupation rate and the expected ending time will be more similar to the real ones improving the quality of the service.
As future work, a new panel in CIPLAN can be developed that, once a time block has been finished, allows doctors to compare in a visual way the expected scheduling and the real execution. On the other hand, a new feature in CIPLAN can be included that enables them to perform virtual scheduling in which all patients in the waiting list are scheduled. In this way, an approximated date could be given to patients from the moment when they are included in the system. Moreover, other extensions can be developed-among others, an app connected to CIPLAN allowing patients to know the approximated date of their surgeries.

Patents
The developed software tool has been registered by the Office of Transfer of Research Result (OTRI) at the University of Zaragoza.
Author Contributions: All authors contributed to the design of the mathematical model and the conceptual design of the decision support system. J.A. was responsible for collecting the necessary surgical data to analyze the mathematical models and perform the case study. D.C., C.M., and M.S. were involved in the development of the proposed heuristic method as well as the implementation of the DSS. All authors have read and agreed to the published version of the manuscript.
Funding: This work has been partially supported by CICYT-FEDER (Spain-EU) under Grant DPI2014-57252-R and by the Aragonese Government (Spain).

Acknowledgments:
We would like to acknowledge with much appreciation Lidia Castan's help in the collection of the necessary surgical data.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: