Downloads hospital admissions by Hospital trust using download_trust_data and then optionally aggregates to either LTLA or UTLA level. This can be done either with the built in mapping or a user supplied mapping.

get_admissions(
  keep_vars = "new_adm",
  level = "trust",
  release_date = Sys.Date(),
  mapping,
  geo_names
)

Arguments

keep_vars

Character string, defaulting to "new_adm" (first-time COVID-19 hospital admissions). Defines which variables to keep from the raw data. Other supported options are: "all_adm" (for all COVID-19 hospital admissions), and "all_bed" (for all COVID-19 beds occupied). Multiple values allowed.

level

Character string, defaulting to "trust". Defines the level of aggregation at which to return the data. Other supported options are "utla" for UTLA level admissions or "ltla" for LTLA level admissions.

release_date

Date, release date of data to download. Will automatically find the Thursday prior to the date specified.

mapping

A data.frame containing geo_code, trust_code, p_geo and p_trust.

geo_names

A data.frame containing geo_code and geo_name. Used to assign meaningful to geographies.

Value

A data.frame of daily admissions and/or bed occupancy data, reported at the Trust, LTLA or UTLA level. Note that new admissions ("new_adm") are called "admissions" in the data.frame to be consistent with a previous version of this function.