Table of Contents
Fetching ...

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.

Unified Peripartum Database with Natural-Language-to-SQL Capabilities at Udine University Hospital: Design and Prototype

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.
Paper Structure (13 sections, 6 figures, 4 tables)

This paper contains 13 sections, 6 figures, 4 tables.

Figures (6)

  • Figure 1: Current (left) and proposed (right) implementation of the information system. Solid arrows represent human-component or component-component interactions, while dashed arrows represent data flows.
  • Figure 2: Entity-Relationship diagram of the analyzed domain.
  • Figure 3: Logical relational diagram of the analyzed domain.
  • Figure 4: Screenshot of the SQLChat GUI. The panel Current conversation prompt shows the beginning of the automatically generated context prompt.
  • Figure 5: Screenshot of the SQLChat GUI. The main panel shows the dialogue between the user and the NL2SQL agent.
  • ...and 1 more figures