Temporal graph transformer for next visit diagnosis prediction on electronic health records
Hua Zhang, Yuxing Shi, Shumin Zhang, Zhongheng Jian, Minsi Liang, Shuhong Zhang, Junchao Liang, Qiang Li
Third People's Hospital of Chengdu · Sichuan University
Key points
From the paper's conclusion- We first construct a patient-specific temporal heterogeneous graph with timestamped visit nodes and heterogeneous medical event nodes to decouple medical event semantics and visit temporal states, and model intra-visit structural and cross-visit temporal relationships via two types of heterogeneous edges.
Abstract
Next-visit diagnosis prediction with electronic health records (EHR) is critical for proactive medicine, but mainstream methods fail to simultaneously capture cross-visit temporal dependencies, inter-medical-event structural associations and the patient-visit-code hierarchical semantic relationships in EHR, and lack clinical interpretability. This study proposes EHRFormer, a temporal graph transformer model for EHR-based next-visit diagnosis prediction. We first construct a patient-specific temporal heterogeneous graph with timestamped visit nodes and heterogeneous medical event nodes to decouple medical event semantics and visit temporal states, and model intra-visit structural and cross-visit temporal relationships via two types of heterogeneous edges. A temporal-aware heterogeneous message passing mechanism integrated with Time2Vec-based time encoding is designed to fuse temporal and structural information, and meta-path-based global positional and local structural encoding are introduced to capture high-order medical event interactions. Additionally, a patient graph explainer module is developed to identify prediction-critical subgraphs and medical events for clinical interpretability. Extensive experiments on three real-world EHR datasets (MIMIC-III, MIMIC-IV, MarketScan CCAE) with core metrics of visit-level precision@k and code-level accuracy@k demonstrate that EHRFormer achieves state-of-the-art performance, strong noise robustness, and high inference efficiency with linear time complexity. The graph explainer can accurately identify clinically meaningful medical events consistent with clinical guidelines. EHRFormer realizes collaborative learning of EHR’s three-level hierarchical representations, unifying high prediction accuracy, reliable clinical interpretability and efficient inference, and provides a novel paradigm for EHR-based medical predictive modeling with notable clinical application value.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Explainable Transformer Models for Early Prediction of Chronic Diseases Using Longitudinal Electronic Health Records (EHRs)EAI Endorsed Transactions on AI and Robotics · 2026
- GraphBEAT: Graph-based Bucketized Event Aggregation Over Time for Early Risk Stratification of Gastrointestinal CancersarXiv · 2026
- Graph-Enhanced Disease Trajectory Discovery and Temporal Endpoint Forecasting from Longitudinal Electronic Health RecordsarXiv · 2026
- MedDP : A Graph‐Based Large Language Disease Prediction ModelExpert Systems · 2026
- Sequential pattern transformer (SPT): a generative and interpretable framework for predicting disease trajectoriesNeural Computing and Applications · 2026
- Evaluating Pretrained Language Semantics for Structured EHR Prediction TasksarXiv · 2026