Abstract
Objectives: To demonstrate how data-driven variability methods can be used to identify changes in disease recording in two English electronic health records databases between 2001-2015.
Design: Repeated cross-sectional analysis applying data-driven temporal variability methods to assess month-by-month changes in routinely-collected medical data.
Setting: 400 English primary care practices (CPRD GOLD) and 451 hospital trusts (HES).
Main outcomes: Proportion of patients/admissions with recorded cardiovascular diseases.
Results: Gradual changes were observed between 2001-2008. CPRD GOLD saw a 47%-62% increase in recorded prevalence, partially reversing after 2008. HES showed relative decreases in angina and unspecified stroke, with increases in chronic coronary heart disease. Abrupt changes in myocardial infarction codes occurred biennially from 2010, linked to coding guideline updates.
Conclusions: Temporal variability measures provide a robust technique to identify artificial changes in EHR studies, which might otherwise violate statistical assumptions.
Introduction
Researchers increasingly rely on Electronic Health Record (EHR) data for large-scale clinical research. However, because these data are primarily collected for administrative and billing purposes, they are subject to "artificial" shifts. Changes in clinical coding guidelines, financial incentives, or institutional policies can create trends in the data that do not reflect underlying biological or medical realities. If researchers fail to account for these shifts, they risk drawing spurious conclusions or violating the statistical assumptions of independence required by many models. Identifying these undocumented changes is a significant challenge for researchers who were not involved in the original data collection process.
Methodology
To address this, the study proposes a scalable, unsupervised approach to monitor data quality over time using Information-Geometric Temporal (IGT) plots. This method, implemented in the EHRtemporalVariability R package, follows a three-stage workflow:
- Joint Distribution Estimation: For each month, the joint distribution of relevant variables—such as age, gender, socio-economic status (IMD), and specific disease codes—is calculated. This captures the multi-dimensional state of the data at a specific point in time.
- Dissimilarity Calculation: The Jensen-Shannon Distance (JSD) is used to quantify the "distance" or dissimilarity between the distributions of any two months. A JSD of 0 indicates identical distributions, while a JSD of 1 indicates no overlap.
- Geometric Mapping: Multidimensional Scaling (MDS) is applied to the resulting dissimilarity matrix to project these high-dimensional distances into a 2D or 3D geometric space.
In the resulting scatter plots, each point represents a month. Points clustered together indicate stable coding periods, while abrupt jumps or changes in the trajectory of points signal significant shifts in data recording practices.
Data Sources
The study analyzed two massive, representative English databases covering the period from 2001 to 2015:
- Clinical Practice Research Datalink (CPRD GOLD): Primary care data from 400 English practices, encompassing approximately 4.4 million patients.
- Hospital Episode Statistics (HES): Secondary care data from 451 hospital trusts, specifically focusing on admissions related to cardiovascular disease (ICD-10 codes I20-I69 and G45).
Findings
The analysis identified two distinct types of temporal variability: "evolutionary" (gradual) and "revolutionary" (abrupt).
In primary care (CPRD GOLD), a gradual increase in the recorded prevalence of cardiovascular diseases (47% to 62%) was observed between 2001 and 2008. This trend partially reversed after 2008, a shift likely linked to the Quality and Outcomes Framework (QOF), a pay-for-performance scheme that altered recording incentives.
In hospital care (HES), the data revealed significant relative shifts in specific codes. Recording for angina pectoris dropped by 34.4% and unspecified stroke by 42.3%, while chronic coronary heart disease increased by 14.3%. Furthermore, abrupt "staircase" jumps in the recording of myocardial infarction were detected in March/April of 2010, 2012, and 2014. These shifts aligned precisely with the release of updated National Clinical Coding Standards, demonstrating how administrative policy leaves a distinct "fingerprint" on clinical data.
Conclusion
Data quality in EHRs is dynamic rather than static. A dataset may be reliable for one period but compromised by a coding change in another. While the IGT plot method identifies that a change has occurred, human expertise is still required to investigate the underlying cause—be it a policy shift, software update, or genuine medical event. By providing an objective and robust technique to identify these changes, researchers can better account for artificial variability in EHR-based studies, potentially using these variability measures as covariates in statistical models to adjust for coding shifts.
Summary updated