betaFeedback

WorksComputer Science

Beyond Physical Illness: Can Clinical Narratives Reveal Emerging Mental Health Risks in Chronically Ill Patients?

Abstract

Mental-health risks such as depression, dementia, and suicidal ideation can emerge during hospitalization among chronically ill patients and may worsen without timely recognition and intervention. However, most existing mental health studies focus on patients with established psychiatric conditions rather than patients hospitalized primarily for physical illness. In this work, we investigate whether latent mental-health risk in chronically ill patients can be inferred from longitudinal clinical narratives. We construct a weakly supervised cohort around 4,000 patients from MIMIC-III using mental-health evidence extracted from discharge summaries. A hierarchical state-space framework derives mental-health representations from day-wise clinical narratives and models their temporal evolution for risk estimation throughout hospitalization. Preliminary results demonstrate improved binary risk prediction using the proposed representations and show distinct model derived risk trajectories between risk and no-risk cohorts, providing a foundation for studying emerging mental-health risks in chronically ill patients.

CCS Concepts

• Applied computing → Health informatics; • Computing methodologies → Information extraction.

Keywords

Mental-health risk, Chronic illness, Clinical narratives, State-space models, Longitudinal EHRs.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Conference’17, Washington, DC, USA

© 2026 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM ISBN 978-x-xxxx-xxxx-x/YYYY/MM

https://doi.org/10.1145/nnnnnnn.nnnnnnn

Introduction

Chronic illness can be accompanied by substantial mental health challenges, including depression, cognitive impairment, dementia, and self-harm risk. [1, 10] These conditions may emerge during hospitalization alongside the primary physical illness and can change rapidly in response to disease severity, medications, sleep disruption, and other clinical stressors. While some risks may be transient, others may persist beyond the acute hospitalization and have long consequences. Early recognition of such risks is therefore important for timely clinical intervention and patient safety. However, existing mental health research using clinical data has largely focused on populations with established psychiatric conditions, whereas the emergence of mental health risks among critically ill patients without a primary psychiatric diagnosis remains comparatively underexplored. [7, 11]

Electronic health records (EHRs) provide rich longitudinal insights into a patient’s hospitalization, encompassing clinical conditions, treatments, diagnoses, adverse events, and care plans. [4] Nursing notes, in particular, are recorded throughout hospitalization and may routinely capture behavioral, cognitive, and affective signals associated with emerging mental-health concerns. However, identifying mental-health risk from these narratives presents two key challenges. First, these information are interwoven with extensive clinical information related to patients’ medical history, medications, procedures, and physiological conditions, making it difficult to isolate mental-health specific signals. Second, explicit mental-health related documentation are typically unavailable, making direct supervised learning of day-wise risk difficult.

In this work, we addresses these challenges through a framework for inferring latent mental-health risk from longitudinal clinical narratives of ICU patients. The framework first constructs a weakly supervised cohort by extracting mental-health evidence from discharge summaries. Day-wise nursing narratives are then transformed into mental-health specific representations, which are subsequently modeled over time to estimate risk throughout hospitalization. This formulation enables investigation of not only whether a patient exhibits mental-health risk, but also how early such risk can be identified during the hospital stay.

The major contributions of this work are: (1) a weakly supervised cohort of approximately 4,000 ICU patients with evidence of mental-health risks, constructed from MIMIC-III; (2) a hierarchical state-space framework that learns mental-health-specific representations from day-wise clinical narratives; and (3) a temporal risk inference model that estimates mental-health risk throughout hospitalization and characterizes its model derived temporal trajectory.

RiskPast + Cur.Cur.-onlyTop primary diseases
Depression616892CHF; Sepsis
self-harm risk356524Carcinoma; Sepsis
hallucination17373Sepsis; Pneumonia
Dementia985328Pneumonia; MI
Memory impairment67182MI; Sepsis

Table 1. Top five mental-health risks in the cohort, showing the number of patients with Past + Cur. evidence in both prior history and current hospitalization, Cur.-only evidence during the current hospitalization without identified prior history, and most frequent primary diagnoses.

Cohort Construction

As our primary data source, we use the publicly available MIMIC-III v1.4 dataset [5], which contains records of approximately 40,000 critically ill patients. To construct the mental-health risk cohort, discharge summaries are used as the primary source of patient-level evidence, as they provide a comprehensive details of the hospitalization and consolidate relevant diagnoses, clinical events, patient history and discharge condition. Each discharge summary is processed using GPT-4o mini [9, 13] with a structured prompt to identify explicit mental-health markers, extract their supporting evidence phrases, and determine their temporal context. Specifically, each identified marker is classified as either past history or associated with the current hospitalization, enabling us to distinguish pre-existing risks from those documented during the hospital stay.

The extracted evidence phrases are subsequently analyzed to identify the corresponding mental-health risks or conditions. To reduce semantic redundancy among extracted markers, we employ an LLM-based concept-mapping agent coupled with the UMLS API [2]. For each extracted risk keyword, the agent retrieves candidate UMLS concepts and computes their cosine similarity with the keyword, selecting the highest-scoring concept as the standardized representation. This process consolidates semantically similar expressions, such as “suicidal thoughts” and “thoughts of killing himself”, under a common clinical concept “suicidal ideation”. The resulting patient-level labels retain the standardized concept, supporting evidence, and temporal context, providing weak supervision for subsequent mental-health risk modeling. We identified 4,113 patients with at least one of 143 unique mental-health risk markers.

Latent Mental-Health Risk Inference

For each patient, nursing notes are documented at the day level to capture clinical evolution throughout hospitalization. We employ ClinicalMamba [12], a state-space sequence model designed for long clinical texts with selective information retention, to encode each day’s narrative into a clinical representation capturing multiple aspects of the patient’s condition, including physical and psychological information. Since these representations contain both mental-health related and broader clinical information, a shared projection followed by two parallel heads produces a mental-health representation zmz_m and a contextual representation zcz_c. We jointly

optimize the two representations using three complementary objectives. A class-weighted binary cross-entropy loss Lm\mathcal{L}_m encourages zmz_m to capture information predictive of the identified mental-health risks. A reconstruction loss Lr\mathcal{L}_r reconstructs the original clinical representation from [zm;zc][z_m; z_c], preserving clinically relevant information across the two representations. An orthogonality loss Lo\mathcal{L}_o minimizes the cosine similarity between zmz_m and zcz_c for patients with identified mental-health risks, encouraging separation between mental-health specific and contextual information. The overall objective is L=Lm+λrLr+λoLo\mathcal{L} = \mathcal{L}_m+\lambda_r\mathcal{L}_r+\lambda_o\mathcal{L}_o, where λr\lambda_r and λo\lambda_o control the relative contributions of the reconstruction and orthogonality objectives and are learned jointly with the model parameters.

The resulting sequence of daily mental-health representations is then processed by a temporal Transformer encoder [6] to model their evolution throughout hospitalization. The Transformer produces a risk probability for each hospitalization day and a final patient-level risk estimate. While the final prediction provides overall hospitalization risk, the day-wise probabilities characterize the temporal trajectory and allow the earliest model detected elevation in risk to be examined.

Preliminary Results

The experiments use 8,113 admissions, comprising 4,113 admissions with identified mental-health risk and 4,000 without risk. We evaluate binary patient-level risk prediction using the original Clinical Mamba representations and the proposed mental-health representations with three temporal architectures: SSM [8], LSTM [3], and Transformer [6]. As shown in Table 2, the mental-health representations consistently outperform the corresponding other representations across all temporal models. This suggests that isolating mental-health specific information from the broader clinical representation provides a more informative basis for downstream risk prediction.

Note Repres. + Temporal ModelF1AUROCAUPRC
Clinical Mamba + SSM0.610.670.62
Clinical Mamba + LSTM0.630.750.71
Clinical Mamba + Transformer0.630.780.67
Mental-health + SSM0.710.820.82
Mental-health + LSTM0.750.850.82
Mental-health + Transformer0.780.860.85

Table 2. Binary mental-health risk prediction results.

In a further analysis, we examine the day-wise risk probabilities. To account for varying lengths of stay, predictions are normalized to relative hospitalization progress and averaged within intervals separately for the risk and no-risk cohorts. Figure 1 presents the resulting model-derived risk trajectories, with the risk cohort generally exhibiting higher predicted risk throughout hospitalization.

Predicted mental-health risk across relative hospitalization progress

Figure 1. Predicted mental-health risk across relative hospitalization progress.

Conclusion

This work presents a framework for inferring latent mental-health risk from longitudinal clinical narratives of chronically ill patients. Preliminary results show that mental-health-specific representations improve patient-level risk prediction and reveal distinct temporal risk trajectories between risk and non-risk cohorts. Future work will extend the framework beyond binary risk detection to identify specific mental-health risks and model their trajectories throughout hospitalization, capturing how patients’ mental states emerge and evolve over time. We will further investigate interpretable approaches to identify the key clinical factors contributing to these changes, providing insight into not only what mental-health risk emerges and when, but also how it evolves and why.

References

  1. [1]Adnan Akif, MMA Shalahuddin Qusar, and Md Rabiul Islam. 2024. The impact of chronic diseases on mental health: an overview and recommendations for care programs. Current psychiatry reports 26, 7 (2024), 394–404.DOI
  2. [2]Olivier Bodenreider. 2004. The unified medical language system (UMLS): integrating biomedical terminology. Nucleic acids research 32, suppl_1 (2004), D267–D270.pubmed.ncbi.nlm.nih.gov/14681409
  3. [3]Steven Elsworth and Stefan Güttel. 2020. Time series forecasting using LSTM networks: A symbolic approach. arXiv preprint arXiv:2003.05672 (2020).
  4. [4]R Scott Evans. 2016. Electronic health records: then, now, and in the future. Yearbook of medical informatics 25, S 01 (2016), S48–S61.DOI
  5. [5]Alistair EW Johnson, Tom J Pollard, Lu Shen, Li-wei H Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. 2016. MIMIC-III, a freely accessible critical care database. Scientific data 3, 1 (2016), 160035.DOI
  6. [6]Bryan Lim, Sercan Ö Arık, Nicolas Loeff, and Tomas Pfister. 2021. Temporal fusion transformers for interpretable multi-horizon time series forecasting. International journal of forecasting 37, 4 (2021), 1748–1764.
  7. [7]David Nickson, Caroline Meyer, Lukasz Walasek, and Carla Toro. 2023. Prediction and diagnosis of depression using machine learning with electronic health records data: a systematic review. BMC medical informatics and decision making 23, 1 (2023), 271.
  8. [8]Syama Sundar Rangapuram, Matthias W Seeger, Jan Gasthaus, Lorenzo Stella, Yuyang Wang, and Tim Januschowski. 2018. Deep state space models for time series forecasting. Advances in neural information processing systems 31 (2018).
  9. [9]C Mahony Reategui-Rivera and Joseph Finkelstein. 2025. Evaluation of the performance of a large language model to extract signs and symptoms from clinical notes. In Envisioning the Future of Health Informatics and Digital Health. SAGE Publications 1 Oliver’s Yard, 55 City Road, London, EC1Y 1SP, 71–75.DOI
  10. [10]Amelia J Scott, Ashleigh B Correa, Madelyne A Bisby, and Blake F Dear. 2023. Depression and anxiety trajectories in chronic disease: a systematic review and meta-analysis. Psychotherapy and Psychosomatics 92, 4 (2023), 227–242.DOI
  11. [11]Zhenxing Xu, Veer Vekaria, Fei Wang, Judith Cukor, Chang Su, Prakash Adekkannatu, Pascal Brandt, Guoqian Jiang, Richard C Kiefer, Yuan Luo, et al. 2023. Using machine learning to predict antidepressant treatment outcome from electronic health records. Psychiatric Research and Clinical Practice 5, 4 (2023), 118–125.DOI
  12. [12]Zhichao Yang, Avijit Mitra, Sunjae Kwon, and Hong Yu. 2024. Clinicalmamba: A generative clinical language model on longitudinal clinical notes. In Proceedings of the 6th Clinical Natural Language Processing Workshop. 54–63.
  13. [13]Nan Zhang, ZaiJie Sun, Yuchen Xie, Haiyang Wu, and Cheng Li. 2024. The latest version ChatGPT powered by GPT-4o: what will it bring to the medical field? International journal of surgery (London, England) 110, 9 (2024), 6018.DOI

Paper details

vlnc:W_75xn8uph
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents