Skip to contents

Creates a waiting list using the parameters specified

Usage

create_waiting_list(
  n,
  mean_arrival_rate,
  mean_wait,
  start_date = Sys.Date(),
  limit_removals = TRUE,
  sd = 0,
  rott = 0,
  ...
)

Arguments

n

Numeric value of rate of demand in same units as target wait

  • e.g. if target wait is weeks, then demand in units of patients/week.

mean_arrival_rate

Numeric value of mean daily arrival rate.

mean_wait

Numeric value of mean wait time for treatment/on waiting list.

start_date

Character value of date from which to start generated waiting list.

limit_removals

Defaults to TRUE

sd

Numeric value, standard deviation. Defaults to 0.

rott

Numeric value, proportion of referrals to be randomly flagged as ROTT. Defaults to 0.

...

Container for the list

Value

A tibble of a random generated list of patients with addition_date, removal_date, wait_length and rott status for each patient

Examples

create_waiting_list(366,50,21,"2024-01-01",10,0.1)
#> # A tibble: 18,120 × 5
#>    pat_id addition_date removal_date wait_length rott 
#>     <int> <date>        <date>             <dbl> <lgl>
#>  1      1 2024-01-01    2024-01-10         8.74  FALSE
#>  2      2 2024-01-01    2024-01-09         7.91  FALSE
#>  3      3 2024-01-01    2024-01-02         0.702 FALSE
#>  4      4 2024-01-01    2024-01-16        15.1   FALSE
#>  5      5 2024-01-01    2024-01-11         9.70  FALSE
#>  6      6 2024-01-01    2024-02-03        33.5   FALSE
#>  7      7 2024-01-01    2024-02-13        42.7   FALSE
#>  8      8 2024-01-01    2024-01-17        16.0   FALSE
#>  9      9 2024-01-01    2024-01-11         9.82  FALSE
#> 10     10 2024-01-01    2024-01-10         9.47  FALSE
#> # ℹ 18,110 more rows