Creates a simulated waiting list comprising referral dates, and removal dates
wl_simulator(
start_date = NULL,
end_date = NULL,
demand = 10,
capacity = 11,
waiting_list = NULL,
withdrawal_prob = NA_real_,
detailed_sim = FALSE
)
A data.frame
simulating a waiting list, with columns:
Date. The date each patient was added to the waiting list.
Date. The date each patient was removed from the waiting
list (may be NA
if unscheduled).
If detailed_sim = TRUE
, returns a more detailed
data.frame
with the following additional
fields:
Date. The date the patient withdrew from the waiting list.
Numeric. Waiting list priority level, from 1 (most urgent) to 4 (least urgent).
Numeric. Target number of days the patient should wait at the assigned priority level (e.g., 28 days for priority 2)
Character. Patient name in the format
"Last, First"
.
Date. Date of birth.
Integer. Patient identifier, up to 100,000,000.
Character. One-letter code representing the specialty of the procedure.
Character. Full name of the specialty associated with the procedure.
Character. OPCS-4 code of the selected procedure.
Character. Name of the selected procedure.
Character. Consultant name in the format
"Last, First"
.
Date or character (in format 'YYYY-MM-DD'); The start date to calculate from
Date or character (in format 'YYYY-MM-DD'); The end date to calculate to
numeric. Weekly demand (i.e., typical referrals per week).
numeric. Weekly capacity (i.e., typical removals per week).
data.frame. Waiting list where each row is a pathway/patient with date columns 'Referral' and 'Removal'.
numeric. Probability of a patient withdrawing.
logical. If TRUE, simulation provides detailed output.
over_capacity_simulation <-
wl_simulator("2024-01-01", "2024-03-31", 100, 110)
under_capacity_simulation <-
wl_simulator("2024-01-01", "2024-03-31", 100, 90)
Run the code above in your browser using DataLab