Introduction
In population health research, administrative databases are invaluable but often lack clinical granularity. A significant challenge in Ontario’s health records is the "coding collision" between Patent Foramen Ovale (PFO) and Atrial Septal Defect (ASD). Both conditions involve a hole in the heart's atrial septum and share identical ICD-9 (745.5) and ICD-10 (Q21.1) codes, yet they are clinically distinct. PFO is a common remnant of fetal circulation often linked to "cryptogenic" strokes, while ASD is a rarer congenital defect requiring different management. To enable precise long-term outcome research, this study developed a Random Forest (RF) machine learning model to distinguish between these two populations.
Methods
The researchers implemented a Random Forest classification algorithm using the randomForest package in R. RF was selected for its ability to handle high-dimensional data and complex variable interactions without requiring extensive a priori feature selection. The modeling process involved feature engineering of 24 variables, including demographics and specific intervention codes, and hyperparameter tuning to balance sensitivity and specificity. The RF model was benchmarked against a traditional heuristic method that classified patients based solely on prior stroke or TIA history.
Data and Cohort Selection
The study utilized data from ICES in Ontario, Canada, focusing on adult patients who underwent transcatheter closure for PFO or ASD between 2002 and 2017. To establish a "ground truth" for training, administrative records were linked to the CorHealth Ontario cardiac registry, which contains specific clinical fields distinguishing the two procedures.
As shown in the selection process, the final cohort consisted of 1,482 patients, split between 697 PFO and 785 ASD cases.
Key Insights and Model Performance
The Random Forest model significantly outperformed traditional heuristics. While the traditional "stroke-history" proxy had high specificity (96%), its sensitivity was only 36%, missing the majority of PFO patients. In contrast, the tuned RF model achieved a more balanced performance with an accuracy of 0.76, sensitivity of 0.76, and specificity of 0.75.
Analysis of variable importance revealed that patient age and the frequency of ischemic strokes prior to the procedure were the strongest predictors. PFO patients were generally younger and had a higher prevalence of prior stroke (39.5% vs. 3.7% for ASD). Additionally, intervention codes related to complex hemodynamic assessments, such as pulmonary artery pressure measurements, served as important proxies for identifying ASD patients.
Limitations and Future Directions
While successful, the model's performance is tied to the specific coding practices of Ontario's administrative databases, and external validation in other jurisdictions is needed. Furthermore, the model relies on the accuracy of underlying ICD codes for comorbidities like migraines. Future research will leverage this algorithm to evaluate long-term clinical outcomes, such as mortality and recurrent stroke, specifically comparing PFO and ASD populations across the province.
Summary updated