Answers are grounded in this paper and cite their sources.
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.
No takes yet. Share an insight, caveat, or question.
Mouta et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: