Uncategorized

Spanish Hospital Built an AI Early-Warning System for Suicide Risk From 41,557 Patient Records

Researchers at Institut d'Investigació i Innovació Parc Taulí in Spain built machine-learning models that flagged suicide risk with roughly 0.95 AUC using six years of real-world mental health records, the first phase of a hospital-wide early-warning system called IDICIUS.

Spanish Hospital Built an AI Early-Warning System for Suicide Risk From 41,557 Patient Records

Suicide risk assessment in psychiatry has long relied on structured interviews and clinical judgment — tools that are useful but imprecise, and that miss warning signs buried in years of prescriptions, diagnoses and prior crisis episodes scattered across a patient’s chart. A study led by Cleofé Peña-Gómez at the Institut d’Investigació i Innovació Parc Taulí (I3PT-CERCA) in Sabadell, Spain, published in JMIR AI in August 2026, set out to see whether machine learning could do better by learning directly from six years of a hospital’s own real-world data.

Six years of records, one hospital system

The team, working with Marc Fradera and Diego Palao and in collaboration with the Barcelona Supercomputing Center, pulled records for 41,557 adult patients treated by the Parc Taulí Mental Health Service between January 1, 2018, and June 1, 2024. After cleaning and harmonizing four distinct data sources — mental health electronic health records, Catalonia’s regional Suicide Risk Code registry, forensic suicide death records, and outpatient medication data — they built an analysis set of 32,661 patients described by 112 clinical features. Within that group, 2,764 patients, or 8.5 percent, had a documented episode of suicidal behavior, giving the models a real, if imbalanced, target to learn from.

What the algorithm actually found

Two model types, GradientBoosting and XGBoost, performed best, reaching a receiver-operating-characteristic area under the curve of roughly 0.95 and overall accuracy above 0.91 — strong numbers by the standards of psychiatric risk prediction, a field where models have historically struggled to beat simple clinical checklists. Sensitivity landed around 0.84 to 0.85, meaning the models caught most true at-risk cases, though precision was lower, around 0.51 to 0.58, meaning a meaningful share of flagged patients would not go on to have a suicidal crisis — the familiar trade-off in any screening tool cast wide enough to avoid missing real risk. The strongest predictive signals were not surprising to clinicians: prior corticosteroid use, prescriptions for olanzapine and lorazepam, female sex, and a documented history of depression. Among patients flagged as high-risk, 82.1 percent had a history of anxiety and 60.9 percent a history of depression episodes.

This is phase two of a four-stage plan

The published results represent phases one and two of a project called IDICIUS — data integration and harmonization, followed by predictive model development. The next stages call for embedding the algorithm directly into the hospital’s clinical information system and prospectively testing its predictions against new patients in real time, rather than retrospectively against historical data, which is a materially higher bar than the current results clear. Only after that validation would the system function as the early-warning tool the project is named for — surfacing a risk score to clinicians during routine care rather than after the fact.

The gap between a strong AUC and a safe deployment

Precision in the 0.5-to-0.6 range means that for every two or so patients the model correctly flags as high-risk, roughly one flagged patient will not go on to attempt suicide — a ratio that could either be seen as an acceptable cost for catching more true cases, or as a recipe for alert fatigue and over-intervention if deployed carelessly across a busy psychiatric service. Critics of EHR-based risk algorithms more broadly have also pointed out that models trained on one health system’s population and prescribing patterns — as this one was, entirely within Catalonia’s public system — may not transfer cleanly to hospitals with different patient demographics, formularies or documentation habits, a limitation the Parc Taulí team itself acknowledges as it moves toward prospective testing.

A wider push toward algorithmic suicide screening

Parc Taulí’s project isn’t isolated. Vanderbilt University Medical Center has been piloting a similar AI suicide-risk alerting system across three of its clinics, and multiple JMIR-published teams have spent 2026 building comparable models from electronic health record data, reflecting a broader shift in psychiatry toward treating years of accumulated clinical documentation as an underused predictive resource rather than just a legal record.

What comes next

If the prospective validation phase holds up the retrospective numbers, Parc Taulí’s model would move from a research paper to a live clinical tool — a risk score appearing alongside a patient’s chart during an ordinary outpatient visit, flagging combinations of medication history and diagnosis that a clinician working from memory might not connect. The real test isn’t the AUC number in the journal; it’s whether flagged patients actually get faster, more targeted follow-up once the system is live, and whether clinicians trust a score enough to act on it without simply adding another alert they learn to click past.

Photo: RDNE Stock project / PEXELS via Pexels