Our ‘system’ of impacts is a high-level simplification of the following components:
Using a systems dynamic approach our aim is to map the flows between and through these different stocks and simulate the potential impacts and demand over a 2 year period.A conceptual model was agreed with Mersey Care and a design workshop enabled us to map local service provision against the likely effects of the COVID-19 pandemic and associated lockdown policies.
Whilst our system model is highly simplified, we need to apply variables that make the pathways within them behave as close to reality as possible. The diagram below shows one example of how this has been deployed and explains the nature of each variable that determines a flow rate or direction. The final model has multiple impacts and multiple service lines flowing from each population.
Example of a single pathway
A judgement on the likely inflow rate of patients to becoming symptomatic.
Determined where possible by published evidence e.g. 16% of unemployed people will experience depression. Effectively the number of referrals
Based on empirical data from MHSDS and IAPT datasets, the historic % of referrals that are offered a service.
As agreed with Mersey Care reference group, the %‘s of each condition that are likely to flow to each service line. Effectively the patients ’in service’.
A decay function to move people out of services. Based on MHSDS data –the month that 50% of patients are discharged.
Based on empirical data from MHSDS and IAPT datasets, the re-referral rates (<12 months of service discharge) or ‘reliable improvement’ for each service line.
Based on Mersey Care PAS system, an average contact rate per patient per month per service. Used to convert patient throughputs to operational information.
All of the population groups, conditions and services are combined and run together.
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(mhSurgeModelling)
Loading the package should attach a variable called params. We can run the model using the run_model()
function. This takes two arguments, params
and sim_time
. This value determins how often the model should be evaluated at. If you set sim_time = 1
you will have a row for each month. Setting it to smaller values allows you to draw smoother charts, but it does not give a value that can be intepreted for individual days in the month.
m <- params %>%
run_model(1) %>%
# get_model_output is a helper function to convert the "time" variable to a date
get_model_output(start_month = lubridate::ymd("2020-05-01"))
# show some rows of data as an example
m %>%
tidyr::drop_na() %>%
filter(time == 6) %>%
head() %>%
knitr::kable()
time | date | type | group | condition | treatment | value |
---|---|---|---|---|---|---|
6 | 2020-11-01 | treatment | Children & young people | Anxiety | 24/7 Crisis Response Line | 119.2466 |
6 | 2020-11-01 | treatment | Children & young people | Anxiety | Child & Adolescent Mental Health | 248.8951 |
6 | 2020-11-01 | treatment | Children & young people | Anxiety | Crisis Resolution Team/Home Treatment Service | 261.6321 |
6 | 2020-11-01 | treatment | Children & young people | Anxiety | General emergency phone lines | 704.3909 |
6 | 2020-11-01 | treatment | Children & young people | Anxiety | General Practice | 1043.3723 |
6 | 2020-11-01 | treatment | Children & young people | Anxiety | IAPT | 1837.5832 |
Running the model returns a tibble, with one row for each population group, condition and service for each point in time and “type”. The “type”’s are:
stocks
at-risk
: the people who have entered the model (1. in the diagram above) and could move into a treatment
group, or into the no-mh-needs
grouptreatment
: the number of people who have been moved from the at-risk
groupno-mh-needs
: the people who have been assigned to the “no mental health needs” group, e.g. people who have flowed through and out of the modelflows
new-at-risk
: the number of people who have moved into the at-risk
group this monthnew-referral
: the number of people who were referred because of a condition this monthnew-treatment
: the number of people who started treatment this month