20 July 2026 in JMIR Preprints
BACKGROUND Heart failure (HF) is a severe and progressive clinical syndrome associated with high mortality, frequent hospitalizations, and substantial healthcare burden worldwide. Identification of critically ill HF patients and accurate assessment of cardiac function grade at discharge are essential for timely intervention, risk stratification, and optimization of post-discharge management. OBJECTIVE This study aims to develop and validate KA-STNet, an interpretable knowledge-augmented spatiotemporal framework for in-hospital mortality prediction and discharge cardiac function grade prediction in patients with HF. METHODS To address the heterogeneity of EMR data, KA-STNet adopts distinct graph representation strategies for static and time-series data. For static data, it integrates external medical knowledge with data-driven statistical associations to learn knowledge-augmented patient representations. For time-series data, it employs a spatiotemporal graph neural network to capture spatial dependencies among laboratory indicators and temporal dynamics in longitudinal laboratory sequences, while incorporating patient-level static representations to guide inter-laboratory association modeling. Interpretability analyses based on Shapley additive explanations (SHAP), GNNExplainer, and Leiden community detection are conducted to identify key predictive factors and clinically meaningful laboratory communities. RESULTS KA-STNet outperformed all baseline models across all evaluated tasks. In the in-hospital mortality risk prediction task, it attained a mean AUROC of 0.968 on the local dataset and 0.897 on the public dataset. In the discharge cardiac function grade prediction task, KA-STNet achieved a mean AUROC of 0.925. Anemia-related variables, indicators of renal function and infection-related markers were identified as important contributors to adverse outcome prediction in patients with HF. Leiden community detection further revealed meaningful multi-organ interaction patterns. Adverse outcomes were associated with network reorganization involving acid–base/electrolyte, inflammatory, and hepatic indicators. CONCLUSIONS KA-STNet provides an effective and interpretable framework for predicting HF outcomes using heterogeneous EMRs. These findings support the value of combining knowledge-augmented static representation learning with spatiotemporal dependency modeling for interpretable prediction of clinically relevant HF outcomes. CLINICALTRIAL Not applicable. This was a retrospective study based on electronic medical records and was not a clinical trial. INTERNATIONAL REGISTERED REPORT RR2-