Context-Free Grammar-Guided Generation of FHIR Resources Using Large Language Models
Studies in Health Technology and Informatics · 21.05.2026
DOI: 10.3233/shti260725 ↗Kurz gefasst
Fachartikel in der Zeitschrift Studies in Health Technology and Informatics, erschienen am 21.05.2026. Verfasst von Johann Frei und 1 weiteren Autor:innen. Beteiligte Einrichtung: University of Augsburg. Hauptthemen laut MEDLINE: Large Language Models, Health Information Interoperability, Electronic Health Records, Natural Language Processing. Der Volltext ist frei zugänglich (Open Access, CC BY-NC 4.0).
Abstract (Originalsprache)
Large Language Models (LLMs) have shown remarkable capabilities in medical information extraction and data transformation tasks. However, their unstructured outputs pose significant challenges for integration into clinical data pipelines. Fast Healthcare Interoperability Resources (FHIR) provides a standardized data model for encoding and exchanging medical information, yet its complexity, involving deeply nested structures, standardized coding systems, and strict syntactical rules, makes reliable generation challenging. While LLMs can be guided by linguistic grammars during token decoding to enforce structured outputs, designing such grammars for complex standards like FHIR remains difficult. We present a pipeline for synthesizing Context-Free Grammars (CFGs) from FHIR-derived JSON Schemas, enabling schema-conformant structured generation with LLMs. Our approach introduces relaxed key ordering to maintain structural validity while avoiding limitations of strict schema-guided approaches. Through systematic evaluation on 17 test cases across 5 categories using FHIR R5 resources, we demonstrate that CFG-guided generation achieves 76.5% validity in producing valid resources, compared to 41.2% for JSON Schema-guided and 17.6% for unguided generation. Furthermore, our approach successfully enforces value constraints (enumerated types, certain UCUM unit codes) and structural compliance that other methods fail to guarantee. We release our grammar synthesis pipeline as open-source to facilitate adoption in healthcare information systems.
Schlagwörter
MeSH-Schlagwörter (MEDLINE)
Stichwörter der Autor:innen
Autor:innen und Institutionen
- University of Augsburg.
Zitieren
APA
Frei, J., & Kramer, F. (2026). Context-Free Grammar-Guided Generation of FHIR Resources Using Large Language Models. Studies in Health Technology and Informatics. https://doi.org/10.3233/shti260725
Vancouver
Frei J, Kramer F. Context-Free Grammar-Guided Generation of FHIR Resources Using Large Language Models. Studies in Health Technology and Informatics. 2026. doi:10.3233/shti260725
BibTeX
@article{Frei2026,
author = {Frei, Johann and Kramer, Frank},
title = {Context-Free Grammar-Guided Generation of FHIR Resources Using Large Language Models},
journal = {Studies in Health Technology and Informatics},
year = {2026},
doi = {10.3233/shti260725}
}
EUVIMED