Manuscript Offprint

arXiv:2610.20502

Graph-Enhanced Disease Trajectory Discovery and Temporal Endpoint Forecasting from Longitudinal Electronic Health Records

Jin-Jia Zheng, Vincent S. Tseng

Abstract

Longitudinal electronic health records (EHRs) can reveal disease-progression structure, while useful forecasting requires leakage-controlled discovery, censor-aware outcomes, and inspectable trajectory evidence. We developed a graph-enhanced framework in MIMIC-IV v3.1 that splits patients before graph construction, learns train-only consecutive-admission transitions, and freezes endpoint-specific branching-motif policies selected on validation data. The final catalog contained 99,527 motifs, and a time-aware Transformer retrieved at most 24 patient-compatible motifs per endpoint through endpoint-specific cross-attention. Across five training seeds, micro-AUPRC increased from 0.9330 to 0.9357, while event-time MAE decreased from 676.9 to 657.7 days (reduction 19.2 days; 95% paired patient-cluster bootstrap CI, 13.8-24.8). Timing effects were heterogeneous: MAE worsened for events within 730 days but improved by 58.9 days for events occurring after 730 days. In an exploratory internal temporal split, branch conditioning reduced conditional event-time MAE by 26.9 days (95% CI, 23.0-30.8) without evidence of better micro-AUPRC. Corrected survival evaluation over the supported 0-2,555-day interval did not establish macro C-index or integrated Brier score superiority over a matched history-only discrete-hazard model. A directed, degree-matched GNN repair substantially improved unseen-edge discovery, yet replacing GNN-derived scores within fixed motif identities did not improve downstream forecasting. These results position branching motifs as structured trajectory context whose main value is long-range timing support rather than uniformly stronger endpoint discrimination, survival prediction, or causal explanation.

Keywords: graph neural networks; disease trajectories; electronic health records; transformer; temporal endpoint forecasting; clinical forecasting

1. Introduction

Longitudinal EHRs contain repeated clinical encounters, diagnosis codes, irregular time intervals, and evolving comorbidity patterns [1]. In many clinical prediction settings, the objective is not only to determine whether a patient will eventually develop a target disease, but also to understand which prior conditions and disease transitions support that prediction and when the endpoint may occur. This is particularly important for chronic or progressive conditions such as chronic obstructive pulmonary disease (COPD), stroke, chronic kidney disease (CKD), and dementia, where disease histories often contain multiple overlapping signals rather than a single isolated precursor.

Neural sequence models have become a standard approach for EHR-based prediction. Recurrent models such as Doctor AI and GRU-D showed that time-stamped clinical histories can be encoded for future diagnosis or risk prediction [2, 3]. Attention-based models such as RETAIN and Dipole further improved interpretability by highlighting influential visits or code-level contributions [4, 5]. Transformer-based EHR models, including BEHRT, Med-BERT, Hi-BEHRT, and large generative forecasting models such as Delphi-2M, expanded the capacity to learn long-range disease dependencies and population-scale disease representations [6-10]. However, these models usually encode disease progression implicitly. Even when attention weights or token embeddings are inspected, it remains difficult to identify the explicit disease path or branching motif that supports a particular endpoint forecast.

A complementary line of work studies disease trajectories, transition graphs, chronological disease maps, and multimorbidity patterns [11-14]. These studies show that large-scale health records can reveal ordered disease-to-disease associations and population-level progression structure. Nevertheless, many trajectory-mining studies remain retrospective or descriptive: the discovered patterns are visualized, summarized, or used for hypothesis generation, but are not systematically integrated into endpoint ranking and event-time forecasting. A second limitation is that trajectory catalogs are often constrained by small curated sets or fixed top-N exports, which can arbitrarily restrict coverage and make it difficult to judge whether discovered evidence remains useful beyond a small subset of highly ranked motifs.

This paper addresses these gaps through a leakage-controlled graph-enhanced disease trajectory forecasting framework. Patients are split before discovery; the transition graph, GNN, support statistics, and motif candidates use train-only data; and stable versus broad catalog policies are selected by validation AUPRC and frozen before test evaluation. Patient-compatible branching motifs are encoded as branch tokens and combined with a time-aware Transformer to predict risk, at-risk endpoint ranking, and time to first recorded endpoint occurrence.

The paper addresses four aims: (1) whether train-only graph discovery can produce a high-coverage branching-motif catalog without a fixed top-N cap; (2) whether branch-token conditioning improves censor-aware risk, at-risk ranking, and event-time estimation; (3) whether the observed effects remain interpretable after candidate-count stratification, lead-time stratification, matched final-setting ablations, and a censor-aware survival comparator; and (4) whether improved unseen-edge discovery quality translates into incremental forecasting utility when motif identities are held fixed.

The main contributions are: (1) a patient-disjoint, train-only transition-graph and motif-discovery protocol; (2) a validation-selected endpoint-adaptive catalog of 99,527 branching motifs; (3) a censor-aware five-seed evaluation with 5,000 paired patient-cluster bootstrap resamples; (4) candidate-count-aware ranking, lead-time heterogeneity, matched ablations, calibration, and a tuned censor-aware hazard comparator; and (5) a directed-GNN repair study that separates unseen-edge discovery quality from downstream score utility, together with computational motif-deletion faithfulness analyses.

References (28)