ResearchJournal of Medical Internet Research · Aug 10, 2026
Using Natural Language Processing to Identify Adverse Drug Events Characterized by Medication Replacement in Primary Care Electronic Medical Records: Algorithm and Validation Study
Katz A, Dhankar A, Fransoo G, Gordon Pappas D, Hamad AF, Leong C, et al
Study type: Observational study: it can show a link, but not prove that one thing causes another.
Abstract
Background
Health care systems generate vast amounts of unstructured text, such as clinical notes, which capture nuanced patient experiences, clinical reasoning, and subtle indicators of health status. While health system research has traditionally relied upon structured data, natural language processing (NLP) enables the extraction of this rich textual information. Leveraging NLP could improve the identification and characterization of underreported adverse drug events (ADEs). Objective
The primary objective of this study was to train and evaluate multiple NLP models, including both previously published architectures and a novel model, for the identification of ADEs from clinical notes. Methods
Electronic medical records from the Manitoba Primary Care Research Network (MaPCReN) were used in this study. Clinical notes were annotated to indicate the presence of a possible ADE, the associated words or phrases, and the corresponding drug. A subselection algorithm was applied to ensure sufficient representation of notes containing ADEs for training a robust classifier. The cohort was restricted to patients aged 55 years and older and was annotated in 2 waves: Wave 1 comprised primary care encounter notes selected for a temporally linked emergency department (ED) visit, enriching it for acute presentations, while Wave 2 relaxed this requirement, and its acuity composition was uncharacterized. The annotated data were split into training and test sets. NLP models-including BioBERT, BlueBERT, a large language model (LLM) classifier, and an LLM embeddings-based classifier-were trained on both original clinical notes and notes reformatted into Subjective-Objective-Assessment-Plan (SOAP) structure. To approximate a clinician-inspired reasoning workflow, Mistral-7b-Instruct was used to extract presenting symptoms and generate a ranked list of potential etiologies. Model performance was evaluated using precision, recall, and F1-score. Results
Of the 1085 annotated encounter notes, 355 included ADEs. Across 9 modeling approaches evaluated over 5 random seeds, models trained on SOAP-rewritten notes generally outperformed those trained on original notes. The SOAP Rewrite+ LLM Embeddings Classifier (GritLM-SOAP) achieved the highest mean F1-score (72.53%; 95% CI 62.40%-81.82%), while BioBERT-SOAP weighted achieved the highest mean recall (76.34%; 95% CI 62.69%-89.66%). End-to-end span-level extraction (named entity recognition+relation extraction) on ADE-positive test notes achieved a mean relaxed F1-score of 0.455, with relation extraction identified as the bottleneck. Conclusions
Effective detection of ADEs in clinical notes may benefit from NLP models that approximate the clinical reasoning of health care providers. While the SOAP Rewrite+ LLM Embeddings Classifier demonstrated a reasonable balance of precision and recall, there is room for improvement as models evolve.
Topics
Electronic Health Records; Natural Language Processing; Humans; Primary Health Care; Algorithms; Drug-Related Side Effects and Adverse Reactions; Middle Aged; Manitoba
DOI: 10.2196/86467 · PubMed: 42574465
Spotted a mistake? Suggest a correction
More in Digital Health & AI
ResearchLancet Digit Health · Nov 23, 2026 · Digital Health & AI
ClinicalAge, a framework for modelling ageing trajectories from longitudinal electronic health records in the UK: a model development and validation study
ResearchLancet Digit Health · Nov 23, 2026 · Digital Health & AI
Foundation artificial intelligence models for health recognition by use of face photographs (FAHR-Face): a model development and validation study
ResearchLancet Digit Health · Nov 23, 2026 · Digital Health & AI
A prognostic model for use at labour onset to estimate the risk of severe fetal compromise at birth: a retrospective, model development and validation study
ResearchNPJ Digit Med · Nov 21, 2026 · Digital Health & AI
ECG foundation models for cardiovascular screening in a cohort of young competitive athletes
ResearchJ Med Internet Res · Nov 20, 2026 · Digital Health & AI
Medical Reasoning in Large Language Models: Development and Evaluation of the MedEvalArena Benchmark