Skip to content

The-Strategy-Unit/intermediate_care_analysis_NDL

Repository files navigation

Use of Community Services After Hospital Discharge

This repository contains the code for a project carried out by the Strategy Unit on behalf of the Networked Data Lab team at the Health Foundation. The project seeks to understand patients' use of community services after hospital discharge in England.

The resulting report from this analysis can be found on the Strategy Unit's Posit Connect server.

The analysis draws upon two key datasets: the Community Services Dataset and the Admitted Patient Care (Spells) dataset.

The analysis is composed of the following components:

  1. The identification of patients receiving step-down intermediate care. This involves applying an agreed set of identification rules, agreed with the Health Foundation, to the raw datasets.

  2. A description of step-down intermediate care packages (number, service intensity, delivery mode, provider type etc) and changes in the frequency of these packages over time.

  3. A description of the characteristics of patients receiving intermediate care, inclusing their demographic characteristics (age, sex, deprivation of area of residence, ethnicity, region), the clinical features of the admission that led to their use of intermediate care (admission method, treatment function, ICD10 chapter of primary diagnosis) and whether they received community services before admission.

  4. An analysis of the factors that influence whether a patient receives a step-down intermediate care packages following a hospital dischrage and the intensity of that package.

  5. A summary of the progress and outcomes of step-down intermeidate care recipients (hospital length of stay, changes in service intensity over the course of the care package, hospital readmissions, mortality).

  6. An exploration of the impact of using alternative rules to identify step-down intermediate care, on the key components of the analysis above.

Running the code

This code was written and is design to be executed within the National Commissionning Data Repository environment.

Initial setup

In a terminal window at the project root (e.g. from the terminal tab in RStudio) run:
powershell .\create_project_directories.ps1
If you get an error about running scripts being disabled on this system instead you can temporarily disable them:
powershell -executionpolicy remotesigned
Now you can run the script with .\create_project_directories.ps1

Data extraction

The script sql\create_tb_distinct_nhs_nos.sql creates a table of pseudonymised NHS numbers for people who have both a relevant hospital admission and a community services contact within the study period.

The scripts R\get_admissions.R and R\get_csds.R extract relevant event-level data from the SUS Admitted Patient Care and Community Services Dataset tables and saves these as parquet files.

Data processing

The following scripts process the parquet files from the step above, applying the (primary analysis and sensitivity analysis) rules to identify step-down intermediate care packages and the patients who receive them.

  • R\x01_create_admissions_datasets.R

  • R\x02_create_contacts_datasets.R

  • R\x03_define_icare_records.R

  • R\x04_create_analysis_datasets.R

  • R\x05_lookup_nearby_contacts.R

  • R\x06_create_nzlos_analysis_dataset.R

Data analysis

The core analysis is carried out in four files using the analysis datasets produced in the previous step. Each produces both tables and visual outputs.

  • R\B SDIC characteristics.R describes the packages of step-down intermediate care that patients receive.

  • R\C SDIC patient characteristics.R describes the patients receiving these services.

  • R\D Factors influencing package receipt and intensity.R creates and explores two regression models which explore the factors that influence who gets a step-down intermediate care package and the intensity of these packages.

  • R\E Sensitivity analysis.R explores whether the headline figures in the above analysis are sensitive to variations in the rules used to identify step-down intermediate care.

Producing the report

The quarto report, and associated data sheet can be produced without (or with!) running other scripts. Details of what files are needed to produce the report can be found in R\produce_quarto.R.

About

An analysis of patient access to community services after hospital discharge. Project code: 1189.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages