nhs_pathways_covid19: Potential COVID19 cases reported through NHS pathways

Description Usage Format Author(s) Source Examples

Description

This dataset contains daily numbers of reports on potential COVID-19 cases reported in England through the NHS pathways. This data is used for illustrative purpose, and was last updated on 1st June 2020. See example for a command line allowing to download the latest version.

Usage

1

Format

A data.frame containing:

site_type

the system through which data were reported: 111/999 calls, or 111-online

date

the data of reporting

sex

the gender of the patient

age

the age of the patient, in years

ccg_code

NHS code for the Clinical Commissioning Groups (CCGs) (finer geographic unit)

ccg_name

name of the Clinical Commissioning Groups (CCGs) (smaller spatial unit)

count

number of potential COVID-19 cases reported

postcode

the postcode of the CCG

nhs_region

the NHS region (larger geographic unit)

day

the date as the number of days since the first reporting day

weekday

the day of the week, broken down into: weekend, Monday, and the rest of the week; this is used for modelling reporting effects

Author(s)

National Health Services (NHS) for England. Additional data and cleaning by Quentin Leclerc.

Source

Data is available at https://digital.nhs.uk/dashboards/nhs-pathways; this precise dataset adds some cleaning and additional informaion (on NHS regions) and is taken from Quentin Leclerc's github repository: https://github.com/qleclerc/nhs_pathways_report

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
# These commands will download the latest version of the data:
library(tidyverse)

# download data
pathways <- tempfile()
url <- paste0("https://github.com/qleclerc/nhs_pathways_report/",
              "raw/master/data/rds/pathways_latest.rds")
download.file(url, pathways)
pathways <- readRDS(pathways)


# add variables and subsets
day_of_week <- function(date) {
  day_of_week <- weekdays(date)
  out <- dplyr::case_when(
    day_of_week %in% c("Saturday", "Sunday") ~ "weekend",
    day_of_week %in% c("Monday") ~ "monday",
    TRUE ~ "rest_of_week"
  )
  out <- factor(out, levels = c("rest_of_week", "monday", "weekend"))
  out
}

pathways <- as_tibble(pathways) %>%
  mutate(nhs_region = stringr::str_to_title(gsub("_", " ", nhs_region)),
         nhs_region = gsub(" Of ", " of ", nhs_region),
         nhs_region = gsub(" And ", " and ", nhs_region),
         day = as.integer(date - min(date, na.rm = TRUE)),
         weekday = day_of_week(date))

## End(Not run)

reconhub/epichange documentation built on April 28, 2021, 2 p.m.