New algorithm helps make chronic pain visible in Scotland’s GP records
Researchers from the University of St Andrews School of Medicine, working alongside colleagues at the University of Dundee, have helped deliver a major step forward in how Scotland understands and supports people living with chronic pain. The C‑PICTURE project set out to solve a long‑standing problem: although chronic pain affects up to two in five people in the UK, it is often hidden in GP records because clinicians tend to record the underlying condition rather than the pain itself. As the report explains, “chronic pain is often not explicitly coded in clinical records”, meaning many people’s experiences remain invisible in routine data.
To tackle this, the team developed and tested a new algorithm capable of identifying chronic pain from everyday primary care information. The project brought together medical record review, patient surveys, and interviews with both patients and clinicians across six GP practices. This combination of data and lived experience helped the researchers understand not just how pain is recorded, but how people talk about it, manage it, and sometimes downplay it. Many patients described long‑term pain as something that “creeps in” or becomes part of daily life, with the report noting that “chronic pain may not always be actively presented in consultations” .
The resulting algorithm performed strongly and consistently, accurately identifying people whose pain has a real impact on their daily lives. Rather than picking up occasional aches, it highlighted individuals experiencing persistent, disruptive pain and greater unmet need. This makes it a powerful tool for understanding where support is most required.
For Scotland’s health services, the impact could be significant. Until now, national estimates of chronic pain have relied heavily on surveys, making it difficult to plan services or understand local variation. With this new approach, health boards will be able to see more clearly where chronic pain is affecting communities, how prescribing patterns relate to need, and where earlier intervention could make a difference. The report emphasises that this work “establishes an essential foundation for improved chronic pain surveillance, research, and equitable service planning in Scotland” .
The collaboration between St Andrews and Dundee showcases how combining clinical insight, data science, and patient experience can produce practical tools with real‑world impact. Over the coming year, the findings will be shared through academic publications, NHS Scotland engagement, and public events, with further work planned to explore how the approach could be adapted across the UK and internationally.