Predicting documented prior intentional self-harm in emergency departments: an interpretable gradient boosting approach using European injury surveillance data
Related Experiment Video
Updated: Oct 31, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Marco Giustini1, Alessio Pitidis1, Cecilia Fazio1
1Department of Environment and Health (DAMSA), Italian National Institute of Health (ISS), Rome, Italy.
Introduction:
Prior intentional self-harm history is the strongest predictor of completed suicide, yet this information frequently goes uncommunicated during emergency department (ED) presentations. We developed an interpretable gradient boosting model (XGBoost) to predict whether a patient's record in the European Injury Database (EU-IDB) carries a documented prior self-harm flag, using injury characteristics, demographics, and clinical features available at ED attendance.
Methods:
The raw dataset comprised 62,467 attendances for intentional self-harm from 18 countries (2008-2023), with 86.2% of outcomes coded Unknown. Formal missingness analysis showed that observed outcome missingness was overwhelmingly explained by country membership (country alone: pseudo-R2 = 0.537, AUC = 0.948) and that documentation was positive-biased: across countries, the sparser the documentation, the higher the positivity among documented records (Spearman ρ = 0.882). A three-step "Third Way" strategy excluded three countries with structurally absent outcome protocols and defined the target as a documented positive flag vs. its absence, yielding an analytical dataset of 26,554 records (prevalence 13.7%), three times larger than the complete-case alternative.
Results:
XGBoost achieved AUC-ROC = 0.800 (95% CI 0.783-0.816), AUC-PR = 0.380, and Brier score = 0.100, significantly outperforming logistic regression (DeLong p = 3.93 × 10-10). At the optimised threshold (0.080), sensitivity was 80.8%, specificity 62.8%, NPV 95.4%. A time-zero model restricted to variables available at triage achieved AUC-ROC = 0.762 (0.745-0.780) and retained its advantage over the linear baseline (0.729, 0.712-0.746). SHAP analysis identified proximal risk factor documentation, place of occurrence, and patient age as dominant predictors, and a sensitivity analysis excluding the ProximalRiskFactor variable (AUC-ROC = 0.765) confirmed robustness to a potentially circular feature. A country prediction test (95.3% accuracy, 14.3× chance) quantified substantial implicit geographic encoding in the clinical features, offering a plausible explanation for the gap between test-set AUC-ROC (0.800), temporal validation (0.674) and group-aware cross-validation (0.658). Country-stratified assessment revealed adequate calibration in most settings but miscalibration in low-volume countries, and fairness analysis identified lower sensitivity in older adults (68.0%; AUC-ROC 0.722, 95% CI 0.617-0.822) as a critical limitation.
Conclusion:
This model could serve as a decision support layer within ED workflows, but requires local validation, country-specific recalibration, and embedding within structured post-identification care pathways before deployment.