APPLICATION OF MACHINE LEARNING TO LARGE SCALE ELECTRONIC HEALTH RECORD DATA PREDICTS RISK TO READMISSION FOR SUICIDE ATTEMPT
Authors: Kaminsky *Zachary Aaron , Sani Maurice , Burhunduli Patricia , Mar-Kaminsky Sharah , Mcquaid Robyn J , Phillips Jennifer 
Published: February 2025

Background

The period following discharge from a psychiatric inpatient admission is a high risk time for suicidal behaviors and death by suicide up to 200 times the global rate. Leveraging electronic health record (EHR) data in concert with machine learning techniques may help predict post discharge suicide attempts (SA) as well as modifiable factors that may be targeted during an inpatient stay in order to reduce risk.

Objectives

The primary objective of this project was to leverage thirteen years of EHR data from psychiatric inpatient admissions in Ontario Canada and generate models for prediction of risk to emergency room (ER) contacts for suicide attempt (SA), deemed (ER-SA). The secondary objective was to generate a method to optimize clinical decision points to reduce risk of SA post discharge.

Methods

The total sample of N=353,806 inpatient admissions was randomly split (66:33%) into a training set (N= 249,024 ) and test set (N=104,782 ) with multiple admissions from the same individual being unique to either set. We generated two random forest models using N=480 unique EHR variables and modeled two outcomes including 1.) a binary outcome if an inpatient admission was followed by an SA and 2.) time in days until the earliest post discharge appearance of the same individual in the ER data sets.

Results

The binary outcome model identified N=1386 individuals from the test set whose next admission would be for SA from 102718 that would not (AUC = 82.2, 95% CI 0.81-0.83). A sliding window analysis assessed time model predictive accuracy as a function of days from discharge with the strongest robust prediction observed at 5 days ( AUC = 0.88, 95% CI: 0.79-0.99, N=15 ER-SA in timeframe, N=104,139 no-ER-SA in timeframe), however, prediction scores at 1 year (AUC= 0.78) were not significantly weaker than those in the first few weeks (AUC=0.88). Notably, the time modeled time to ER-SA was significantly associated with the actual time to next ER-SA among all individuals whose next admission was an ER-SA (rho=0.14, p=4.5x10-7). We therefore used the binary model to identify those likely at risk of next admission ER-SA, followed by application of the time model, demonstrating a robust association of prediction AUC as a function of days from discharge out to 21 days (rho= -0.90, p=2.6 x10-7).Using the time based model, a forward stepping algorithm maximized predicted outcome time by iterating all possible modifiable clinical decisions to generate an ‘ideal’ low-risk clinical state per individual. The algorithm was evaluated on N=1386 next admission ER-SA individuals in the test set. A significant negative correlation between the time to ER-SA and proportion of ‘ideal’ low-risk EHR variables was observed (Rho=-0.07, p=0.0061), validating the ‘ideal’ low-risk method.

Conclusions

Using a two model approach, we generated a robust method capable of prognosticating short term risk. Application of the ‘Ideal’ low risk method offers the potential to leverage big data generated machine learning models to direct inpatient stay clinical decisions in order to reduce risk to SA post discharge.