Abstract
The aim of this paper is to analyze the sequence of actions in the health system associated with a particular disease. Using Electronic Health Records (EHRs), we define a general methodology that allows us to: (i) identify the actions in the health system associated with a disease; (ii) identify those patients with a complete treatment for the disease; and (iii) discover common treatment pathways followed by the patients with a specific diagnosis. The methodology takes into account the characteristics of the EHRs, such as record heterogeneity and missing information. As an example, we use the proposed methodology to analyze breast cancer disease. For this diagnosis, 5 groups of treatments, which fit in with medical practice guidelines and expert knowledge, were obtained.
Introduction: The Challenge of Messy EHR Data
Electronic Health Records (EHRs) represent a vast repository of real-world clinical data. However, their primary purpose—administration and billing—often makes them difficult to use for longitudinal research. Two primary obstacles include significant missing information (where diagnosis fields are often left blank) and comorbidity, which creates a "spaghetti" of data points from multiple concurrent conditions. In many systems, the diagnosis field is left blank in the majority of records; in the dataset used for this study, 75% of records lacked this critical label.
This study proposes a methodology to extract clean, disease-specific treatment pathways from such fragmented data, using breast cancer as a primary case study to demonstrate how administrative data can reveal high-quality real-world evidence.
Methodology: From Raw Records to Disease Pathways
The researchers utilized the Osakidetza database from the Basque Country, Spain, covering over 579,000 patients across 2016 and 2017. To process this data, they developed a three-stage pipeline:
- Action Relevance Measure: To solve the missing diagnosis problem, the authors identified medical specialties (e.g., Oncology, Radiotherapy) that appear with significantly higher frequency in patients known to have the target disease than in the general population. Actions within these specialties were then flagged as relevant, effectively bypassing the missing label gap.
- Patient Selection for Completeness: To ensure the analysis focused on full treatment cycles, strict filters were applied. For the breast cancer cohort, this required at least one biopsy record, a minimum of 15 associated actions, and ensuring the diagnosis did not fall at the very beginning or end of the two-year data window.
- Clustering with Edit Distance: The team employed the K-medoids clustering algorithm combined with Normalized Levenshtein (edit) distance. This approach is superior to traditional K-means for sequence data because it identifies an actual patient's journey as the cluster center (the medoid), ensuring the results remain clinically interpretable.
Results: Five Distinct Treatment Groups
The algorithm identified five distinct treatment patterns for breast cancer among a cohort of 440 patients:
- Group 1 (15.0%): Surgery + Chemotherapy + Radiotherapy (The standard "triple" approach).
- Group 2 (20.3%): Surgery + Radiotherapy + Hormonal Therapy.
- Group 3 (24.6%): Surgery + Hospitalization (Likely patients who transferred from other hospitals specifically for surgical procedures).
- Group 4 (31.2%): Surgery + Radiotherapy (The most common path for early-stage cancer).
- Group 5 (9.1%): Neoadjuvant Chemotherapy + Surgery + Hospitalization + Radiotherapy (Chemotherapy delivered before surgery to shrink tumors).
These findings were validated against the European Society for Medical Oncology (ESMO) guidelines, confirming that the unsupervised machine learning approach successfully captured medically sound practices.
Discussion and Limitations
While the methodology proved robust, it faces certain limitations. The two-year data window is relatively short for diseases like breast cancer, where hormonal therapies can last up to a decade. Consequently, the study could only capture the initiation of these long-term treatments. Furthermore, while the "relevance measure" works well for specialized conditions, it may be harder to apply to general conditions (like acute sinusitis) where patients primarily visit general practitioners or emergency rooms.
Despite these challenges, the study demonstrates that by treating medical specialties as proxies for disease, researchers can reconstruct meaningful patient journeys even from highly incomplete administrative records.
Summary updated