TITLE:
Before the Wave: A Synthetic Longitudinal EHR Proof-of-Concept Study of SSRI-Associated Mood Destabilisation in Bipolar Disorder
AUTHORS:
Rocco De Filippis, Abdullah Al Foysal
KEYWORDS:
Temporal Convolutional Network, SSRI, Mood Destabilisation, Bipolar Disorder, Synthetic EHR Sequences, Dilated Causal Convolution, Gradient Saliency, Deep Learning, Pharmacovigilance, Clinical Trajectory
JOURNAL NAME:
Open Access Library Journal,
Vol.13 No.8,
August
31,
2026
ABSTRACT: Selective serotonin reuptake inhibitor (SSRI)-associated mood destabilisation, encompassing hypomania, mania, and mixed-state induction, is an important pharmacological safety concern in bipolar disorder. Current clinical decision-making relies largely on static baseline risk factors and therefore may not capture the temporal evolution of symptoms, medication exposure, adherence, sleep, and physiological measures across follow-up visits. This methodological proof-of-concept study evaluates whether longitudinal modelling of entirely synthetic electronic health record (EHR)-like trajectories can identify patterns associated with later simulated destabilisation. It does not use real clinical records or provide external clinical validation. We developed a Temporal Convolutional Network (TCN) with dilated causal convolutions using an entirely synthetic cohort of N = 750 SSRI-exposed simulated patients with bipolar disorder. No real patient records, registry data, or hybrid clinical-synthetic records were used. Each trajectory contained up to 12 visits and 14 time-varying features: MADRS and YMRS scores, GAF, SSRI dose, mood-stabiliser level proxy, HRV SDNN, sleep duration, daily step count, self-reported mood and anxiety, visit gap, medication-change flag, side-effect burden, and prescription fill ratio. The endpoint was a simulator-defined incident hypomanic, manic, or mixed episode occurring within the follow-up horizon. For destabilised cases, all observations at and after event onset were excluded and masked. The TCN used four residual blocks with two kernel-size-3 causal convolutions per block and dilations 1, 2, 4, and 8, yielding an effective receptive field of 61 visits. A patient-level out-of-fold stacking ensemble combined TCN and XGBoost probabilities through a logistic-regression meta-learner. Temporal gradient saliency was used to examine the contribution of observed pre-event visits. On the held-out test set, logistic regression achieved the highest AUC (0.974), followed by the proposed ensemble (0.950), XGBoost (0.948), LSTM (0.915), and the standalone TCN (0.844). The ensemble achieved F1 = 0.826, sensitivity = 0.827, specificity = 0.923, and AUC = 0.950 (95% CI: 0.892 - 0.989). Thus, the ensemble did not outperform logistic regression in discrimination, although it provided competitive performance and the highest estimated net benefit across the reported decision-curve threshold range. Temporal saliency showed a strong contribution at the initial visit and a later increase around visits 7 - 10 in the synthetic destabilised trajectories. These model-dependent patterns are exploratory and should not be interpreted as a validated clinical monitoring window. Longitudinal modelling of synthetic EHR trajectories can recover temporally distributed patterns associated with later simulator-defined SSRI-related mood destabilisation. In this simulation, temporal attributions were distributed across early and later pre-event observations rather than establishing a single definitive monitoring interval. Prospective validation on real, independently collected EHR data is required before any monitoring schedule or clinical alert can be recommended.