knitr::opts_chunk$set(eval = FALSE, echo = TRUE, message = FALSE) pacman::p_load( magrittr, dplyr, knitr, kableExtra )
To create a public (anonymised) mapping between lower- or upper-tier local authorities and Acute NHS Trusts in England based on COVID-19 hospital admissions data.
We make mappings based on two data sources: Secondary Uses Service (SUS) healthcare data for England, and linked COVID-19 cases and admissions. The steps taken to make each mapping are summarised below; see data-raw/make_mappings.R
for full details.
Mappings are derived from a raw mapping provided by NHS England, based on the Secondary Uses Service (SUS) healthcare data for England. This raw mapping counts the number of COVID-19 hospital spells (discharges) between 01 January 2020 and 30 September 2020 from NHS hospitals to lower-tier local authorities (LTLAs). To make the public mappings, we:
p_geo
, the proportion of all admissions from a given LTLA (or UTLA) that were admitted to a given Trust, and (ii) p_trust
, the proportion of all admissions to a given Trust that were admitted from a given LTLA (or UTLA).Mappings are derived from COVID-19 cases and hospital admissions linelist data linked via a case ID. The case data includes the following variables: case ID, age, sex, resident LTLA, residence type (residential, HMO, care home, medical facility, prison, other, unknown), test specimen date. The hospital admissions data includes the following variables: case ID, age, sex, specimen date, NHS Trust, Trust type (acute, independent, mental health, community), admission date, discharge date. To make the public mappings, we:
p_geo
, the proportion of all admissions from a given LTLA (or UTLA) that were admitted to a given Trust, and (ii) p_trust
, the proportion of all admissions to a given Trust that were admitted from a given LTLA (or UTLA).The mapping includes the following local authority (LA) mergers that have taken place since January 2020:
hospitalcatchment.utils::la_changes %>% filter(substr(la_level, 1, 1) == "E", from_date > as.Date("2019-12-31")) %>% mutate(Change = ifelse(is.na(la_code_new), "Abolished", "Merged")) %>% arrange(from_date, la_code_new) %>% select(`Old LA code` = la_code, `New LA code` = la_code_new, Change, `Date effective` = from_date)
The mapping includes the following Trust mergers that have taken place since January 2020:
hospitalcatchment.utils::download_nhs_mergers() %>% filter(!(org_code_old == "RW6" & org_code == "R0A")) %>% select(`Old Trust code` = org_code_old, `New Trust code` = org_code, `Date effective` = date_effective) %>% kable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.