Unified Peripartum Database with Natural-Language-to-SQL Capabilities at Udine University Hospital: Design and Prototype
Doriana Armenise, Ginevra Battello, Andrea Brunello, Lorenza Driul, Angelo Montanari, Elisa Rizzante, Nicola Saccomanno, Andrea Salvador, Serena Xodo, Silvia Zermano
TL;DR
This work tackles fragmented obstetric data across EHRs, spreadsheets, and device archives that impede safety and research. It presents a practical blueprint for a centralized, pregnancy-centered relational database implemented in PostgreSQL, built from a clinician-informed ER model, and complemented by a natural-language-to-SQL interface. Key contributions include integrating maternal, current-pregnancy, intrapartum, delivery, and neonatal data; an NL2SQL layer via SQLChat and XiYanSQL-QwenCoder-32B-2504; and data-integrity safeguards through triggers. The prototype, available on GitHub, demonstrates improved accessibility for audits and exploratory analyses and establishes a foundation for risk assessment, decision support, and reproducible perinatal research.
Abstract
The fragmentation of obstetric information across electronic health record modules, device repositories, and laboratory systems, as it is common in hospitals, hinders both intrapartum care and reproducible research. In this work, we present a practical blueprint for transforming heterogeneous peripartum records into computable, queryable assets by designing and prototyping a unified peripartum relational database with natural-language-to-SQL (NL2SQL) capabilities at the Obstetrics Clinic of Udine University Hospital. Requirements were co-defined with clinicians and formalized as an Entity-Relationship diagram, from which the logical schema and SQL implementation of the database were then derived. The latter integrates heterogeneous sources to connect maternal anamnestic and longitudinal history, current-pregnancy findings, intrapartum course, and delivery and neonatal outcomes. The NL2SQL layer enables clinicians to pose natural-language queries to the system, lowering barriers to audit and exploratory analysis.
