麻豆区

Skip to main content Skip to search

YU News

YU News

Student's AI System Turns Plain English Questions into Hospital Database Queries

By Dave DeFusco

At the Katz School鈥檚 2026 Graduate Computer Science and Engineering Research Forum, Jelidah Nayingwa, a student in the Katz School's M.S. in Artificial Intelligence, presented research showing how AI can safely turn plain English questions into the computer code needed to retrieve information from hospital databases, helping clinicians access specific healthcare indicators in seconds instead of waiting days for custom database queries or generating lengthy reports.

Jelidah Nayingwa, a student in the Katz School's M.S. in Artificial Intelligence, developed SAGE-SQL, a system that lets clinicians retrieve hospital data by asking questions in plain English. During testing, the system matched the work of an experienced software developer nine times out of 10 鈥 and caught its own error before the report was used.

Hospitals collect enormous amounts of patient information, from clinic visits and diagnoses to treatments and laboratory tests, but finding one specific piece of information often isn't simple. In many healthcare systems, clinicians report data using a standardized Ministry of Health document known as the HIA2 report. 

The report spans seven pages and contains hundreds of health indicators covering child immunizations, maternal care, HIV services, malaria, outpatient visits and hospital admissions. Because it is a government standard, healthcare facilities generally cannot divide it into smaller reports without formal approval. 

Clinicians who need just one data point, such as the number of outpatient visits by children during a particular month, have two choices. They can ask a software developer to write a custom database query, which may take days, or generate the entire seven-page report and manually search for the single figure they need. 

Nayingwa's project, SAGE-SQL 鈥 Schema-Aware Generation Engine for SQL, aims to eliminate that bottleneck by allowing clinicians and healthcare analysts to ask questions in plain English. The system automatically generates the database query needed to retrieve just the information they need. 

鈥淚 spent about two years working as a software engineer on a large electronic health record system in Zambia,鈥 said Nayingwa. 鈥淒uring that time, I noticed that clinicians and monitoring officers often had to wait days for relatively simple reports because every request depended on a developer writing SQL. The data already existed, but accessing it required deep knowledge of a complex healthcare database.鈥 

Translating plain English questions into accurate database queries, however, is not as simple as asking a chatbot for help. Large AI models can generate code that looks correct but contains subtle mistakes. In healthcare, those mistakes could produce inaccurate reports that affect planning and patient care. 

To prevent that, SAGE-SQL first learns the structure of a hospital's database, including how hundreds of tables relate to one another and how important information is stored. It then checks the SQL it generates in six logical sections instead of waiting until the entire program is complete. 

鈥淚 took a different approach by validating the SQL in six logical sections as it was generated,鈥 said Nayingwa. 鈥淚 often compare it to constructing a building. It鈥檚 much easier to identify and fix a problem while each floor is being built than after the entire structure has been completed.鈥 

That step-by-step validation helped the system closely match the work of an experienced software developer. During testing, SAGE-SQL achieved a nine-out-of-10 exact match with a professionally written hospital reporting procedure. The only difference involved how patient age groups were organized, and the system detected and corrected that issue before the report was used. 

The AI also improves over time. Whenever it identifies and fixes one of its own mistakes, it saves both versions as training examples to help avoid similar errors in the future. Unlike many AI systems that rely on cloud computing, SAGE-SQL runs entirely on local computers. That makes it especially useful in healthcare facilities with unreliable internet access while also helping keep sensitive patient information inside the hospital. 

鈥淥ffline operation was a practical requirement rather than simply a design choice,鈥 said Nayingwa. 鈥淢any healthcare facilities operate in environments where internet connectivity is unreliable, and patient information should remain within the local infrastructure whenever possible.鈥 

Although additional work remains before the system can support every type of healthcare report, Julia Fang, Nayingwa's advisor and program director of the M.S. in Artificial Intelligence, said the research shows that AI systems trained on specialized knowledge can outperform larger, more general models for specific healthcare tasks. 

鈥淏y combining domain knowledge with careful validation, Jelidah has demonstrated an approach that could help healthcare professionals obtain accurate data more quickly while maintaining the reliability that clinical reporting requires,鈥 said Fang.

Share

FacebookTwitterLinkedInWhat's AppEmailPrint

Follow Us