# Retrieval augmented text-to-SQL generation for epidemiological question answering using electronic health records

Source: [Retrieval augmented text-to-SQL generation for epidemiological question answering using electronic health records](<https://www.sota2.com/research/paper/68fa76771e209131cea6d2b4>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T03:54:27.044Z

Authors: Angelo Ziletti, Leonardo D'Ambrosi

Published: 2024-03-14T09:45:05.000Z

## Abstract

Electronic health records (EHR) and claims data are rich sources of real-world data that reflect patient health status and healthcare utilization. Querying these databases to answer epidemiological questions is challenging due to the intricacy of medical terminology and the need for complex SQL queries. Here, we introduce an end-to-end methodology that combines text-to-SQL generation with retrieval augmented generation (RAG) to answer epidemiological questions using EHR and claims data. We show that our approach, which integrates a medical coding step into the text-to-SQL process, significantly improves the performance over simple prompting. Our findings indicate that although current language models are not yet sufficiently accurate for unsupervised use, RAG offers a promising direction for improving their capabilities, as shown in a realistic industry setting.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2403.09226>)

[PDF](<https://arxiv.org/pdf/2403.09226.pdf>)
