Methodology
How we calculate the numbers
Every figure on this site is reproducible from publicly available NHS data. This page documents exactly how.
What data we use
We ingest NHS England's monthly Referral to Treatment (RTT) Full CSV extract — the same file that journalists and analysts download directly from NHS England's RTT page.
The file contains ~180,000 rows per month, with each row representing a (provider × commissioner × specialty × pathway type) combination. For HospitalWaits we filter to Incomplete Pathways (patients still waiting) and aggregate across commissioners so each (trust × specialty) appears once.
Currently displaying data through February 2026. Refresh runs the second Thursday of each month, ~4 days after NHS publication.
How median wait is calculated
NHS England publishes the wait-time distribution in weekly bands (0–1 weeks, 1–2 weeks, … up to 104+ weeks). The median is not pre-calculated; we compute it.
For each (trust × specialty) row:
- Sum patients across all weekly bands to get the total list size
- Walk the cumulative distribution from week 0 upward
- The first band where cumulative count crosses 50% is the median
- We report the lower bound of that band (conservative)
Example: if 4,500 of 9,000 patients have waited ≤14 weeks and 5,200 have waited ≤15 weeks, the median is reported as 14 weeks.
How % within 18 weeks is calculated
We sum patients in bands 0 through 17 (i.e., everyone in their first 18 weeks of waiting), divide by the total list size, and round to one decimal place. This matches the NHS's own 18-week standard.
How distance is calculated
Trust postcodes come from the NHS Organisation Data Service (ODS) API. Postcodes are geocoded via postcodes.io.
Distance from your postcode to each hospital is computed by PostgreSQL with the PostGIS extension using ST_Distance(geography, geography) — a true geodesic calculation, not Pythagorean. Distance is displayed in miles.
Specialties we display
We display the 18 user-facing NHS Treatment Function Codes (TFCs) that have meaningful patient demand and are clearly named. We exclude:
- C_999 (Total) — the cross-specialty sum
- X02–X06 (Other ...) — heterogeneous catch-all buckets that wouldn't help patients searching for a specific procedure
Independent Sector providers
Some providers in the data are Independent Sector (private) hospitals taking NHS-paid patients under contract. They appear in the search alongside NHS Trusts because they're real options for patients via the NHS Constitution. These are labelled "NHS via independent" on the result card.
Note: these are different from the private alternatives shown below the main results, which are paid-private options outside the NHS pathway.
Known limitations (V1)
- National-average trend line on trust × specialty pages currently shows the average of per-trust medians (a proxy). The true patient-weighted national median requires aggregating weekly bands across all trusts; planned for V1.1.
- CQC ratings + Friends & Family Test scores are scheduled for V1.1.
- 27 of 538 providers in the dataset have no postcode in ODS and are excluded from distance-based search.
- Independent Sector flag currently uses an ods_code prefix heuristic (~40 may be mislabelled). Authoritative ODS role-parsing planned for V1.1.
Data freshness
The data shown is typically 6–8 weeks behind real time due to NHS England's publication schedule. Individual waiting times may vary significantly from the medians shown depending on clinical priority, capacity changes, and other factors.
Reproducibility
Our pipeline code (Python) is in a private GitHub repo. Open-sourcing planned post-launch — if you'd like access for research or verification, please contact Dr Ghafouri.