Reliable Curation of EHR Dataset via Large Language Models under Environmental Constraints

πŸ“… 2025-11-01
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
Medical researchers frequently face barriers in leveraging electronic health record (EHR) data for scientific discovery due to limited SQL proficiency and data visualization expertise. To address this, we propose a privacy-preserving natural language interface that generates accurate SQL queries from user intents without accessing raw patient dataβ€”relying solely on database metadata, few-shot examples, and chain-of-thought reasoning with large language models. Our approach integrates schema-aware prompt engineering with a lightweight secure isolation architecture to enable safe, local query execution. Evaluated on the EHRSQL benchmark subset, our system achieves state-of-the-art execution accuracy while maintaining low latency and computational cost. Critically, all data remains on-premises throughout the pipeline, ensuring strict compliance with patient privacy regulations. This design significantly lowers the technical barrier for clinical researchers while upholding rigorous data governance standards.

Technology Category

Application Category

πŸ“ Abstract
Electronic health records (EHRs) are central to modern healthcare delivery and research; yet, many researchers lack the database expertise necessary to write complex SQL queries or generate effective visualizations, limiting efficient data use and scientific discovery. To address this barrier, we introduce CELEC, a large language model (LLM)-powered framework for automated EHR data extraction and analytics. CELEC translates natural language queries into SQL using a prompting strategy that integrates schema information, few-shot demonstrations, and chain-of-thought reasoning, which together improve accuracy and robustness. On a subset of the EHRSQL benchmark, CELEC achieves execution accuracy comparable to prior systems while maintaining low latency, cost efficiency, and strict privacy by exposing only database metadata to the LLM. CELEC also adheres to strict privacy protocols: the LLM accesses only database metadata (e.g., table and column names), while all query execution occurs securely within the institutional environment, ensuring that no patient-level data is ever transmitted to or shared with the LLM. Ablation studies confirm that each component of the SQL generation pipeline, particularly the few-shot demonstrations, plays a critical role in performance. By lowering technical barriers and enabling medical researchers to query EHR databases directly, CELEC streamlines research workflows and accelerates biomedical discovery.
Problem

Research questions and friction points this paper is trying to address.

Automating EHR data extraction using LLMs for non-technical researchers
Translating natural language to SQL queries with privacy protection
Reducing technical barriers in medical database querying and analytics
Innovation

Methods, ideas, or system contributions that make the work stand out.

LLM framework converts natural language to SQL queries
Uses schema, few-shot examples, and chain-of-thought reasoning
Maintains privacy by only exposing database metadata
πŸ”Ž Similar Papers
No similar papers found.
R
Raymond M. Xiong
Duke University
P
Panyu Chen
Duke University
T
Tianze Dong
Duke University
Jian Lu
Jian Lu
Shenzhen University
Signal processingImage processingMachine Learning
B
Benjamin Goldstein
Duke University
Danyang Zhuo
Danyang Zhuo
Duke University
Distributed SystemsNetworkingOperating Systems
A
Anru R. Zhang
Duke University