English

Generating patient cohorts from electronic health records using two-step retrieval-augmented text-to-SQL generation

Computation and Language 2025-10-20 v2

Abstract

Clinical cohort definition is crucial for patient recruitment and observational studies, yet translating inclusion/exclusion criteria into SQL queries remains challenging and manual. We present an automated system utilizing large language models that combines criteria parsing, two-level retrieval augmented generation with specialized knowledge bases, medical concept standardization, and SQL generation to retrieve patient cohorts with patient funnels. The system achieves 0.75 F1-score in cohort identification on EHR data, effectively capturing complex temporal and logical relationships. These results demonstrate the feasibility of automated cohort generation for epidemiological research.

Keywords

Cite

@article{arxiv.2502.21107,
  title  = {Generating patient cohorts from electronic health records using two-step retrieval-augmented text-to-SQL generation},
  author = {Angelo Ziletti and Leonardo D'Ambrosi},
  journal= {arXiv preprint arXiv:2502.21107},
  year   = {2025}
}

Comments

13 pages, 1 figure

R2 v1 2026-06-28T22:01:57.200Z