Code for bed occupancy and patient pathway analyses
Peer-reviewed paper available here.
Corresponding author: Quentin Leclerc, quentin.leclerc@lshtm.ac.uk
The following datasets are in the "/data" folder:
average_los_by_pathway_X
: average LoS and standard deviation for each stage in all identified full bed pathways, either for UCH or CO-CIN. "ALT" indicates this contains median and IQR estimates.average_los_by_outcome_X
: average LoS and standard deviation by bed type, either for UCH or CO-CIN. "ALT" indicates this contains median and IQR estimates.pathways_all_cocin
: the complete LoS distribution for CO-CIN full bed pathways, saved as an R object that can be used directly with the model.uk_hospital_data
: bed occupancy data for England. This is extracted from the publicly available UK COVID dashboard.uk_hospital_data_nhstrust
: bed occupancy data for England, by NHS Trust. This is extracted from the publicly available UK COVID dashboard.uclh_occupancy
: bed occupancy data for UCH.data_figs
: a simplified dataset of the full bed pathways for UCH and CO-CIN, used to generate Figure 1 in our paper.nhstrusts
: a list of NHS Trusts, used for data extraction.trust_to_region
: a conversion table to regroup NHS Trusts by NHS Regions.
The "raw_cocin" subfolder contains the raw CO-CIN distributions for each stage in each bed pathway.
The "/code" folder contains the following scripts:
core_model_functions
: the function used to run the model, a wrapper function used for multiple runs, and a plotting function.paths_table_to_blocks
: script used to convert the LoS datasets in "/data" to R objects that can then be used with the model.cocin_data_to_pathways_block
: script used to convert the raw distributions in the "data/raw_cocin" folder to R objects that can then be used with the model.cocin_data_to_paths_table
: script used to convert the raw distributions in the "data/raw_cocin" folder to generate the tables that can be seen in our paper.import_hosp_data
: script used to extract data from the UK COVID dashboard.import_hosp_data
: script used to extract data from the UK COVID dashboard, at the NHS Trust level.
In the root of the directory, the following Rmd files are used to generate all the analysis for our paper:
pathways_paper_run_model
: runs the model for all the scenarios considered in our paper (UCH, England, NHS Regions etc...).pathways_paper_fitting
: runs the model to find the best-fitting LoS values by bed type for each NHS Region (see our paper for details).pathways_paper_fitting_nhstrust
: runs the model to find the best-fitting LoS values by bed type for each NHS Trust (see our paper for details).pathways_paper_explore
: uses the results produced by the first two Rmd files to generate all of the figures and tables included in our paper.
NOTE: the Rmd files used to generate results take several hours to run! This is due to the extremely large number of patients in the England dataset. If you wish to run these files quickly to check reproducibility, we recommend reducing the number of model runs at the England and NHS Regions level from 100 to 5.
The "/outputs" folder contains the saved results generated by the Rmd reports.
The subfolder "/results" contains model results generated by the pathways_paper_run_model
and pathways_paper_fitting
reports.
The subfolder tables contains the fitted LoS values generated by the
pathways_paper_fitting
report.
The subfolder "/figures" contains figures generated by the pathways_paper_explore
report.
This work is distributed under the MIT license (see LICENSE file).