Appendix B: Sampling plan for the resident assignment model This section describes how an individual scenario is generated for the resident assignment model. The anticipated components in the model are the durations of both known and anticipated surgeries. Unknown future diagnoses, surgeries, and follow-ups must also be included in a sample. The completion of a patient’s events could happen at any time in the future, but our samples only include events happening until the end of the anticipation period. To generate the events that will occur in the coming anticipation period, consider three schedules which run from the current decision epoch to the end of the anticipation period: the clinic schedule, the operating room schedule and the inpatient consultation schedule. These schedules are similar to actual schedules the hospital uses and are used for establishing model data for known and anticipated diagnoses, surgeries and follow-ups as well as their start and end times. The following list of steps, summarized in Table B1 describe how these three schedules are populated. These schedules can be translated into assignment model data. Step 1: For each patient who has had surgery and been discharged, if the scheduled follow-up appointment falls before the next decision epoch, the appointment will be added to the clinic calendar. In terms of the assignment model, the data and variable(s) corresponding to the known follow-up will be added. Step 2: For each patient who has had surgery but not yet been discharged, for each scenario a random variate will be generated that gives the date and time of the follow-up appointment. The date is generated according the distribution that best fit the postoperative time lags observed in data, which is an Erlang-4 distribution with a mean of 21.4 days. If the date falls before the end of the anticipation period, the appointment will be added to the clinic calendar. In terms of the assignment model, for the given scenario the data and variable(s) corresponding to the anticipated follow-up will be added. 1 Step 3: For each patient who has been diagnosed in the past, the patient’s scheduled surgery will be added to the surgical calendar if it falls before the next decision epoch. In terms of the assignment model, the data and variable(s) corresponding to the known surgery will be added. For each known surgery added, a random variate will be generated that gives the date and time of the follow-up appointment. If it falls before the end of the anticipation period, the appointment will be added to the clinic calendar in a randomly generated time slot. The data and variable(s) corresponding to the anticipated follow-up will be added when solving the assignment model. When a procedure is added to the surgical calendar for a given data, the start time must also be determined. The details of how this is done are included in step 8. Step 4: Between the current and the next decision epoch, some inpatient consultations may be known. These translate to known diagnosis data for the assignment model. For each of these consultations, the date and type of surgery will be generated for each scenario. The date of the surgery is generated from observed statistics, the preoperative time lag being drawn from a log-normal distribution with a mean of 15.8 and standard deviation of 21.3. The type is generated based on the proportions of each type of surgery observed. If a surgery falls before the end of the anticipation period, an anticipated surgery will be added to the surgery calendar. For the given scenario, a random variate will also be generated corresponding to the date of the anticipated follow-up. If the follow-up date is before the end of the anticipation period, a random variate will be generated to determine the clinic slot in which the follow-up will occur. Step 5: Known outpatient clinic diagnoses will be added for the current decision epoch just as known consultations were added. If these result in anticipated surgeries and follow-up appointments that fall before the end of the anticipation period, they will be added as well. Step 6: For each scenario, for each day starting at the current decision epoch until the end of the anticipation period, consultations will be generated based on the average number 2 done per day. These are generated from the Poisson distribution with mean 2.33. For each consultation generated, surgical dates and types and follow-up dates will be generated. If they fall before the end of the anticipation period, the corresponding data will be included in the assignment model. Step 7: For each scenario, each unfilled clinic slot on the clinic calendar, starting at the current decision epoch until the end of the anticipation period, an outpatient diagnosis will be generated. Surgical dates and types and follow-up dates will be generated as with the consultations in step 6. If they fall before the end of the anticipation period, the data will be included in the assignment model. Step 8: The start and end times of each surgery on the surgery schedule must be determined. If a single operating room is used, the start time of each procedure can be determined by generating durations of each procedure. If multiple operating rooms will be used, this can become more complicated. A rule must be used for determining how procedures are to be added. Here we have assumed that two ORs are available. The procedure will be added to the room with the earliest expected availability. Once the sequence has been determined, random the start and end times of each known and unknown procedure are generated for each scenario. When fitting distributions to the observed duration types, the log-logistic distribution was often one of the best choices, as Table 1 in the manuscript shows. The surgery schedule assumes that two operating rooms will run simultaneously. The first two surgeries of each day start at 7:30am. The start time of each subsequent surgery on the schedule is 30 minutes after the end time of the surgery in the room which becomes available first. All of these steps are taken to generate a scenario. If scenarios are generated according to their likelihoods, then the SAA approximates the expected value of the resident assignment model. Determining the joint distribution of all the random variables in the 3 model is very difficult. Adding events to the three schedules described is an attempt to generate scenarios in a realistic way using as much of the data collected as possible. Step 1 Add the known follow-up for each discharged patient. Step 2 For each scenario, generate an anticipated follow-up for each un-discharged patient. Step 3 For each scenario, generate an anticipated surgery for each diagnosed patient. Step 4 Add the known consultation diagnoses. Generate corresponding surgeries and follow-ups for each scenario. Step 5 Add the known clinical diagnoses. Generate corresponding surgeries and follow-ups for each scenario. Step 6 For each scenario, generate consultation diagnoses and corresponding surgeries and follow-ups for each day in the anticipation period. Step 7 For each scenario, generate clinical diagnoses and corresponding surgeries and follow-ups for each open clinic slot in the anticipation period. Step 8 For each scenario, generate start and end times of each surgery on the surgical schedule. Table B1 – Summary of steps in the sampling plan 4