Temporal EHR Models Detect Rare Disease Years Before Diagnosis
Yang, L.; Ng, P.; Lun, M. Y.; Tunstall, T.; Meyers, L.; Osundiji, M.; Im, K.; Kumar, A.; Lavertu, A.; Rabinowitz, M.
Show abstract
Background. Rare diseases collectively affect an estimated 300 million people worldwide, yet patients wait an average of 4-8 years for a correct diagnosis after visiting multiple physicians, accumulating unexplained findings, and suffering preventable disease progression before a unifying diagnosis is reached. Electronic health records (EHRs) capture this pre-diagnostic trajectory in rich detail, but conventional methods typically collapse years of longitudinal phenotypic signals into a single static snapshot; our approach instead models this temporal structure directly. Methods. We conducted a retrospective cohort study using longitudinal EHR data from approximately 3 million patients at Mayo Clinic Platform_Accelerate. Cases were patients with confirmed diagnoses of 10 rare diseases; controls (~5,200 per disease) had no record of any rare disease. HPO phenotype terms were extracted from clinical notes and laboratory results using a medspaCy NLP pipeline; ICD codes were grouped at three-character level. We developed and trained two temporal models, GRU-Attn and Conformer, that encode patient histories as quarterly time-binned sequences spanning up to 30 years, and compared these against three static baselines (CatBoost, XGBoost, logistic regression). Models were evaluated systematically at prediction horizons h = 1-10 years before diagnosis. Results. In the full held-out cohort benchmark, temporal models outperformed static baselines across the large majority of diseases and prediction horizons, with the advantage widening substantially as the horizon lengthened. At 1-2 years prior to diagnosis, mean AUROC was 0.928 (GRU-Attn) versus 0.871 (CatBoost); at 6-10 years prior to diagnosis, 0.726 versus 0.693, with static models degrading to near-chance for some diseases. Combining HPO and ICD features yielded the strongest performance, with a mean gain of +0.063 AUROC over the best single source at 1-2 years prior to diagnosis. Separately, in a manually curated cohort of 143 confirmed-undiagnosed cases with extended EHR histories, GRU-Attn identified 138 cases before first disease mention and all 143 cases before formal diagnosis at the prespecified 99th-percentile specificity threshold, with median lead times of 1.1-8.3 years and 1.9-21.7 years, respectively. Conclusions. By learning from the temporal trajectory of phenotypic signals rather than their static aggregate, temporal EHR models improved retrospective early detection performance across several rare diseases, most powerfully for conditions where pre-diagnostic findings accrue gradually and heterogeneously over years. These results show that longitudinal EHR trajectories carry rare-disease signal beyond static phenotypic burden and support prospective evaluation of temporal EHR modeling for rare-disease risk stratification.
Matching journals
The top 3 journals account for 50% of the predicted probability mass.
Similar papers in this journal
- Large language models improve transferability of electronic health record-based predictions across countries and coding systems 94%
- Interpretable Fine-tuned Large Language Models Facilitate Making Genetic Test Decisions for Rare Diseases 94%
- Finding Long-COVID: Temporal Topic Modeling of Electronic Health Records from the N3C and RECOVER Programs 93%
Similar papers in this journal
- Pretrained Patient Trajectories for Adverse Drug Event Prediction Using Common Data Model-based Electronic Health Records 91%
- Leveraging sequences missing from the human genome to diagnose cancer 90%
- Using Genomic Context Informed Genotype Data and Within-model Ancestry Adjustment to Classify Type 2 Diabetes 90%
Similar papers in this journal
Similar papers in this journal
Similar papers in this journal
- Predicting hospital-onset COVID-19 infections using dynamic networks of patient contacts: an observational study 91%
- Understanding COVID-19 trajectories from a nationwide linked electronic health record cohort of 56 million people: phenotypes, severity, waves & vaccination 91%
- Real-world evaluation of AI-driven COVID-19 triage for emergency admissions: External validation & operational assessment of lab-free and high-throughput screening solutions 91%
"Similar papers" are the closest papers from that journal in the model's embedding space. They show what the match is built on, but the ranking comes mostly from a classifier over the whole training set, not from these examples alone.