Pharmaceutical Practices and Patient OutcomesEmergency and Acute Care StudiesPharmacovigilance and Adverse Drug Reactions

J. Ruiz Ramos, J. Gené Grasa, A. Plaza Díaz, I. Martín Da Silva, M. Castellá Rovira, M. Pedemonte i Pons, Dra. Ana María Juanes Borrego

2026.2.25Journal of Patient Safety and Risk Management

DOI: 10.1177/25160435261426076

tlooto Summary

Two ML-based models for predicting DRPs in ED patients, and their performance with a conventional logistic regression model are compared, using routinely collected data during standard pharmacy working hours to enable early identification of high-risk patients.

Abstract

Drug-related problems (DRPs) are a frequent and preventable source of morbidity in emergency departments (EDs). Machine learning (ML) has the potential to improve early DRP detection and risk stratification. We aimed to develop and validate two ML-based models for predicting DRPs in ED patients, and to compare their performance with a conventional logistic regression model, using routinely collected data during standard pharmacy working hours. We performed a retrospective observational study in the ED of a tertiary university hospital (March–June 2025). Adult patients (≥18 years) with at least one prescribed medication, attended from Monday to Friday 08:00–15:00, were included. Predictors comprised age, sex, ED length of stay, frailty score, triage level, admission diagnosis, planned hospital admission, high-alert medications, and prior isolation of multidrug-resistant bacteria. A random forest (RF) model, a K-means clustering approach, and a multivariate logistic regression model were developed. Model performance was assessed by area under the receiver operating characteristic curve (AUC), sensitivity, specificity, and accuracy in separate training (80%) and validation (20%) cohorts. Of 5064 patients (mean age = 72.1 ± 19.6 years; 53.6% female), 823 (16.2%) presented ≥1 DRP. Medication reconciliation errors were most common (45.5%). In the training cohort, AUCs were 0.685 for logistic regression, 0.720 for RF, and 0.551 for K-means clustering. The RF model achieved sensitivity 0.727 and specificity 0.529, improving logistic regression results (sensitivity 0.864; specificity 0.378). RF decision model modestly outperformed conventional logistic regression for DRP risk stratification in the ED. Integration of such ML tools may enable early identification of high-risk patients.

Citation format

RAMOS, J. Ruiz, et al. Machine learning decision model for predicting the risk of drug-related problems in patients attending the emergency medicine. Journal of Patient Safety and Risk Management, 2026.