Why I made this
I have two elderly parents, and both of them depend heavily on the health service. Recently I have seen first hand the pressure that A&E units and hospital beds are under: what the numbers in this story look like when it is your own family waiting.
When I saw The Data Lab's Community Data Visualisation Competition, I felt compelled to enter. Not because I thought I had the answer, but to see whether my skills, and AI, could in some way help build a narrative for understanding why the waiting times keep getting longer.
The story follows the published figures in order: how long people waited, when each board stopped meeting the target, who came, whether there was a bed, whether there were enough staff, and whether patients could leave once they were ready. It ends on what the figures support, and what they do not. They show patterns, not proof of cause, and the page tries to say which is which.
Every sentence in the story that states a figure or a pattern is computed from the data rather than typed in, and each claim is a condition checked against it. When Public Health Scotland publishes new figures and the page is rebuilt, a claim the numbers no longer support is rewritten as a plainer one rather than left standing.
How it was made
I built it with Claude, an AI model made by Anthropic, working as a partner: reading and checking the data files, testing each claim against the figures, and writing the code. The questions came from me, often from what I had seen on the wards; the AI's job was to find out what the figures could and could not say about them.
It lives on scot.live, an independent site about what is happening in Scottish cities, and every page of it is readable with JavaScript switched off.
Data sources
- A&E attendances and waiting times, monthly by site, summed to health board: Public Health Scotland, A&E downloads and open data, published 3 November 2026. Jul 2007 – Sep 2026. Open Government Licence v3.0. ae-monthly.json
- A&E attendances by referral source: Public Health Scotland, the same downloads page, published 3 November 2026. Open Government Licence v3.0. ae-referrals.json
- Hospital beds and occupancy, quarterly: Public Health Scotland, NHS Beds information in Scotland, Beds by Board of Treatment and Specialty, published 26 November 2026. Open Government Licence v3.0. ae-beds.json
- NHS Scotland staff, whole-time equivalent at each quarterly census: NHS Education for Scotland, NHSScotland Workforce, Official Statistics, through Turas Data Intelligence, published 1 December 2026. ae-staff.json
- Delayed discharges, monthly bed days by health board: Public Health Scotland, Delayed discharges in NHSScotland, published 3 November 2026. Open Government Licence v3.0. ae-delays.json
- Health board boundaries: Scottish Government, NHS Health Boards (2014 definition). © Crown copyright, Open Government Licence v3.0.
- The competition's data pack, where this began: Telling Scotland's Health Story (K. Nicholson, 2026), The Data Lab Community Data Visualisation Competition 2026. The story has since moved to Public Health Scotland's own newer releases of the same figures.
Nothing is estimated or smoothed. The full method notes for each chart sit beside it in the story, and each file linked above says exactly which release and which filters it was built from.
Credits
- Words, questions and photograph: Stewart Lees.
- Analysis and code: Stewart Lees, with Claude by Anthropic.
- Competition: The Data Lab Community Data Visualisation Competition.
- The figures: Public Health Scotland, NHS Education for Scotland and the Scottish Government, and every member of NHS staff whose records make them up.