Code Monkey home page Code Monkey logo

covid_bed_occupancy's Introduction

COVID_bed_occupancy

Code for bed occupancy and patient pathway analyses

Pre-print available here.

Corresponding author: Quentin Leclerc, [email protected]

Datasets

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.

Code

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.

Reports

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.

Outputs

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.

License

This work is distributed under the MIT license (see LICENSE file).

covid_bed_occupancy's People

Contributors

qleclerc avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.