1 Quick Overview

Live app: https://n-garner.shinyapps.io/nhs-wait-times-explorer/

Code & data pipeline: https://github.com/N-Garner/NHS-wait-times-explorer

Doc site (this page): https://n-garner.github.io/NHS-wait-times-explorer/

This project maps routine GP appointment waits (days) and elective hospital Referral To Treatment (RTT) waits (weeks) by Integrated Care Board (ICB) and acute Trust in England. It helps patients, clinicians, and commissioners explore where access to care is faster or slower.


2 Why I built this

Living with and managing chronic conditions means that continuity and timeliness of care really matter. Getting a GP appointment and/or a specialist referral quickly can be the difference between a minor flare‑up and an emergency hospital admission. Picking a GP with low waiting times within the catchment area of an Integrated Care Board and acute Trust with shorter referral to treatment (RTT) wait times can substantially speed up access to diagnostics and treatment.

While all of the data used in this project is available publicly, garnering this information as an individual is time consuming and requires the ability to handle and interpret large health-related data sets. I built an easy-to-use shiny app that enables anyone to quickly understand their likely referral to treatment times across England for the main healthcare specialty areas, and to find a general practice (GP) within each ICB with low wait times for general consults.

This tool:

  • Shows where wait times are shortest and longest by specialty (treatment function).
  • Lets you switch heat map views between median waits, 95th percentile wait, or % of patients seen within 18 weeks of waiting.
  • Highlights GP practice wait times so people can search and compare primary care access.

3 What’s in the app

3.1 Data layers

  • ICB / Trust heatmaps (elective RTT waits). Acute trusts (hospitals) do not have a defined catchment area, instead this shows an estimated NHS Acute Trust catchment area by elective hospital admissions created by the Office for Health Improvement and Disparities (OHID) in 2022.
  • GP markers (average wait for routine GP appointments, in days).

3.2 Interactions

  • Toggle ICB vs Trust polygons (one at a time).
  • Pick a heatmap metric (Median / 95th / %≤18w).
  • Show/hide GP practices, filter by median wait time.
  • Search for GP names.
  • Pop‑ups on click; “Reset view” button.
  • Collapsible “How to use & Interpretation & Licensing” sections.

4 Data pipeline (summary)

Full code lives in scripts/. High-level steps:

  1. GP appointments (NHSE “Appointments in General Practice” - March to May 2025)
    • Only Attended appointments wait times were kept.
    • Restricted appointment types to “General Consultation Routine” and “Walk‑in”.
    • Dropped appointments where the wait time was “Unknown / Data Issue”.
    • Converted wait time bands to mid‑points (e.g. seen between 2–7 days to 4.5 days); computed weighted mean & SD per practice.
    • Joined to epraccur & ONS Postcode Directory for postcodes and Lat / Long coordinates.
  2. Hospital RTT waits (NHS England monthly “Full CSV” files, January to May 2025)
    • Utilised waiting time data only from Completed Pathways for Non‑Admitted Patients.
    • Reshaped week bands data and calculated median wait, 95th percentile wait and % of patients seen within 18 weeks for each Provider Parent (ICB) & Provider (Trust).
  3. Geographies
  4. Outputs
    • Saved as RDS in output_data/: appointment_data.rds, nhs_wait_icb.rds, nhs_wait_trusts.rds.

5 Data suppression & interpretation

5.1 Suppression rules

  • All data is publicly available and provided as a de-identified aggregate, therefore no additional data suppression was applied.

5.2 Reading the colours

  • Median & 95th percentile waits: darker = longer waits.
  • % within 18 weeks: reversed scale; darker = lower % of patient seen within 18 weeks.

These are aggregated stats, not individual waits. They indicate system performance, not guaranteed personal wait times.


6 Manual download step (Trust shapefile)

One dataset cannot be scripted (hosting/licence):

1. Open: https://app.box.com/s/qh8gzpzeo1firv1ezfxx2e6c4tgtrudl/folder/170910088405
2. Download the ZIP containing “2022Elective_FPTP_Full”
3. Extract into: C:\Users\Nick\Documents\GitHub\NHS-wait-times-explorer\site_src\output_data\2022Elective_FPTP_Full

The app stops with a helpful error if these files are missing.


7 Reproduce locally

7.1 Clone & restore packages

git clone https://github.com/N-Garner/NHS-wait-times-explorer
cd nhs-wait-times-explorer
renv::restore()

7.2 Run the data pipeline

source("scripts/load_and_transform.R")

(Or drop prebuilt RDS files into output_data/.)

7.3 Launch the app

shiny::runApp("app")

8 Deploying the Shiny app

  • shinyapps.io: rsconnect::deployApp("app")
  • Posit Connect / Shiny Server: copy the app/ folder; ensure output_data/ is available or regenerated.

9 Licensing

  • Code: GNU GPL v3.0 (see LICENSE).
  • Data & derived summaries: Open Government Licence v3.0 (see LICENSE-OGL-DATA.md).
    Please credit NHS England / NHS Digital / DHSC when re‑using.

10 Preview screenshots

Median RTT wait times by ICB for dermatology services around London, overlayed with individual GP wait times

Percent of patients seen within 18 weeks for gynaecology services across England by ICB region

95th percentile RTT wait times (95% of patients seen within x weeks) by acute trust for gynaecology services across south London.

A view of average GP wait times across England when GP markers are not clustered, with median wait times for all treatment specialties averaged by ICB in the background.