Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RTT data for Northern Ireland & Updated docs #23

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,9 @@ NULL
#' \item{specialty}{Specialty}
#' \item{waits_over_18_weeks}{Total waiting > 18 weeks}
#' \item{waits_over_52_weeks}{Total waiting > 52 weeks}
#' \item{total_waits}{Total waits}
#' }
#' @source \url{https://www.health-ni.gov.uk/}
#' @source \url{https://www.health-ni.gov.uk/topics/doh-statistics-and-research/hospital-waiting-times-statistics}
"ni_rtt_hsct"

#' Bed occupancy/availability in Scotland
Expand Down
10 changes: 9 additions & 1 deletion data-raw/ni-rtt.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ ni_outpatient <- read_csv("https://www.health-ni.gov.uk/sites/default/files/publ
)
)

# ---- Wrangle 2019, 2020 and 2021 data ----
# ---- Wrangle data since 2019 ----
# Patients waiting for admission to a Day Case Procedure Centre (DPC) are
# included in these statistics.As these services are managed on a regional
# basis, patients are not allocated as waiting at a particular HSC Trust, but
# instead reported separately against DPC's
ni_inpatient_sum <-
ni_inpatient |>
mutate(
Date = dmy(`Quarter Ending`),
Month = month.abb[month(Date)],
Year = year(Date)
) |>
mutate(`HSC Trust` = case_when(
`HSC Trust` == "DPC" ~ "Day Case Procedure Centre",
TRUE ~ `HSC Trust`
)) |>
filter(Year >= 2019) |>
select_if(~ !all(is.na(.))) |>
group_by(`HSC Trust`, Year, Month, Specialty) |>
Expand Down
Binary file modified data/ni_rtt_hsct.rda
Binary file not shown.
3 changes: 2 additions & 1 deletion man/ni_rtt_hsct.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.