Prompt engineering for epidemiological surveillance: A step toward wider access to public health data analysis through natural language processing
Related Experiment Video
Updated: Nov 2, 2026

A Metadata Extraction Approach for Clinical Case Reports to Enable Advanced Understanding of Biomedical Concepts
Published on: September 20, 2018
Gabriel S Mouta1, Sarah P R Freire2, Giorgio Montesi1
1Laboratory of Molecular Microbiology and Biotechnology, Department of Medical Biotechnology, University of Siena, Siena, 53100, Italy.
Objectives:
The aim of this study was to describe and assess a framework that generates epidemiological analysis scripts from natural-language queries constrained by surveillance data dictionaries.
Study Design:
Methodological framework development with internal consistency assessment.
Methods:
PEFES (Prompt Engineering for Epidemiological Surveillance) restricts large language model output to dictionary-declared variables and coding schemes, validates scope before generating a script, and does not execute code. Two authors with prior programming experience ('raters') submitted identical sets of 22 in-scope and 22 scope-control queries across three case studies (respiratory syncytial virus, influenza A and dengue) using Claude Opus 4.8 and Gemini 3.7 Flash against OpenDataSUS datasets.
Results:
The two raters agreed on the behavior for all 22 scope-control queries: the 17 queries that were expected to be declined did not produce a script, and all 5 in-scope counterparts produced a script. Every source field read was dictionary-declared. Reported values were identical for 14 of the 22 in-scope queries and divergent for 8 (all where a prompt left a choice unstated). One session compared a declared field against wrong-type values, returning empty tables under formatted headings.
Conclusions:
Dictionary constraints restricted which data a generated script could analyze, but not how it was analyzed: reproducibility was dependent on both the prompt and dictionary, not the constraint mechanism alone. Errors within the declared set were identified by rater review, not by the framework, motivating pre-execution type checks or returning unstated choices as clarification requests. PEFES accelerates epidemiological work rather than replacing it, and it is a step toward wider access to surveillance data analysis.
Related Concept Videos
Steps in Outbreak Investigation
Investigation of Disease Outbreaks
Principles of Disease Surveillance
Statistical Methods for Analyzing Epidemiological Data
Introduction to Epidemiology

