Until recently, DataLoch has provided approved researchers with prescription data from community pharmacies, both prescribed and dispensed. Our latest update integrates further data about hospital medications sourced from a new inpatient prescribing system adopted by NHS Lothian. This means that prescription details from hospital stays (inpatient episodes) can be linked to community pharmacy information, increasing the reliability of research informed by the medications people take.

Inpatient Hospital Prescribing

The Hospital Electronic Prescribing and Medicines Administration (HEPMA) system has been rolled out across NHS Lothian hospitals on a staggered basis since 2021. In November 2024, we added hospital-discharge prescriptions data from this HEPMA system and have since been working on the incorporation of details from inpatient episodes.

The successful integration of prescriptions data from inpatient episodes allows a more detailed picture of the medications prescribed before, during, and after a stay in hospital.

Previously, some guesswork would have been required by the researcher to account for any change in community prescriptions before and after a hospital stay, and any medications prescribed solely within the hospital setting (e.g. antibiotics for infections) would have been completely hidden.

Prescriptions data from both community and hospital sources have been aligned to aid researchers in making connections between different prescriptions datasets when undertaking their studies.

Testing the potential of inpatient prescriptions data

An initial pilot has demonstrated the value of linking these different sources of prescriptions data within a project that sought to better understand the uses of medicine and the health outcomes of cancer patients throughout their treatment journeys.

Members from the Edinburgh Cancer Centre Information Team at NHS Lothian explored linking data from the HEPMA dataset to data from community prescribing, other secondary care datasets, and the ChemoCare prescribing system, which includes chemotherapy, immunotherapy, and other systemic drug treatments for cancer that work throughout the whole body.

The team concluded that combining these data, and therefore summarising all prescriptions a patient is taking, would allow more robust follow-up by healthcare professionals during and after phases of cancer treatment. This summarised picture would be crucial for drugs with higher risks of harmful side-effects when used for long periods, such as those commonly relied on to manage nerve pain.

Next steps

With more prescriptions data across hospital and community settings now available for approved research through DataLoch, we plan to explore incorporating structured dosage data to offer greater insights to the prescription information. Currently, researchers have to make assumptions about the amount of medication people are taking based on its stated strength, the quantity dispensed, and the frequency of repeat prescription. Accessing dosage data would allow the daily doses and duration of treatments to be known with greater accuracy, which would greatly assist medication-related studies, such as those looking at possible side effects and other outcomes.