EMR-AGENT: An LLM Agent Framework for Cohort and Feature Extraction from Heterogeneous EHR Databases

Kwanhyung Lee, Sungsoo Hong, Joonhyung Park, Jeonghyeop Lim, Juhwan Choi, Donghwee Yoon, Eunho Yang


Abstract
Electronic medical record (EMR) databases are widely used for clinical machine learning, but their preprocessing remains difficult to reproduce because cohort definitions, patient-level features, and clinical item-code mappings must be adapted to each database schema. We formulate EMR preprocessing as the task of translating study requests into database-specific cohort/feature extraction SQL and local clinical item-code mappings. Existing preprocessing and harmonization frameworks remain difficult to adapt because they rely on dataset-specific rules or predefined input formats. We introduce EMR-AGENT, an LLM-agent framework that reduces reliance on manual rule writing by automating database-specific cohort selection, feature extraction, and clinical code mapping from study requests. EMR-AGENT retrieves schema and documentation context, interacts with live databases through SQL, observes execution results, and refines extraction decisions from error feedback. To enable rigorous evaluation, we develop a benchmarking codebase for three intensive care unit (ICU) databases (MIMIC-III, eICU, and SICdb), covering reference databases and a newer SICdb version released after the backbone’s knowledge cutoff. Across these benchmarks, EMR-AGENT reduces schema-debugging and item-code search effort, enabling reproducible evaluation of preprocessing quality under expert review, while reducing reliance on hand-written database-specific pipelines.
Anthology ID:
2026.findings-emnlp.2210
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
47341–47373
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.2210/
DOI:
Bibkey:
Cite (ACL):
Kwanhyung Lee, Sungsoo Hong, Joonhyung Park, Jeonghyeop Lim, Juhwan Choi, Donghwee Yoon, and Eunho Yang. 2026. EMR-AGENT: An LLM Agent Framework for Cohort and Feature Extraction from Heterogeneous EHR Databases. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 47341–47373, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
EMR-AGENT: An LLM Agent Framework for Cohort and Feature Extraction from Heterogeneous EHR Databases (Lee et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.2210.pdf