YLab · Paper record

Scalable Information Extraction from Free Text Electronic Health Records Using Large Language Models

Bowen Gu, Vivian Shao, Ziqian Liao, Valentina Carducci, Santiago Romero-Brufau, Jie Yang, Rishi Desai

BMC Medical Research Methodology, vol. 25, no. 1, pp. 23, 2025

Abstract

Background A vast amount of potentially useful information such as description of patient symptoms, family, and social history is recorded as free-text notes in electronic health records (EHRs) but is difficult to reliably extract at scale, limiting their utility in research. This study aims to assess whether an "out of the box" implementation of open-source large language models (LLMs) without any fine-tuning can accurately extract social determinants of health (SDoH) data from free-text clinical notes. Methods We conducted a cross-sectional study using EHR data from the Mass General Brigham (MGB) system, analyzing free-text notes for SDoH information. We selected a random sample of 200 patients and manually labeled nine SDoH aspects. Eight advanced open-source LLMs were evaluated against a baseline pattern-matching model. Two human reviewers provided the manual labels, achieving 93% inter-annotator agreement. LLM performance was assessed using accuracy metrics for overall, mentioned, and non-mentioned SDoH, and macro F1 scores. Results LLMs outperformed the baseline pattern-matching approach, particularly for explicitly mentioned SDoH, achieving up to 40% higher Accuracy mentioned . openchat_3.5 was the best-performing model, surpassing the baseline in overall accuracy across all nine SDoH aspects. The refined pipeline with prompt engineering reduced hallucinations and improved accuracy. Conclusions Open-source LLMs are effective and scalable tools for extracting SDoH from unstructured EHRs, surpassing traditional pattern-matching methods. Further refinement and domain-specific training could enhance their utility in clinical research and predictive analytics, improving healthcare outcomes and addressing health disparities.

Contribution highlights

Extracted from the public abstract; no claims have been added.

Code and data

No verified public code or data link is recorded for this paper.

Publication metadata

DOI
10.1186/s12874-025-02470-z
PMID
39871166
PMCID
PMC11773977
Volume
25
Issue
1
Pages / article
23

Version relationship

No separate preprint-to-publication relationship is currently recorded.

BibTeX

@article{Gu2025Scalableinformation,
  title = {Scalable Information Extraction from Free Text Electronic Health Records Using Large Language Models},
  author = {Bowen Gu and Vivian Shao and Ziqian Liao and Valentina Carducci and Santiago Romero-Brufau and Jie Yang and Rishi Desai},
  journal = {BMC Medical Research Methodology},
  year = {2025},
  url = {https://bmcmedresmethodol.biomedcentral.com/articles/10.1186/s12874-024-02411-2},
  doi = {10.1186/s12874-025-02470-z},
  pmid = {39871166},
  volume = {25},
  number = {1},
  pages = {23}
}
← All publications