Integrating Medication Leaflets Utilizing Fhir and an Llm- Based Question-Answer Pipeline in a Mobile Application | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Integrating Medication Leaflets Utilizing Fhir and an Llm- Based Question-Answer Pipeline in a Mobile Application Katharina Kirchsteiger, Lisa Heiler, Markus Bödenler, Sten Hanke This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8098329/v1 This work is licensed under a CC BY 4.0 License Status: Under Review Version 1 posted 11 You are reading this latest preprint version Abstract In the European Union, all medications must include a paper-based medication leaflet providing essential information. However, challenges with paper leaflets have driven efforts toward digitization and standardization. This paper presents an automated extraction, digitization, and standardization pipeline for medication leaflet information, integrated into a mobile medication management application. The solution extends an existing mobile application prototype by implementing an automated information extraction pipeline and FHIR-based standardization with corresponding user interface adjustments. The back-end was implemented in Python, while the front-end used Flutter and Dart. OpenAI's GPT-4o powered the information extraction service. Extracted information was standardized using FHIR custom profiles, with resources stored in a PostgreSQL database through the HAPI-FHIR server. The application retrieves FHIR resources via RESTful API and HTTP requests. To assess pipeline performance, responses were systematically evaluated. The setup demonstrates an effective approach to information extraction using an LLM-based question-answer pipeline and successful transformation of extracted information into FHIR through template-based mapping. Evaluation revealed that delimited and straightforward information can be reliably extracted. However, recurring errors across different medication leaflets indicate the pipeline requires refinement, particularly for complex and nested information. By addressing these challenges, this approach opens new pathways in information management. This work demonstrates how to combine information extraction and standardization processes, potentially laying groundwork for further research extending the approach to other healthcare areas and broadening its applicability beyond medication leaflets to enhance digital health information management. Large Language Models FHIR Medication Leaflets LLM evaluation Mobile Application Figures Figure 1 Figure 2 Figure 3 Figure 4 1. Introduction Every medication registered and marketed in the European Union (EU) must provide a paper-based medication leaflet with essential information including instructions for proper use, precautions, warnings, and other crucial information [ 1 ]. Content is strictly regulated (in Austria by the Austrian Medicinal Products Act - "Arzneimittelgesetz" (AMG) § 16). Understanding these complex medical texts requires medication literacy—the ability to obtain, understand, and use medication information safely and effectively [ 2 ]. The medication leaflet remains a vital source for ensuring patients have access to essential and regulated information. However, paper leaflets have practical limitations: small font sizes making them hard to read, risk of being lost or discarded, and large size due to extensive content (often exceeding 2000 words), ultimately having ecological impact [ 3 ], [ 4 ], [ 5 ]. The pharmaceutical industry has therefore discussed transitioning to digital formats. Digital leaflets offer several benefits: simpler access to updated information, improved searchability through structured data, multi-system usability, and enhanced accessibility via features like zoom functionality and text-to-speech [ 5 ]. The European Medicines Agency's (EMA) electronic product information (ePI) pilot project selected FHIR (Fast Healthcare Interoperability Resources) as the common standard for harmonizing ePI information [ 6 ]. FHIR is an HL7 standard for exchanging healthcare information electronically, leveraging modern web technologies like REST, XML, and JSON to provide flexible interoperability [ 7 ]. Data standardization, as explained by the FAIR principles, is essential for good data management [ 10 ] FHIR has proven beneficial for medical device connectivity, clinical data management, and patient information coordination [ 8 ], [ 9 ]. Recent research explores Natural Language Processing (NLP) and Large Language Models (LLM) for healthcare information extraction [ 12 ], [ 13 ], [ 14 ], [ 15 ]. [ 16 ], [ 17 ], [ 18 ], though gaps remain in addressing medication leaflet data specifically. This paper describes the development and evaluation of a prototype to perform information extraction from medication leaflets and subsequent standardization using FHIR, with the goal of providing accessible and structured medication information in a mobile application. We investigated FHIR resources and international activities to standardize medication leaflet information. A FHIR Implementation Guide (IG) based on FHIR R5 was developed to extend FHIR resources to cover medication leaflet-specific data aligned with AMG § 16 requirements. An information extraction pipeline integrating an LLM-based question-answer mechanism was developed specifically for medication leaflet data. The response was evaluated to assess the LLM-based pipeline's applicability. A FHIR server was configured for persistent storage of FHIR resources, queried by the mobile application MediScan for information retrieval. This work extends a previous prototype [ 19 ] by enabling more detailed extraction, FHIR-based standardization, and integration of standardized data into the application. 2. Methods The methodology comprised FHIR resource identification and profiling, IG development, and system implementation. Back-end services were developed in Python utilizing fhir.py (v1.4.2) and fhir.resources (v7.1.0), managed by Poetry. Front-end used Flutter (v3.16.0) with Dart (v3.2.0). The prototype employs OpenAI's GPT-4o for information extraction through a customized question-answer pipeline. To evaluate performance, responses were systematically assessed. FHIR resources were stored in PostgreSQL via a locally configured HAPI-FHIR server. 2.1 FHIR Resource Identification To extract medication leaflet information effectively, we investigated leaflets for medications authorized in Austria and utilized AMG § 16 for content requirements. Since no existing FHIR resource fully covers medication leaflet information, we examined available FHIR modules and resources to identify suitable combinations. Data mapping tables assigned AMG § 16 content to FHIR resources. StructureDefinition resources established custom FHIR profiles with tailored structural regulations, incorporating cardinality rules ensuring AMG § 16 compliance. A comprehensive FHIR IG was created using FHIR Short Hand (FSH) and the IG-publisher tool for internal use. 2.2 Extracting Information from a Medication Leaflet by Leveraging an LLM The chosen approach used an LLM with a question-answer pipeline in Python. The service took medication leaflets as txt-files, leveraged the LLM's API for extraction, and saved responses as JSON-files. 2.2.1 LLM-Based Information Extraction Pipeling GPT-4o was selected for its 128,000-token context window and 16,384-token output capacity [ 20 ]. Given leaflet length and the need for detailed structured results, GPT-4o met requirements with each token representing approximately 3/4 of an English word. The model was assigned the role of an eHealth expert for extracting and digitizing medication leaflet information, ensuring streamlined, consistent answers. Temperature was set to zero for reproducible responses. Multiple question sets were created, followed by functionalities for handling medication leaflet files and prompting questions to the LLM. All question sets are available in the repository (see Code Availability). Previously manually written FHIR resources guided question development to align with medication leaflet content. Each set covered content for a specific FHIR resource or information field. Prompt engineering followed OpenAI guidelines [ 21 ] in two stages. Questions were initially asked separately for one leaflet to confirm extraction capability, then complete sets were prompted for one leaflet to verify comprehensive extraction. Responses were evaluated by comparing with the leaflet (ground truth). This process repeated for six leaflets. If gaps emerged—key information not extracted or misinterpreted—questions were refined and previously processed leaflets re-evaluated. This iterative approach ensured question alignment with required content. Each question received a unique JSON key, used also for individual answers (fields). Responses were saved as JSON files for subsequent processing. 2.2.3 Evaluating the LLM’s Response After prompt engineering, LLM responses were evaluated for correctness, completeness, and format adherence. Thirty-six fields were extracted per leaflet for FHIR resource generation. Fifteen fields had predefined formats, with eight requiring enumerations. Fields with predefined formats were visually inspected for structure adherence. Enumerations were checked for completeness; non-enumeration fields were checked for content accuracy by comparing with the leaflet. If responses matched leaflet content without missing or incorrect core information, they were categorized as correct. Incorrect fields received detailed error notes. Evaluation tables documented results for each leaflet. This process confirmed relevant information extraction and data reliability for further processing. Additionally, HAPI-FHIR server validation after FHIR transformation integrated another assessment tool. These steps verified content accuracy for the MediScan application. Ten randomly selected distinct medication leaflets were evaluated (list available in repository). The sample came from Austria-registered medications (AMPI database) after applying filters excluding: narcotic drugs, ointments, band-aids, homeopathic, phytopharmaceutical, and veterinary medications, plus ophthalmic, nasal, subcutaneous, intravenous, and intramuscular medications. This focused on human medicines administered orally by non-healthcare professionals. These exclusions also addressed fundamental differences in required questions and expected standardization structure. After filtering, 5,784 medications remained. Selection used Python's sample() method on the filtered list to eliminate bias. Each field received a binary score: true (1) if correct, false (0) if incorrect. For each question set, mean score was calculated by summing field scores divided by total fields, providing the mean for one set on one leaflet. With ten leaflets, overall mean per question set was calculated by summing mean scores across leaflets divided by leaflet count. Similarly, individual field mean scores summed scores across ten leaflets divided by leaflet count. This approach provided insight into extraction efficacy and identified improvement areas. 2.3 Automated Creation and Validation of FHIR Resources Once leaflet data was extracted and stored as JSON, it was converted to FHIR format through automated resource creation service. This service processed extracted data using template-based mapping. Templates were FHIR resource model classes whose structure aligned with corresponding profiles, combining LLM responses with templates to constitute FHIR resources. Resources were validated using $ validate operation with custom StructureDefinition resources ensuring compliance with structural constraints. After successful validation, resources were combined in a Bundle and sent to HAPI FHIR Server. 2.4 Integrating Standardized Medication Leaflet Information as FHIR Resources into MediScan FHIR resources were integrated into MediScan by addressing the HAPI-FHIR server which returned requisite resources. The hapi-fhir-jpaserver-starter package [ 22 ], an open-source repository from Smile-Digital-Health, set up a local FHIR server. HAPI-FHIR was selected for complete HL7 FHIR standard implementation with relational database. Persistent storage and management used HAPI-FHIR server and PostgreSQL 13, both running locally via Docker. The supplied package is pre-configured for basic use cases; apart from configuring FHIR R5, no further configuration was necessary. For server communication, URI-requests complying with RESTful-API principles were sent as HTTP GET requests, retrieving resources using admission number as identifier. The _revinclude search parameter received all ClinicalUseDefinition resources referencing MedicinalProductDefinition without separate database requests. The Flutter/Dart package fhir 0.12.0 was leveraged for FHIR resources as Dart classes. 3. Results 3.1 Selected FHIR Resources for Mapping Medication Leaflet Information Investigation of medication leaflet structure and official FHIR resources revealed five different FHIR resources from three modules are required to capture all leaflet information. Three identified resources are from the "Specialised" module (Medication Definition category), one from the "Clinical" module ("Medications" category), and one from the Base module ("#1 Entities" category). Resources reference each other to ensure required information is covered and interconnected. Figure 1 illustrates content in AMG § 16-specified order with corresponding FHIR resources and relations, showing only main categories. Two aspects (other names and pack size) specified in AMG § 16 were excluded due to extraction and representation complexity. The Role of the StructureDefinition Resource After identifying five FHIR resources capable of representing medication leaflet content, implementing StructureDefinition resources and profiling became essential to bridge the gap between generic FHIR specifications and stringent AMG § 16 regulatory requirements. While base FHIR resources provided foundational framework for healthcare data representation, they lacked specific constraints and cardinality rules necessary for compliance with legal requirements governing Austrian medication leaflet content. The profiling process enabled custom FHIR profile creation that extended and constrained existing resources to enforce mandatory data elements, specific structural relationships, and validation rules aligned with AMG § 16 specifications. This was critical given medication leaflets constitute legally regulated documents requiring precise adherence to content requirements, ordering, and completeness standards. Custom profiles facilitated automated validation through FHIR $ validate operation, ensuring extracted information met both FHIR R5 standards and regulatory compliance before MediScan integration. Without this profiling layer, the system could not guarantee automatically generated FHIR resources contained all legally mandated information in prescribed format, potentially compromising data quality and regulatory compliance. Profiling the various FHIR Resources Nine FHIR profiles were written to define essential structural regulations and enable validation. Multiple profiles for the same FHIR resource were necessary due to detailed, varied leaflet content. For example, both excipients and active ingredients can be represented using Ingredient resource, but AMG rules differ, requiring separate profiles for different structural requirements. Additionally, the multipurpose ClinicalUseDefinition resource required four profiles addressing different clinical aspects: interactions, contraindications, undesirable effects, and warnings. Furthermore, an MLL-MPD profile (MLL = medication leaflet, MPD = MedicinalProductDefinition), an MLL-MedKnow profile, and an MLLOrg profile were developed. Slicing functions precisely defined structure and meaning of certain profile elements. For example, slicing the dosingGuideline element in MLL-MedKnow profile enabled assigning different rules and meanings to sub-elements, distinguishing between elements like instructions for omitted intake or discontinuation. Other slicing rules were defined in MLL-MedKnow profile for ClinicalUseIssue-array and in MLL-MPD profile for name.part array and contact array. StructureDefinition resources ensured FHIR resources were extended and constrained to specific legal and structural requirements, guaranteeing legally required information can be presented in MediScan. 3.2 A FHIR IG for Austrian Medication Leaflets FHIR IG as specification documents are essential for compositional content processing in other systems or applications. Therefore, designing an HL7 FHIR IG tailored to medication leaflet content was imperative. The IG can be rebuilt from the repository's FSH profiles using SUSHI and IG-publisher tool (see Code Availability). While broader European initiatives exist for standardizing medication-related information, such as EMA's ePI pilot project and implementation guides from European Medicines Regulatory Network Partners (EMRN) and HL7 International Biomedical Research & Regulation Work Group (HL7 BR&R), these approaches were unsuitable for this use case due to fundamental architectural and scope differences. Existing ePI implementation guides primarily focus on document-based representations using FHIR Composition resource as central container, treating entire product information as cohesive document template rather than mapping individual data elements to specific medicinal-related FHIR resources [ 23 ], [ 24 ]. Additionally, these implementations encompass complete ePI scope, including medication leaflets, Summary of Product Characteristics (SmPC), and labeling information, making them overly comprehensive for the targeted medication leaflet-specific application. Furthermore, EMA initiatives are still under development as part of EU4HEALTH program running until 2027 and explicitly labeled as "preview purposes only" rather than for official implementation[ 6 ]. Most critically, existing approaches do not address specific Austrian AMG § 16 regulatory requirements, which mandate particular content organization, cardinality constraints, and validation criteria differing from broader European harmonization goals. Consequently, the developed IG differs by focusing exclusively on medication leaflet content and standardizing it as FHIR resources rather than implementing ePI as document. As medication leaflet is part of ePI, this IG is more concise than ePI implementation guides. Figure 2 provides comprehensive overview of included resources, underlining MLL-MPD profile's central role due to its relations to other profiles. MLL-MedKnow profile is imperative because it contains detailed information about proper medication use instructions. With the ImplementationGuide resource, a graphical user interface (GUI) precisely matching different FHIR profiles was developed. Human-readable visualization, like the logical table created within IG-publisher tool [ 25 ], presents explicit profile structure clearly and understandably. Additionally, textual description of structure elements and cardinality provides detailed insights into specific constraints and requirements. 3.3 Data Processing Pipeline 3.3.1 Information Extraction and Evaluation The information extraction service marked the first step of the data processing pipeline and played critical role in converting unstructured medication leaflet data into structured format and subsequent FHIR conversion. Workflow overview is shown in Fig. 3 . The service consists of two main components: the first handles files and invokes LLM functionality, including selecting appropriate model type for extraction. The second integrates OpenAI's GPT API and functionalities for LLM interaction, primarily combining question set (forming prompt core) with medication leaflet. The prompt is then submitted to the LLM. Two question set processing functionalities were implemented via two distinct model classes: LLMMultiple and LLMSingle. These disparate prompting methods were necessary for varied question set types requiring different treatment. Test and Refinement of the Question-Answer Pipeline The prompt engineering process underwent multiple iterations to refine question sets (prompt core) and ensure satisfactory responses. Key findings are summarized: Addressing Hallucination : A prevalent LLM challenge is hallucination—generating information independently. Unsurprisingly, hallucination occurred during medication leaflet information extraction, with the LLM inventing information not present in leaflets. To overcome this, questions were refined with instructions to only answer if information was included in the leaflet, otherwise answer "None". Formatting Responses : Some responses required enumeration format, for example excipient ingredients, active ingredients, and undesirable effects. For simple enumerations (e.g., semicolon separation), plain instructions sufficed. For complex enumerations including structures like key-value pairs, the LLM required dedicated examples to provide desired format. Token Efficiency : Although GPT-4o provides considerably larger context window than previous models, token utilization remained significant. Dividing questions into separate sets tailored to specific content facilitated token reduction per prompt. In total, five question sets with average eight questions each addressed required information. Compared to prompting all questions together, separate set prompting reduced input and output token utilization. Additionally, this approach improved answer precision by creating more delimited tasks. Multi-Layered-Question Sets : For straightforward information covered in single leaflet sections, single-layered question sets were used. For complex data and particularly nested information covered by large sections—such as different warning types, precautions, interactions, and contraindications—a multi-layered approach was applied. This divides tasks into two distinct layers: first, a higher-level question extracts a chapter or section definitely containing required information from the leaflet. Then, this higher-level response replaces the leaflet in the prompt for subsequent detailed questions within the deeper layer. Dividing overall tasks into discrete sub-tasks facilitated model performance by reducing prompt complexity. Furthermore, multi-layered approach effectively reduced token utilization compared to using entire leaflet as input for each question. Evaluation of the LLM’s Response Evaluation based on ten randomly selected medication leaflets provided valuable insights into LLM efficacy for extracting leaflet information. In 15 of 36 evaluated fields, specific response format was predefined. Specified format included separators for enumerations or response data type, intended to ensure smooth automated data processing. No format deviations were detected during human visual inspection or automated data processing, including generated FHIR resource validation. However, the LLM had problems extracting correct content for both enumerated and non-enumerated fields. This emphasizes the LLM's ability to provide responses in specific predefined formats but demonstrates achieving 100% accuracy in extracting valid information is challenging. Based on notes for fields labeled "false", errors were categorized into four types: Error A (Assignment Errors) : Model extracted information but separated coherent information. Consequently, after processing, information would be presented incorrectly. Error M (Missing Information) : LLM did not extract desired information despite its inclusion in the leaflet. Error I (Interpretation Errors) : Leaflet included unclear or ambiguous information, for example covering multiple administration numbers within single leaflet or including extraordinary individual instructions. The model could not extract relevant information lacking distinct information on which to rely. Error F (False Information) : Generation of false information (hallucination). This arose when hallucination was not addressed by providing LLM instructions (as described in enumeration 1) that requested information must be included in the leaflet. Some fields had recurring errors, such as assignment errors for precautions or missing information in undesirable effects and interactions. Figure 4 depicts different error type distribution per field. Each question set was allocated to specific resource type and evaluated separately by calculating mean score per question set across all ten processed leaflets. The "ORG" question set (extracting manufacturer information) achieved highest score of 1.0 with no errors. The lowest score of 0.4 was achieved by "UNDES" question set (extracting undesirable effects). The "ICW" question set (responsible for extracting precautions among other areas) achieved 0.57. Table 1 summarizes mean score per question set, while Table 2 illustrates mean scores per field, presenting only those scoring below 1, indicating 20 fields had no errors. Heterogeneous structure and varying format of undesirable effects, precautions, and interactions sections present challenges in LLM information extraction, evidenced by low scores. Despite prompt engineering intended to overcome this, diverse format remained an obstacle. However, fields with clearly delimited information—such as indications, excipient ingredients, or dose form—showed higher performance with scores of 0.9 and higher. Their specificity and well-defined structure facilitated successful LLM information extraction. Table 1 Mean score per question set across leaflets, ordered alphabetically; ICW = I nteractions C ontraindications and W arnings, MK = M edication K nowledge; MPD = M edicinal P roduct D efinition, ORG = Org anization, UNDES = Undesirable Effects Question Set Overall Score Profile based on ICW 0,57 ClinicalUseDefinition MK 0,92 MedicationKnowledge MPD 0,94 MedicinalProductDefinition ORG 1,00 Organization UNDES 0,40 ClinicalUseDefinition Table 2 Mean score per field name across leaflets ordered by score in descending order. Field Overall Score Source Profile Admission Number 0.90 MedicinalProductDefinition Full Name 0.90 MedicinalProductDefinition Active Ingredient/strength/doseform 0.90 MedicinalProductDefinition Mode of action 0.80 MedicinalProductDefinition Strength with unit 0.80 MedicinalProductDefinition Addition instructions 0.70 MedicinalProductDefinition Doseform 0.90 MedicationKnowledge Dose and rate 0.90 MedicationKnowledge Dosing instructions 0.90 MedicationKnowledge Instructions on overdose 0.90 MedicationKnowledge Maximum dose per intake 0.80 MedicationKnowledge Instructions how to quit intake 0.80 MedicationKnowledge Warnings 0.80 ClinicalUseDefinition Undesirable effects 0.40 ClinicalUseDefinition Interactions with other medication 0.30 ClinicalUseDefinition Precautions 0.20 ClinicalUseDefinition 3.3.2 Automated Resource Creation, Validation and Storage Several successive steps were developed to automatically create FHIR resources from extracted information and subsequently send them to HAPI FHIR Server. These include functionalities for processing and mapping information to FHIR resources and eventually validating them. Resources were validated using StructureDefinition resources written in FSH to establish custom validation criteria. To avoid sending every FHIR resource separately to FHIR server, resources were sent using Bundle resource. 4. Discussion This paper describes development of an automated medication information processing pipeline extracting information from medication leaflets and standardizing it using FHIR resources. The prototype is integrated in a mobile app (MediScan) built for personal medication management. The processing pipeline addresses automation of medication leaflet data extraction through LLM-based question-answer pipeline and its subsequent transformation into FHIR-compliant resources. By combining NLP techniques with healthcare data standardization, this work demonstrates comprehensive approach to digitizing and structuring regulatory medication information for improved accessibility and interoperability. For information extraction, employing an LLM in question-answer pipeline proved particularly effective for retrieving targeted information from specified input sections. This is evidenced by per-field scores of 0.9 or above for relevant fields. However, performance was less effective for fields encompassing broader, more ambiguous information where section and information within could not be clearly delimited. Recurrence of the same error in certain extraction tasks—such as assignment errors in precautions—suggests the error is likely caused by specific factors, possibly characteristics of medication leaflet format variability or employed question-answer pipeline limitations. This finding indicates these factors could be identified and addressed through targeted analyses and adjustments, demonstrating the approach is, in principle, appropriate. Profiling ensured FHIR resources adhere to legal and structural requirements mandated by AMG § 16. While existing initiatives such as ePI project already employ FHIR as data standard for structuring medication-related information, this research addresses a specific field gap. This work uniquely focuses on medication leaflet information standardization while ensuring AMG § 16 compliance. Although templates and code align with AMG § 16, the underlying method is portable and can be reapplied to other legal frameworks by substituting governing specifications and regenerating profiles, typically with adapted or re-implemented pipeline. These findings contribute to expanding research on leveraging FHIR standards for healthcare information management and dissemination. Moreover, this work demonstrated FHIR is advantageous not only in managing patient-centric healthcare data but also in managing informational data. The mapping mechanism successfully automated FHIR resource creation and handling, especially for use cases involving manageable numbers of FHIR profiles. However, in larger projects with significantly higher numbers of FHIR resources and profiles, the approach may increase code complexity and lead to code base maintenance difficulties. Generally, template-based mapping approach is particularly valuable when applied to specific use cases covering definable numbers of different FHIR resources or profiles and clearly defined information areas. This is evidenced by server-side validation of integrated FHIR resources. The developed FHIR IG was valuable for tailoring MediScan application user interface to specific medication leaflet content and is central for integrating FHIR structure in existing applications. Application integration was enabled by HAPI-FHIR server, which provided persistent storage for FHIR resources and simplified management by building on already existing well-known standard. Information could be retrieved through HTTP requests to the server, enabling efficient, standard-based data management. 5. Limitations FHIR profiles and mapping functionalities focused on orally administered medications, restricting this approach's applicability to other medication types, such as injections and ointments. Additionally, evaluation data was restricted to these conditions, and evaluation was done for small sample size (10), affecting result validity. Although evaluation used medication leaflet as ground truth, the evaluation process itself was conducted by a non-pharmaceutical expert. Such process could potentially result in misjudgments regarding extracted information accuracy. Local setup of HAPI-FHIR server and attached PostgreSQL database only allowed MediScan application testing and use within private network, limiting the application to specific location. This setup suffices for initial proof of concept but does not allow broad usability testing or real-world context use. 6. Future prospects Future prospects should address limitations, such as refining evaluation process by increasing sample size and adding more comprehensive pharmaceutical knowledge through expert collaborations as additional evaluation instance. Furthermore, automating this process would be beneficial, especially with large sample sizes. Future work should extend entire setup—including developed FHIR profiles, mapping functionalities, and evaluation data—to broader medication range beyond orally administered. To enable real-world application, local setup needs replacement by cloud-based approach, allowing independent data access from various devices and locations. Additionally, the information area could be extended or shifted to other healthcare areas, such as medical devices, information for specific treatments, or examination methods, which could become another research focus building on this work. Declarations The authors declare no competing interests. Ethics approval and consent to participate Not applicable. Consent for publication The authors give the full consent for the publication to be published in the Journal of Medical Systems. Funding Not applicable Author Contribution **Katharina Kichsteiger:** Conceptualization, Methodology, Software, Writing – Original draft preparation, Data curation **Sten Hanke** : Supervision, Methodology, Project Administration, Writing- Original draft, Writing - Review & Editing, Validation **Lisa Heiler:** Methodology, Writing - Review & Editing **Markus Bödenler:** Supervision, Writing - Review & Editing. Acknowledgements Not applicable Clinical Trial Number Not applicable Data Availability Medication leaflet data were retrieved from the publicly accessible AMPI ( https:/aspregister.basg.gv.at ). The medication leaflets used in the evaluation are enumerated with their admission number in the provided repository ( ( https:/github.com/kathkirch/leaflet2fhir.git ). The repository also contains the LLM responses for the evaluation and evaluation tables and samples of the generated FHIR resources. The Implementation Guide is fully reproducible from the repository ( https:/github.com/kathkirch/leaflet2fhir.git ). The question sets are provided under /prompts/questionsets. Evaluation notebooks and sampling filters are in /eval/notebooks. References N. Lopes, C. Rodrigues, and E. Pegado, ‘Medication literacy and its social contextuality’, Health (London) , vol. 28, no. 6, pp. 858–876, Nov. 2024. A. Pouliot, R. Vaillancourt, D. Stacey, and P. Suter, ‘Defining and identifying concepts of medication literacy: An international perspective’, Research in Social and Administrative Pharmacy , vol. 14, no. 9, pp. 797–804, Sept. 2018. C. Pires, M. Vigário, and A. Cavaco, ‘Readability of medicinal package leaflets: A systematic review’, Revista de Saude Publica , vol. 49, 2015. H. P. Maat and L. Lentz, ‘Improving the usability of patient information leaflets’, Patient Education and Counseling , vol. 80, no. 1, pp. 113–119, July 2010. C. Skogman-Lindqvist, O. Lapatto-Reiniluoto, M. Sirviö, and M. Sivén, ‘Benefits and challenges of electronic package leaflet (ePL) - review of ePL pilots in hospital settings in Europe’, European Journal of Pharmaceutical Sciences , vol. 191, p. 106605, Dec. 2023. EMA, ‘Electronic product information (ePI)’. n.d. [Online]. Available: https://www.ema.europa.eu/en/human-regulatory-overview/marketing-authorisation/product-information-requirements/electronic-product-information-epi#eu-epi-common-standard-14451 D. Bender and K. Sartipi, ‘HL7 FHIR: An Agile and RESTful approach to healthcare information exchange’, in Proceedings of the 26th IEEE International Symposium on Computer-Based Medical Systems , Porto, Portugal: IEEE, June 2013, pp. 326–331. doi: 10.1109/CBMS.2013.6627810 . N. Pimenta, A. Chaves, R. Sousa, A. Abelha, and H. Peixoto, ‘Interoperability of Clinical Data through FHIR: A review’, Procedia Computer Science , vol. 220, pp. 856–861, Jan. 2023. C. N. Vorisek et al. , ‘Fast Healthcare Interoperability Resources (FHIR) for Interoperability in Health Research: Systematic Review.’, JMIR Medical Informatics , vol. 10, no. 7, p. e35724, July 2022. M. D. Wilkinson et al. , ‘Comment: The FAIR Guiding Principles for scientific data management and stewardship’, Scientific Data , vol. 3, p. 160018, Mar. 2016. A. Niţulescu and L. Stoicu-Tivadar, ‘Data Standardization in the Medical Field Through FHIR and FAIR Implementation: A Systematic Review’, in Digital health and informatics innovations for sustainable health care systems , in Studies in health technology and informatics, vol. 316. Aug. 2024, pp. 1378–1382. I. Li et al. , ‘Neural Natural Language Processing for unstructured data in electronic health records: A review’, Computer Science Review , vol. 46, p. 100511, 2022. B. Adamson et al. , ‘Approach to machine learning for extraction of real-world data variables from electronic health records’, Frontiers in Pharmacology , vol. 14, 2023. N. Afzal et al. , ‘Natural language processing of clinical notes for identification of critical limb ischemia’, International Journal of Medical Informatics , vol. 111, pp. 83–89, 2018. E. Hossain et al. , ‘Natural Language Processing in Electronic Health Records in relation to healthcare decision-making: A systematic review’, vol. 155. p. 106649, 2023. K. Singhal et al. , ‘Large language models encode clinical knowledge’, Nature , vol. 620, pp. 172–180, Aug. 2023. V. Sciannameo et al. , ‘Information extraction from medical case reports using OpenAI InstructGPT’, Computer Methods and Programs in Biomedicine , vol. 255, p. 108326, 2024. J. Dagdelen et al. , ‘Structured information extraction from scientific text with large language models’, Nature Communications , vol. 15, p. 1418, 2024. L. Heiler, K. Kirchsteiger, S. Hartl, O. Perkics, S. Hanke, and M. Bödenler, ‘Integrating AI-Generated Summaries of Medication Leaflets into a Mobile Application for Medication Management’, in Studies in Health Technology and Informatics , J. Mantas, A. Hasman, G. Demiris, K. Saranto, M. Marschollek, T. N. Arvanitis, I. Ognjanović, A. Benis, P. Gallos, E. Zoulias, and E. Andrikopoulou, Eds, IOS Press, 2024. doi: 10.3233/SHTI240524 . OpenAI, ‘Models’. [Online]. Available: https://platform.openai.com/docs/models OpenAI, ‘Prompt engineering’. Accessed: Oct. 03, 2025. [Online]. Available: https://platform.openai.com/docs/guides/prompt-engineering Smile, ‘HAPI FHIR JPA server starter’. [Online]. Available: https://github.com/hapifhir/hapi-fhir-jpaserver-starter EMRN, ‘Home - European Medicines Regulatory Network (EMRN) Electronic Product Information (ePI) Implementation Guide v0.3.0’. 2024. [Online]. Available: https://epi-dev.ema.europa.eu/fhirig/index.html HL7 BR&R, ‘HL7 FHIR implementation guide: Electronic medicinal product information (ePI), release 1’. 2023. [Online]. Available: https://build.fhir.org/ig/HL7/emedicinal-product-info/index.html HL7 International, HL7 FHIR IG Publisher . (2023). [Online]. Available: https://github.com/HL7/fhir-ig-publisher Additional Declarations No competing interests reported. Cite Share Download PDF Status: Under Review Version 1 posted Editorial decision: Revision requested 12 Jan, 2026 Reviews received at journal 12 Jan, 2026 Reviews received at journal 04 Jan, 2026 Reviewers agreed at journal 29 Dec, 2025 Reviews received at journal 27 Dec, 2025 Reviewers agreed at journal 26 Dec, 2025 Reviewers agreed at journal 10 Dec, 2025 Reviewers invited by journal 24 Nov, 2025 Editor assigned by journal 23 Nov, 2025 Submission checks completed at journal 23 Nov, 2025 First submitted to journal 12 Nov, 2025 You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8098329","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":551043963,"identity":"03d4fb82-c1bb-4285-a8cf-5c9deddad98a","order_by":0,"name":"Katharina Kirchsteiger","email":"","orcid":"","institution":"FH Jonneum GmbH – University of Applied Sciences","correspondingAuthor":false,"prefix":"","firstName":"Katharina","middleName":"","lastName":"Kirchsteiger","suffix":""},{"id":551043964,"identity":"eb1eef12-d63a-4127-86a7-1da6d82c7857","order_by":1,"name":"Lisa Heiler","email":"","orcid":"","institution":"FH Jonneum GmbH – University of Applied Sciences","correspondingAuthor":false,"prefix":"","firstName":"Lisa","middleName":"","lastName":"Heiler","suffix":""},{"id":551043965,"identity":"53814fa6-f491-4bab-a88f-633a04be5252","order_by":2,"name":"Markus Bödenler","email":"","orcid":"","institution":"FH Jonneum GmbH – University of Applied Sciences","correspondingAuthor":false,"prefix":"","firstName":"Markus","middleName":"","lastName":"Bödenler","suffix":""},{"id":551043966,"identity":"aba36a78-fd11-400f-a19f-9095ff3187f4","order_by":3,"name":"Sten Hanke","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABEklEQVRIiWNgGAWjYLACxgYGBgkG5gOfGRjYiFDOBtfCljgbRQsPYS08hrNRZHBpkZ/ffOwB4w67PMn2no/NBQx8cvyzew8+5s1hkLfHocXgGFu6AeOZ5GJpnrMbm2cwsBlL3DmXbMy7jcGwB5cWNh4zCcY25sR5ErnbH/P+Y0tsuJFjJg3UwohLi3wb/zeglvrEefJvHjbzAMNg/o0c899ALfa4tDAc42EDajmcOFuChxGsZQPQFmaglkScDjuWZiaR2HY8cWZPmiFIi7HhjRxjybnbJJJ7DuBwWPPhZxIf26oTZxw/DHLYMTm5GzmGH95us7Ftb8DlMiBIQHInjCGBRz0qqCFa5SgYBaNgFIwcAABYL1L6WxHGYgAAAABJRU5ErkJggg==","orcid":"","institution":"FH Jonneum GmbH – University of Applied Sciences","correspondingAuthor":true,"prefix":"","firstName":"Sten","middleName":"","lastName":"Hanke","suffix":""}],"badges":[],"createdAt":"2025-11-12 16:23:21","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8098329/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8098329/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":97138089,"identity":"8fac65a0-100f-4046-a837-5ce6ba09c87e","added_by":"auto","created_at":"2025-12-01 09:58:28","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":1293905,"visible":true,"origin":"","legend":"","description":"","filename":"MediscanPaperv5Springer.docx","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/e4faccfca21a885605791c9a.docx"},{"id":96982549,"identity":"0bcc6ab5-e2b0-4b7f-b4ac-260602729dab","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"json","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":6934,"visible":true,"origin":"","legend":"","description":"","filename":"b6fea5ca10954c56bd44399f02208665.json","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/1490d62e50e7ae88f1d4e32f.json"},{"id":96982551,"identity":"de60d2aa-f8c7-4ab5-b494-8ef3e93a60b3","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"xml","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":79200,"visible":true,"origin":"","legend":"","description":"","filename":"b6fea5ca10954c56bd44399f022086651enriched.xml","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/cb0d8c0fc61495bb0db3730b.xml"},{"id":96982552,"identity":"7bd1afca-1cd2-4013-9116-45969d6f2407","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"png","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":38531,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/4563c143a4a6af379f5e8f57.png"},{"id":96982555,"identity":"ef2c8db0-4f17-46e7-9a26-50ad2831501e","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"png","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":40117,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/32a52024e2c8c8cc8e3ab087.png"},{"id":97137404,"identity":"ae1a2a28-9bfa-423d-afd3-994722a304f5","added_by":"auto","created_at":"2025-12-01 09:57:42","extension":"png","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":70140,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/91df7ce29ece9e270c14c66e.png"},{"id":97138789,"identity":"94a53daa-6e63-43e0-847c-7a878f12e2d0","added_by":"auto","created_at":"2025-12-01 09:59:20","extension":"png","order_by":10,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":71836,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/40884352fb8584edefe8f6e7.png"},{"id":96982558,"identity":"67585df0-d115-4cd6-b18d-29406fa1847c","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"xml","order_by":11,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":80040,"visible":true,"origin":"","legend":"","description":"","filename":"b6fea5ca10954c56bd44399f022086651structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/2654b7f7da777a2e2e1006e8.xml"},{"id":97138303,"identity":"476fa9eb-89d0-4179-8447-0f7c30762854","added_by":"auto","created_at":"2025-12-01 09:58:45","extension":"html","order_by":12,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":87315,"visible":true,"origin":"","legend":"","description":"","filename":"earlyproof.html","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/8097ec7442ac7cb11c998303.html"},{"id":97137158,"identity":"4ed08aba-4702-4a11-807d-46aeda68ae44","added_by":"auto","created_at":"2025-12-01 09:57:24","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":127720,"visible":true,"origin":"","legend":"\u003cp\u003eVisualization of the legally required content of medication leaflets according to AMG §16 (left) and the corresponding FHIR resource types and relationships (right). Color coding links leaflet sections to their respective FHIR resources; the Ingredient resource is highlighted separately due to its inclusion within the MedicinalProductDefinition resource..\u003c/p\u003e","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/2c18b4896e6c2e13d0d3c85a.png"},{"id":96982547,"identity":"3c44438e-6ccd-44a2-a071-8b0770345ddb","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":139527,"visible":true,"origin":"","legend":"\u003cp\u003eVisualization of the medication leaflet (MLL) profiles used (colored rectangles), their parent resources (dashed rounded rectangles), and the relationships between the resources. Relationships depicted as references are shown with solid lines, while dashed lines indicate relationships representing contained resources. Cardinality is presented using UML notation on the arrows, the direction of the relation is shown by the arrow before the label. The color scheme corresponds to those in Figure 1.\u003c/p\u003e","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/9a2e85dd646da7e96919e2a1.png"},{"id":96982550,"identity":"6408c6a9-3196-4280-81ea-2e5879f3e8a5","added_by":"auto","created_at":"2025-11-28 09:36:40","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":263800,"visible":true,"origin":"","legend":"\u003cp\u003eVisualization of the step by step data processing pipeline. The upper half depicts the information extraction service—which loads leaflet text, selects the prompting mode (LLMSingle vs. LLMMultiple), builds and submits prompts to GPT, and saves structured answers—while the lower half shows automated FHIR conversion, validation, bundle creation, and storage on a HAPI FHIR server, from which the mobile app requests and displays the resources.\u003c/p\u003e","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/60fd1925775b81fbe096e250.png"},{"id":97139082,"identity":"c435386d-cdf3-48ad-b86d-7ef82df0c998","added_by":"auto","created_at":"2025-12-01 09:59:37","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":312139,"visible":true,"origin":"","legend":"\u003cp\u003eHeatmap depicting the distribution of error types (A: Assignment Errors, F: False Information, I: Interpretation Errors, M: Missing Information) across various fields. The occurrence is presented by the intensity of the color of each error type for a specific field. The total number of error types are listed in the labels for x-axis.\u003c/p\u003e","description":"","filename":"floatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/1205a711764e4428c0f7a29b.png"},{"id":97144921,"identity":"b98c0c3e-ac1e-4afb-99f7-271bdd1000fc","added_by":"auto","created_at":"2025-12-01 10:12:22","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":1574477,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8098329/v1/af6172af-3da3-4d55-8851-dda4d3d5ad88.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"\u003cp\u003eIntegrating Medication Leaflets Utilizing Fhir and an Llm- Based Question-Answer Pipeline in a Mobile Application\u003c/p\u003e","fulltext":[{"header":"1. Introduction","content":"\u003cp\u003eEvery medication registered and marketed in the European Union (EU) must provide a paper-based medication leaflet with essential information including instructions for proper use, precautions, warnings, and other crucial information [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e].\u003c/p\u003e\u003cp\u003eContent is strictly regulated (in Austria by the Austrian Medicinal Products Act - \"Arzneimittelgesetz\" (AMG) \u0026sect;\u0026nbsp;16). Understanding these complex medical texts requires medication literacy\u0026mdash;the ability to obtain, understand, and use medication information safely and effectively [\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e]. The medication leaflet remains a vital source for ensuring patients have access to essential and regulated information. However, paper leaflets have practical limitations: small font sizes making them hard to read, risk of being lost or discarded, and large size due to extensive content (often exceeding 2000 words), ultimately having ecological impact [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e], [\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e], [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e]. The pharmaceutical industry has therefore discussed transitioning to digital formats. Digital leaflets offer several benefits: simpler access to updated information, improved searchability through structured data, multi-system usability, and enhanced accessibility via features like zoom functionality and text-to-speech [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e]. The European Medicines Agency's (EMA) electronic product information (ePI) pilot project selected FHIR (Fast Healthcare Interoperability Resources) as the common standard for harmonizing ePI information [\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e]. FHIR is an HL7 standard for exchanging healthcare information electronically, leveraging modern web technologies like REST, XML, and JSON to provide flexible interoperability [\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e]. Data standardization, as explained by the FAIR principles, is essential for good data management [\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e] FHIR has proven beneficial for medical device connectivity, clinical data management, and patient information coordination [\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e], [\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e]. Recent research explores Natural Language Processing (NLP) and Large Language Models (LLM) for healthcare information extraction [\u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e12\u003c/span\u003e], [\u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e], [\u003cspan citationid=\"CR14\" class=\"CitationRef\"\u003e14\u003c/span\u003e], [\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e]. [\u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e16\u003c/span\u003e], [\u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e17\u003c/span\u003e], [\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e18\u003c/span\u003e], though gaps remain in addressing medication leaflet data specifically.\u003c/p\u003e\u003cp\u003eThis paper describes the development and evaluation of a prototype to perform information extraction from medication leaflets and subsequent standardization using FHIR, with the goal of providing accessible and structured medication information in a mobile application.\u003c/p\u003e\u003cp\u003eWe investigated FHIR resources and international activities to standardize medication leaflet information. A FHIR Implementation Guide (IG) based on FHIR R5 was developed to extend FHIR resources to cover medication leaflet-specific data aligned with AMG \u0026sect;\u0026nbsp;16 requirements. An information extraction pipeline integrating an LLM-based question-answer mechanism was developed specifically for medication leaflet data. The response was evaluated to assess the LLM-based pipeline's applicability. A FHIR server was configured for persistent storage of FHIR resources, queried by the mobile application MediScan for information retrieval. This work extends a previous prototype [\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e19\u003c/span\u003e] by enabling more detailed extraction, FHIR-based standardization, and integration of standardized data into the application.\u003c/p\u003e"},{"header":"2. Methods","content":"\u003cp\u003eThe methodology comprised FHIR resource identification and profiling, IG development, and system implementation. Back-end services were developed in Python utilizing fhir.py (v1.4.2) and fhir.resources (v7.1.0), managed by Poetry. Front-end used Flutter (v3.16.0) with Dart (v3.2.0). The prototype employs OpenAI's GPT-4o for information extraction through a customized question-answer pipeline. To evaluate performance, responses were systematically assessed. FHIR resources were stored in PostgreSQL via a locally configured HAPI-FHIR server.\u003c/p\u003e\u003cdiv id=\"Sec3\" class=\"Section2\"\u003e\u003ch2\u003e2.1 FHIR Resource Identification\u003c/h2\u003e\u003cp\u003eTo extract medication leaflet information effectively, we investigated leaflets for medications authorized in Austria and utilized AMG \u0026sect;\u0026nbsp;16 for content requirements. Since no existing FHIR resource fully covers medication leaflet information, we examined available FHIR modules and resources to identify suitable combinations. Data mapping tables assigned AMG \u0026sect;\u0026nbsp;16 content to FHIR resources.\u003c/p\u003e\u003cp\u003eStructureDefinition resources established custom FHIR profiles with tailored structural regulations, incorporating cardinality rules ensuring AMG \u0026sect;\u0026nbsp;16 compliance. A comprehensive FHIR IG was created using FHIR Short Hand (FSH) and the IG-publisher tool for internal use.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec4\" class=\"Section2\"\u003e\u003ch2\u003e2.2 Extracting Information from a Medication Leaflet by Leveraging an LLM\u003c/h2\u003e\u003cp\u003eThe chosen approach used an LLM with a question-answer pipeline in Python. The service took medication leaflets as txt-files, leveraged the LLM's API for extraction, and saved responses as JSON-files.\u003c/p\u003e\u003cdiv id=\"Sec5\" class=\"Section3\"\u003e\u003ch2\u003e2.2.1 LLM-Based Information Extraction Pipeling\u003c/h2\u003e\u003cp\u003eGPT-4o was selected for its 128,000-token context window and 16,384-token output capacity [\u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e20\u003c/span\u003e]. Given leaflet length and the need for detailed structured results, GPT-4o met requirements with each token representing approximately 3/4 of an English word. The model was assigned the role of an eHealth expert for extracting and digitizing medication leaflet information, ensuring streamlined, consistent answers. Temperature was set to zero for reproducible responses.\u003c/p\u003e\u003cp\u003eMultiple question sets were created, followed by functionalities for handling medication leaflet files and prompting questions to the LLM. All question sets are available in the repository (see Code Availability). Previously manually written FHIR resources guided question development to align with medication leaflet content. Each set covered content for a specific FHIR resource or information field. Prompt engineering followed OpenAI guidelines [\u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e21\u003c/span\u003e] in two stages. Questions were initially asked separately for one leaflet to confirm extraction capability, then complete sets were prompted for one leaflet to verify comprehensive extraction. Responses were evaluated by comparing with the leaflet (ground truth). This process repeated for six leaflets. If gaps emerged\u0026mdash;key information not extracted or misinterpreted\u0026mdash;questions were refined and previously processed leaflets re-evaluated. This iterative approach ensured question alignment with required content. Each question received a unique JSON key, used also for individual answers (fields). Responses were saved as JSON files for subsequent processing.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec6\" class=\"Section3\"\u003e\u003ch2\u003e2.2.3 Evaluating the LLM\u0026rsquo;s Response\u003c/h2\u003e\u003cp\u003eAfter prompt engineering, LLM responses were evaluated for correctness, completeness, and format adherence. Thirty-six fields were extracted per leaflet for FHIR resource generation. Fifteen fields had predefined formats, with eight requiring enumerations. Fields with predefined formats were visually inspected for structure adherence. Enumerations were checked for completeness; non-enumeration fields were checked for content accuracy by comparing with the leaflet. If responses matched leaflet content without missing or incorrect core information, they were categorized as correct. Incorrect fields received detailed error notes. Evaluation tables documented results for each leaflet. This process confirmed relevant information extraction and data reliability for further processing. Additionally, HAPI-FHIR server validation after FHIR transformation integrated another assessment tool. These steps verified content accuracy for the MediScan application.\u003c/p\u003e\u003cp\u003eTen randomly selected distinct medication leaflets were evaluated (list available in repository). The sample came from Austria-registered medications (AMPI database) after applying filters excluding: narcotic drugs, ointments, band-aids, homeopathic, phytopharmaceutical, and veterinary medications, plus ophthalmic, nasal, subcutaneous, intravenous, and intramuscular medications. This focused on human medicines administered orally by non-healthcare professionals. These exclusions also addressed fundamental differences in required questions and expected standardization structure. After filtering, 5,784 medications remained. Selection used Python's sample() method on the filtered list to eliminate bias.\u003c/p\u003e\u003cp\u003eEach field received a binary score: true (1) if correct, false (0) if incorrect. For each question set, mean score was calculated by summing field scores divided by total fields, providing the mean for one set on one leaflet. With ten leaflets, overall mean per question set was calculated by summing mean scores across leaflets divided by leaflet count. Similarly, individual field mean scores summed scores across ten leaflets divided by leaflet count. This approach provided insight into extraction efficacy and identified improvement areas.\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv id=\"Sec7\" class=\"Section2\"\u003e\u003ch2\u003e2.3 Automated Creation and Validation of FHIR Resources\u003c/h2\u003e\u003cp\u003eOnce leaflet data was extracted and stored as JSON, it was converted to FHIR format through automated resource creation service. This service processed extracted data using template-based mapping. Templates were FHIR resource model classes whose structure aligned with corresponding profiles, combining LLM responses with templates to constitute FHIR resources. Resources were validated using \u003cspan\u003e$\u003c/span\u003evalidate operation with custom StructureDefinition resources ensuring compliance with structural constraints. After successful validation, resources were combined in a Bundle and sent to HAPI FHIR Server.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec8\" class=\"Section2\"\u003e\u003ch2\u003e2.4 Integrating Standardized Medication Leaflet Information as FHIR Resources into MediScan\u003c/h2\u003e\u003cp\u003eFHIR resources were integrated into MediScan by addressing the HAPI-FHIR server which returned requisite resources. The hapi-fhir-jpaserver-starter package [\u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e22\u003c/span\u003e], an open-source repository from Smile-Digital-Health, set up a local FHIR server. HAPI-FHIR was selected for complete HL7 FHIR standard implementation with relational database. Persistent storage and management used HAPI-FHIR server and PostgreSQL 13, both running locally via Docker. The supplied package is pre-configured for basic use cases; apart from configuring FHIR R5, no further configuration was necessary. For server communication, URI-requests complying with RESTful-API principles were sent as HTTP GET requests, retrieving resources using admission number as identifier. The _revinclude search parameter received all ClinicalUseDefinition resources referencing MedicinalProductDefinition without separate database requests. The Flutter/Dart package fhir 0.12.0 was leveraged for FHIR resources as Dart classes.\u003c/p\u003e\u003c/div\u003e"},{"header":"3. Results","content":"\u003cdiv id=\"Sec10\" class=\"Section2\"\u003e\u003ch2\u003e3.1 Selected FHIR Resources for Mapping Medication Leaflet Information\u003c/h2\u003e\u003cp\u003eInvestigation of medication leaflet structure and official FHIR resources revealed five different FHIR resources from three modules are required to capture all leaflet information. Three identified resources are from the \"Specialised\" module (Medication Definition category), one from the \"Clinical\" module (\"Medications\" category), and one from the Base module (\"#1 Entities\" category). Resources reference each other to ensure required information is covered and interconnected. Figure\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e illustrates content in AMG \u0026sect;\u0026nbsp;16-specified order with corresponding FHIR resources and relations, showing only main categories. Two aspects (other names and pack size) specified in AMG \u0026sect;\u0026nbsp;16 were excluded due to extraction and representation complexity.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eThe Role of the StructureDefinition Resource\u003c/b\u003e\u003c/p\u003e\u003cp\u003eAfter identifying five FHIR resources capable of representing medication leaflet content, implementing StructureDefinition resources and profiling became essential to bridge the gap between generic FHIR specifications and stringent AMG \u0026sect;\u0026nbsp;16 regulatory requirements. While base FHIR resources provided foundational framework for healthcare data representation, they lacked specific constraints and cardinality rules necessary for compliance with legal requirements governing Austrian medication leaflet content. The profiling process enabled custom FHIR profile creation that extended and constrained existing resources to enforce mandatory data elements, specific structural relationships, and validation rules aligned with AMG \u0026sect;\u0026nbsp;16 specifications. This was critical given medication leaflets constitute legally regulated documents requiring precise adherence to content requirements, ordering, and completeness standards. Custom profiles facilitated automated validation through FHIR \u003cspan\u003e$\u003c/span\u003evalidate operation, ensuring extracted information met both FHIR R5 standards and regulatory compliance before MediScan integration. Without this profiling layer, the system could not guarantee automatically generated FHIR resources contained all legally mandated information in prescribed format, potentially compromising data quality and regulatory compliance.\u003c/p\u003e\u003cp\u003e\u003cb\u003eProfiling the various FHIR Resources\u003c/b\u003e\u003c/p\u003e\u003cp\u003eNine FHIR profiles were written to define essential structural regulations and enable validation. Multiple profiles for the same FHIR resource were necessary due to detailed, varied leaflet content. For example, both excipients and active ingredients can be represented using Ingredient resource, but AMG rules differ, requiring separate profiles for different structural requirements. Additionally, the multipurpose ClinicalUseDefinition resource required four profiles addressing different clinical aspects: interactions, contraindications, undesirable effects, and warnings. Furthermore, an MLL-MPD profile (MLL\u0026thinsp;=\u0026thinsp;medication leaflet, MPD\u0026thinsp;=\u0026thinsp;MedicinalProductDefinition), an MLL-MedKnow profile, and an MLLOrg profile were developed. Slicing functions precisely defined structure and meaning of certain profile elements. For example, slicing the dosingGuideline element in MLL-MedKnow profile enabled assigning different rules and meanings to sub-elements, distinguishing between elements like instructions for omitted intake or discontinuation. Other slicing rules were defined in MLL-MedKnow profile for ClinicalUseIssue-array and in MLL-MPD profile for name.part array and contact array. StructureDefinition resources ensured FHIR resources were extended and constrained to specific legal and structural requirements, guaranteeing legally required information can be presented in MediScan.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec11\" class=\"Section2\"\u003e\u003ch2\u003e3.2 A FHIR IG for Austrian Medication Leaflets\u003c/h2\u003e\u003cp\u003eFHIR IG as specification documents are essential for compositional content processing in other systems or applications. Therefore, designing an HL7 FHIR IG tailored to medication leaflet content was imperative. The IG can be rebuilt from the repository's FSH profiles using SUSHI and IG-publisher tool (see Code Availability). While broader European initiatives exist for standardizing medication-related information, such as EMA's ePI pilot project and implementation guides from European Medicines Regulatory Network Partners (EMRN) and HL7 International Biomedical Research \u0026amp; Regulation Work Group (HL7 BR\u0026amp;R), these approaches were unsuitable for this use case due to fundamental architectural and scope differences. Existing ePI implementation guides primarily focus on document-based representations using FHIR Composition resource as central container, treating entire product information as cohesive document template rather than mapping individual data elements to specific medicinal-related FHIR resources [\u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e23\u003c/span\u003e], [\u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e24\u003c/span\u003e]. Additionally, these implementations encompass complete ePI scope, including medication leaflets, Summary of Product Characteristics (SmPC), and labeling information, making them overly comprehensive for the targeted medication leaflet-specific application. Furthermore, EMA initiatives are still under development as part of EU4HEALTH program running until 2027 and explicitly labeled as \"preview purposes only\" rather than for official implementation[\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e]. Most critically, existing approaches do not address specific Austrian AMG \u0026sect;\u0026nbsp;16 regulatory requirements, which mandate particular content organization, cardinality constraints, and validation criteria differing from broader European harmonization goals. Consequently, the developed IG differs by focusing exclusively on medication leaflet content and standardizing it as FHIR resources rather than implementing ePI as document. As medication leaflet is part of ePI, this IG is more concise than ePI implementation guides. Figure\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e provides comprehensive overview of included resources, underlining MLL-MPD profile's central role due to its relations to other profiles. MLL-MedKnow profile is imperative because it contains detailed information about proper medication use instructions. With the ImplementationGuide resource, a graphical user interface (GUI) precisely matching different FHIR profiles was developed. Human-readable visualization, like the logical table created within IG-publisher tool [\u003cspan citationid=\"CR25\" class=\"CitationRef\"\u003e25\u003c/span\u003e], presents explicit profile structure clearly and understandably. Additionally, textual description of structure elements and cardinality provides detailed insights into specific constraints and requirements.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec12\" class=\"Section2\"\u003e\u003ch2\u003e3.3 Data Processing Pipeline\u003c/h2\u003e\u003cdiv id=\"Sec13\" class=\"Section3\"\u003e\u003ch2\u003e3.3.1 Information Extraction and Evaluation\u003c/h2\u003e\u003cp\u003eThe information extraction service marked the first step of the data processing pipeline and played critical role in converting unstructured medication leaflet data into structured format and subsequent FHIR conversion. Workflow overview is shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e. The service consists of two main components: the first handles files and invokes LLM functionality, including selecting appropriate model type for extraction. The second integrates OpenAI's GPT API and functionalities for LLM interaction, primarily combining question set (forming prompt core) with medication leaflet. The prompt is then submitted to the LLM. Two question set processing functionalities were implemented via two distinct model classes: LLMMultiple and LLMSingle. These disparate prompting methods were necessary for varied question set types requiring different treatment.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eTest and Refinement of the Question-Answer Pipeline\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe prompt engineering process underwent multiple iterations to refine question sets (prompt core) and ensure satisfactory responses. Key findings are summarized:\u003c/p\u003e\u003cp\u003e\u003col\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eAddressing Hallucination\u003c/b\u003e: A prevalent LLM challenge is hallucination\u0026mdash;generating information independently. Unsurprisingly, hallucination occurred during medication leaflet information extraction, with the LLM inventing information not present in leaflets. To overcome this, questions were refined with instructions to only answer if information was included in the leaflet, otherwise answer \"None\".\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eFormatting Responses\u003c/b\u003e: Some responses required enumeration format, for example excipient ingredients, active ingredients, and undesirable effects. For simple enumerations (e.g., semicolon separation), plain instructions sufficed. For complex enumerations including structures like key-value pairs, the LLM required dedicated examples to provide desired format.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eToken Efficiency\u003c/b\u003e: Although GPT-4o provides considerably larger context window than previous models, token utilization remained significant. Dividing questions into separate sets tailored to specific content facilitated token reduction per prompt. In total, five question sets with average eight questions each addressed required information. Compared to prompting all questions together, separate set prompting reduced input and output token utilization. Additionally, this approach improved answer precision by creating more delimited tasks.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eMulti-Layered-Question Sets\u003c/b\u003e: For straightforward information covered in single leaflet sections, single-layered question sets were used. For complex data and particularly nested information covered by large sections\u0026mdash;such as different warning types, precautions, interactions, and contraindications\u0026mdash;a multi-layered approach was applied. This divides tasks into two distinct layers: first, a higher-level question extracts a chapter or section definitely containing required information from the leaflet. Then, this higher-level response replaces the leaflet in the prompt for subsequent detailed questions within the deeper layer. Dividing overall tasks into discrete sub-tasks facilitated model performance by reducing prompt complexity. Furthermore, multi-layered approach effectively reduced token utilization compared to using entire leaflet as input for each question.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003c/ol\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eEvaluation of the LLM\u0026rsquo;s Response\u003c/b\u003e\u003c/p\u003e\u003cp\u003eEvaluation based on ten randomly selected medication leaflets provided valuable insights into LLM efficacy for extracting leaflet information. In 15 of 36 evaluated fields, specific response format was predefined. Specified format included separators for enumerations or response data type, intended to ensure smooth automated data processing. No format deviations were detected during human visual inspection or automated data processing, including generated FHIR resource validation. However, the LLM had problems extracting correct content for both enumerated and non-enumerated fields. This emphasizes the LLM's ability to provide responses in specific predefined formats but demonstrates achieving 100% accuracy in extracting valid information is challenging.\u003c/p\u003e\u003cp\u003eBased on notes for fields labeled \"false\", errors were categorized into four types:\u003c/p\u003e\u003cp\u003e\u003col\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eError A (Assignment Errors)\u003c/b\u003e: Model extracted information but separated coherent information. Consequently, after processing, information would be presented incorrectly.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eError M (Missing Information)\u003c/b\u003e: LLM did not extract desired information despite its inclusion in the leaflet.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eError I (Interpretation Errors)\u003c/b\u003e: Leaflet included unclear or ambiguous information, for example covering multiple administration numbers within single leaflet or including extraordinary individual instructions. The model could not extract relevant information lacking distinct information on which to rely.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eError F (False Information)\u003c/b\u003e: Generation of false information (hallucination). This arose when hallucination was not addressed by providing LLM instructions (as described in enumeration 1) that requested information must be included in the leaflet.\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003c/ol\u003e\u003c/p\u003e\u003cp\u003eSome fields had recurring errors, such as assignment errors for precautions or missing information in undesirable effects and interactions. Figure\u0026nbsp;\u003cspan refid=\"Fig4\" class=\"InternalRef\"\u003e4\u003c/span\u003e depicts different error type distribution per field.\u003c/p\u003e\u003cp\u003eEach question set was allocated to specific resource type and evaluated separately by calculating mean score per question set across all ten processed leaflets. The \"ORG\" question set (extracting manufacturer information) achieved highest score of 1.0 with no errors. The lowest score of 0.4 was achieved by \"UNDES\" question set (extracting undesirable effects). The \"ICW\" question set (responsible for extracting precautions among other areas) achieved 0.57.\u003c/p\u003e\u003cp\u003eTable\u0026nbsp;\u003cspan refid=\"Tab1\" class=\"InternalRef\"\u003e1\u003c/span\u003e summarizes mean score per question set, while Table \u003cspan refid=\"Tab2\" class=\"InternalRef\"\u003e2\u003c/span\u003e illustrates mean scores per field, presenting only those scoring below 1, indicating 20 fields had no errors.\u003c/p\u003e\u003cp\u003eHeterogeneous structure and varying format of undesirable effects, precautions, and interactions sections present challenges in LLM information extraction, evidenced by low scores. Despite prompt engineering intended to overcome this, diverse format remained an obstacle. However, fields with clearly delimited information\u0026mdash;such as indications, excipient ingredients, or dose form\u0026mdash;showed higher performance with scores of 0.9 and higher. Their specificity and well-defined structure facilitated successful LLM information extraction.\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab1\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eMean score per question set across leaflets, ordered alphabetically; ICW\u0026thinsp;=\u0026thinsp;\u003cb\u003eI\u003c/b\u003enteractions \u003cb\u003eC\u003c/b\u003eontraindications and \u003cb\u003eW\u003c/b\u003earnings, MK\u0026thinsp;=\u0026thinsp;\u003cb\u003eM\u003c/b\u003eedication\u003cb\u003eK\u003c/b\u003enowledge; MPD\u0026thinsp;=\u0026thinsp;\u003cb\u003eM\u003c/b\u003eedicinal\u003cb\u003eP\u003c/b\u003eroduct\u003cb\u003eD\u003c/b\u003eefinition, ORG\u0026thinsp;=\u0026thinsp;\u003cb\u003eOrg\u003c/b\u003eanization, UNDES\u0026thinsp;=\u0026thinsp;Undesirable Effects\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"3\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eQuestion Set\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eOverall Score\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eProfile based on\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eICW\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0,57\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eClinicalUseDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMK\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0,92\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMPD\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0,94\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eORG\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e1,00\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eOrganization\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eUNDES\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0,40\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eClinicalUseDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab2\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eMean score per field name across leaflets ordered by score in descending order.\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"3\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eField\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eOverall Score\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eSource Profile\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eAdmission Number\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eFull Name\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eActive Ingredient/strength/doseform\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMode of action\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.80\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eStrength with unit\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.80\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eAddition instructions\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.70\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicinalProductDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eDoseform\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eDose and rate\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eDosing instructions\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eInstructions on overdose\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMaximum dose per intake\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.80\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eInstructions how to quit intake\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.80\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eMedicationKnowledge\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eWarnings\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.80\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eClinicalUseDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eUndesirable effects\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.40\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eClinicalUseDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eInteractions with other medication\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.30\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eClinicalUseDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003ePrecautions\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.20\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eClinicalUseDefinition\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec14\" class=\"Section3\"\u003e\u003ch2\u003e3.3.2 Automated Resource Creation, Validation and Storage\u003c/h2\u003e\u003cp\u003eSeveral successive steps were developed to automatically create FHIR resources from extracted information and subsequently send them to HAPI FHIR Server. These include functionalities for processing and mapping information to FHIR resources and eventually validating them. Resources were validated using StructureDefinition resources written in FSH to establish custom validation criteria. To avoid sending every FHIR resource separately to FHIR server, resources were sent using Bundle resource.\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e"},{"header":"4. Discussion","content":"\u003cp\u003eThis paper describes development of an automated medication information processing pipeline extracting information from medication leaflets and standardizing it using FHIR resources. The prototype is integrated in a mobile app (MediScan) built for personal medication management. The processing pipeline addresses automation of medication leaflet data extraction through LLM-based question-answer pipeline and its subsequent transformation into FHIR-compliant resources. By combining NLP techniques with healthcare data standardization, this work demonstrates comprehensive approach to digitizing and structuring regulatory medication information for improved accessibility and interoperability.\u003c/p\u003e\u003cp\u003eFor information extraction, employing an LLM in question-answer pipeline proved particularly effective for retrieving targeted information from specified input sections. This is evidenced by per-field scores of 0.9 or above for relevant fields. However, performance was less effective for fields encompassing broader, more ambiguous information where section and information within could not be clearly delimited. Recurrence of the same error in certain extraction tasks\u0026mdash;such as assignment errors in precautions\u0026mdash;suggests the error is likely caused by specific factors, possibly characteristics of medication leaflet format variability or employed question-answer pipeline limitations. This finding indicates these factors could be identified and addressed through targeted analyses and adjustments, demonstrating the approach is, in principle, appropriate.\u003c/p\u003e\u003cp\u003eProfiling ensured FHIR resources adhere to legal and structural requirements mandated by AMG \u0026sect;\u0026nbsp;16. While existing initiatives such as ePI project already employ FHIR as data standard for structuring medication-related information, this research addresses a specific field gap. This work uniquely focuses on medication leaflet information standardization while ensuring AMG \u0026sect;\u0026nbsp;16 compliance. Although templates and code align with AMG \u0026sect;\u0026nbsp;16, the underlying method is portable and can be reapplied to other legal frameworks by substituting governing specifications and regenerating profiles, typically with adapted or re-implemented pipeline. These findings contribute to expanding research on leveraging FHIR standards for healthcare information management and dissemination. Moreover, this work demonstrated FHIR is advantageous not only in managing patient-centric healthcare data but also in managing informational data. The mapping mechanism successfully automated FHIR resource creation and handling, especially for use cases involving manageable numbers of FHIR profiles. However, in larger projects with significantly higher numbers of FHIR resources and profiles, the approach may increase code complexity and lead to code base maintenance difficulties. Generally, template-based mapping approach is particularly valuable when applied to specific use cases covering definable numbers of different FHIR resources or profiles and clearly defined information areas. This is evidenced by server-side validation of integrated FHIR resources. The developed FHIR IG was valuable for tailoring MediScan application user interface to specific medication leaflet content and is central for integrating FHIR structure in existing applications. Application integration was enabled by HAPI-FHIR server, which provided persistent storage for FHIR resources and simplified management by building on already existing well-known standard. Information could be retrieved through HTTP requests to the server, enabling efficient, standard-based data management.\u003c/p\u003e"},{"header":"5. Limitations","content":"\u003cp\u003eFHIR profiles and mapping functionalities focused on orally administered medications, restricting this approach's applicability to other medication types, such as injections and ointments. Additionally, evaluation data was restricted to these conditions, and evaluation was done for small sample size (10), affecting result validity. Although evaluation used medication leaflet as ground truth, the evaluation process itself was conducted by a non-pharmaceutical expert. Such process could potentially result in misjudgments regarding extracted information accuracy. Local setup of HAPI-FHIR server and attached PostgreSQL database only allowed MediScan application testing and use within private network, limiting the application to specific location. This setup suffices for initial proof of concept but does not allow broad usability testing or real-world context use.\u003c/p\u003e"},{"header":"6. Future prospects","content":"\u003cp\u003eFuture prospects should address limitations, such as refining evaluation process by increasing sample size and adding more comprehensive pharmaceutical knowledge through expert collaborations as additional evaluation instance. Furthermore, automating this process would be beneficial, especially with large sample sizes. Future work should extend entire setup\u0026mdash;including developed FHIR profiles, mapping functionalities, and evaluation data\u0026mdash;to broader medication range beyond orally administered. To enable real-world application, local setup needs replacement by cloud-based approach, allowing independent data access from various devices and locations. Additionally, the information area could be extended or shifted to other healthcare areas, such as medical devices, information for specific treatments, or examination methods, which could become another research focus building on this work.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003eThe authors declare no competing interests.\u003c/p\u003e\u003ch2\u003eEthics approval and consent to participate\u003c/h2\u003e\u003cp\u003eNot applicable.\u003c/p\u003e\u003c/p\u003e\u003cp\u003e\u003cstrong\u003eConsent for publication\u003c/strong\u003e\u003cp\u003eThe authors give the full consent for the publication to be published in the Journal of Medical Systems.\u003c/p\u003e\u003c/p\u003e\u003ch2\u003eFunding\u003c/h2\u003e\u003cp\u003eNot applicable\u003c/p\u003e\u003ch2\u003eAuthor Contribution\u003c/h2\u003e\u003cp\u003e**Katharina Kichsteiger:** Conceptualization, Methodology, Software, Writing \u0026ndash; Original draft preparation, Data curation **Sten Hanke** : Supervision, Methodology, Project Administration, Writing- Original draft, Writing - Review \u0026amp;amp; Editing, Validation **Lisa Heiler:** Methodology, Writing - Review \u0026amp;amp; Editing **Markus B\u0026ouml;denler:** Supervision, Writing - Review \u0026amp;amp; Editing.\u003c/p\u003e\u003ch2\u003eAcknowledgements\u003c/h2\u003e\u003cp\u003eNot applicable\u003c/p\u003e\u003cp\u003eClinical Trial Number\u003c/p\u003e\u003cp\u003eNot applicable\u003c/p\u003e\u003ch2\u003eData Availability\u003c/h2\u003e\u003cp\u003eMedication leaflet data were retrieved from the publicly accessible AMPI ( https:/aspregister.basg.gv.at ). The medication leaflets used in the evaluation are enumerated with their admission number in the provided repository ( ( https:/github.com/kathkirch/leaflet2fhir.git ). The repository also contains the LLM responses for the evaluation and evaluation tables and samples of the generated FHIR resources. The Implementation Guide is fully reproducible from the repository ( https:/github.com/kathkirch/leaflet2fhir.git ). The question sets are provided under /prompts/questionsets. Evaluation notebooks and sampling filters are in /eval/notebooks.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\u003cli\u003e\u003cspan\u003eN. Lopes, C. Rodrigues, and E. Pegado, \u0026lsquo;Medication literacy and its social contextuality\u0026rsquo;, \u003cem\u003eHealth (London)\u003c/em\u003e, vol. 28, no. 6, pp. 858\u0026ndash;876, Nov. 2024.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eA. Pouliot, R. Vaillancourt, D. Stacey, and P. Suter, \u0026lsquo;Defining and identifying concepts of medication literacy: An international perspective\u0026rsquo;, \u003cem\u003eResearch in Social and Administrative Pharmacy\u003c/em\u003e, vol. 14, no. 9, pp. 797\u0026ndash;804, Sept. 2018.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eC. Pires, M. Vig\u0026aacute;rio, and A. Cavaco, \u0026lsquo;Readability of medicinal package leaflets: A systematic review\u0026rsquo;, \u003cem\u003eRevista de Saude Publica\u003c/em\u003e, vol. 49, 2015.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eH. P. Maat and L. Lentz, \u0026lsquo;Improving the usability of patient information leaflets\u0026rsquo;, \u003cem\u003ePatient Education and Counseling\u003c/em\u003e, vol. 80, no. 1, pp. 113\u0026ndash;119, July 2010.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eC. Skogman-Lindqvist, O. Lapatto-Reiniluoto, M. Sirvi\u0026ouml;, and M. Siv\u0026eacute;n, \u0026lsquo;Benefits and challenges of electronic package leaflet (ePL) - review of ePL pilots in hospital settings in Europe\u0026rsquo;, \u003cem\u003eEuropean Journal of Pharmaceutical Sciences\u003c/em\u003e, vol. 191, p. 106605, Dec. 2023.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eEMA, \u0026lsquo;Electronic product information (ePI)\u0026rsquo;. n.d. [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://www.ema.europa.eu/en/human-regulatory-overview/marketing-authorisation/product-information-requirements/electronic-product-information-epi#eu-epi-common-standard-14451\u003c/span\u003e\u003cspan address=\"https://www.ema.europa.eu/en/human-regulatory-overview/marketing-authorisation/product-information-requirements/electronic-product-information-epi#eu-epi-common-standard-14451\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eD. Bender and K. Sartipi, \u0026lsquo;HL7 FHIR: An Agile and RESTful approach to healthcare information exchange\u0026rsquo;, in \u003cem\u003eProceedings of the 26th IEEE International Symposium on Computer-Based Medical Systems\u003c/em\u003e, Porto, Portugal: IEEE, June 2013, pp. 326\u0026ndash;331. doi: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003e10.1109/CBMS.2013.6627810\u003c/span\u003e\u003cspan address=\"10.1109/CBMS.2013.6627810\" targettype=\"DOI\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eN. Pimenta, A. Chaves, R. Sousa, A. Abelha, and H. Peixoto, \u0026lsquo;Interoperability of Clinical Data through FHIR: A review\u0026rsquo;, \u003cem\u003eProcedia Computer Science\u003c/em\u003e, vol. 220, pp. 856\u0026ndash;861, Jan. 2023.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eC. N. Vorisek \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Fast Healthcare Interoperability Resources (FHIR) for Interoperability in Health Research: Systematic Review.\u0026rsquo;, \u003cem\u003eJMIR Medical Informatics\u003c/em\u003e, vol. 10, no. 7, p. e35724, July 2022.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eM. D. Wilkinson \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Comment: The FAIR Guiding Principles for scientific data management and stewardship\u0026rsquo;, \u003cem\u003eScientific Data\u003c/em\u003e, vol. 3, p. 160018, Mar. 2016.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eA. Niţulescu and L. Stoicu-Tivadar, \u0026lsquo;Data Standardization in the Medical Field Through FHIR and FAIR Implementation: A Systematic Review\u0026rsquo;, in \u003cem\u003eDigital health and informatics innovations for sustainable health care systems\u003c/em\u003e, in Studies in health technology and informatics, vol. 316. Aug. 2024, pp. 1378\u0026ndash;1382.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eI. Li \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Neural Natural Language Processing for unstructured data in electronic health records: A review\u0026rsquo;, \u003cem\u003eComputer Science Review\u003c/em\u003e, vol. 46, p. 100511, 2022.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eB. Adamson \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Approach to machine learning for extraction of real-world data variables from electronic health records\u0026rsquo;, \u003cem\u003eFrontiers in Pharmacology\u003c/em\u003e, vol. 14, 2023.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eN. Afzal \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Natural language processing of clinical notes for identification of critical limb ischemia\u0026rsquo;, \u003cem\u003eInternational Journal of Medical Informatics\u003c/em\u003e, vol. 111, pp. 83\u0026ndash;89, 2018.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eE. Hossain \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Natural Language Processing in Electronic Health Records in relation to healthcare decision-making: A systematic review\u0026rsquo;, vol. 155. p. 106649, 2023.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eK. Singhal \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Large language models encode clinical knowledge\u0026rsquo;, \u003cem\u003eNature\u003c/em\u003e, vol. 620, pp. 172\u0026ndash;180, Aug. 2023.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eV. Sciannameo \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Information extraction from medical case reports using OpenAI InstructGPT\u0026rsquo;, \u003cem\u003eComputer Methods and Programs in Biomedicine\u003c/em\u003e, vol. 255, p. 108326, 2024.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eJ. Dagdelen \u003cem\u003eet al.\u003c/em\u003e, \u0026lsquo;Structured information extraction from scientific text with large language models\u0026rsquo;, \u003cem\u003eNature Communications\u003c/em\u003e, vol. 15, p. 1418, 2024.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eL. Heiler, K. Kirchsteiger, S. Hartl, O. Perkics, S. Hanke, and M. B\u0026ouml;denler, \u0026lsquo;Integrating AI-Generated Summaries of Medication Leaflets into a Mobile Application for Medication Management\u0026rsquo;, in \u003cem\u003eStudies in Health Technology and Informatics\u003c/em\u003e, J. Mantas, A. Hasman, G. Demiris, K. Saranto, M. Marschollek, T. N. Arvanitis, I. Ognjanović, A. Benis, P. Gallos, E. Zoulias, and E. Andrikopoulou, Eds, IOS Press, 2024. doi: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003e10.3233/SHTI240524\u003c/span\u003e\u003cspan address=\"10.3233/SHTI240524\" targettype=\"DOI\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eOpenAI, \u0026lsquo;Models\u0026rsquo;. [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://platform.openai.com/docs/models\u003c/span\u003e\u003cspan address=\"https://platform.openai.com/docs/models\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eOpenAI, \u0026lsquo;Prompt engineering\u0026rsquo;. Accessed: Oct. 03, 2025. [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://platform.openai.com/docs/guides/prompt-engineering\u003c/span\u003e\u003cspan address=\"https://platform.openai.com/docs/guides/prompt-engineering\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eSmile, \u0026lsquo;HAPI FHIR JPA server starter\u0026rsquo;. [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://github.com/hapifhir/hapi-fhir-jpaserver-starter\u003c/span\u003e\u003cspan address=\"https://github.com/hapifhir/hapi-fhir-jpaserver-starter\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eEMRN, \u0026lsquo;Home - European Medicines Regulatory Network (EMRN) Electronic Product Information (ePI) Implementation Guide v0.3.0\u0026rsquo;. 2024. [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://epi-dev.ema.europa.eu/fhirig/index.html\u003c/span\u003e\u003cspan address=\"https://epi-dev.ema.europa.eu/fhirig/index.html\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eHL7 BR\u0026amp;R, \u0026lsquo;HL7 FHIR implementation guide: Electronic medicinal product information (ePI), release 1\u0026rsquo;. 2023. [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://build.fhir.org/ig/HL7/emedicinal-product-info/index.html\u003c/span\u003e\u003cspan address=\"https://build.fhir.org/ig/HL7/emedicinal-product-info/index.html\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eHL7 International, \u003cem\u003eHL7 FHIR IG Publisher\u003c/em\u003e. (2023). [Online]. Available: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://github.com/HL7/fhir-ig-publisher\u003c/span\u003e\u003cspan address=\"https://github.com/HL7/fhir-ig-publisher\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"highlight":"","institution":"","isAcceptedByJournal":true,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"journal-of-medical-systems","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"","sideBox":"Learn more about [Journal of Medical Systems](https://www.springer.com/journal/10916)","snPcode":"10916","submissionUrl":"https://submission.nature.com/new-submission/10916/3","title":"Journal of Medical Systems","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false},"keywords":"Large Language Models, FHIR, Medication Leaflets, LLM evaluation, Mobile Application","lastPublishedDoi":"10.21203/rs.3.rs-8098329/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8098329/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eIn the European Union, all medications must include a paper-based medication leaflet providing essential information. However, challenges with paper leaflets have driven efforts toward digitization and standardization. This paper presents an automated extraction, digitization, and standardization pipeline for medication leaflet information, integrated into a mobile medication management application. The solution extends an existing mobile application prototype by implementing an automated information extraction pipeline and FHIR-based standardization with corresponding user interface adjustments. The back-end was implemented in Python, while the front-end used Flutter and Dart. OpenAI's GPT-4o powered the information extraction service. Extracted information was standardized using FHIR custom profiles, with resources stored in a PostgreSQL database through the HAPI-FHIR server. The application retrieves FHIR resources via RESTful API and HTTP requests. To assess pipeline performance, responses were systematically evaluated. The setup demonstrates an effective approach to information extraction using an LLM-based question-answer pipeline and successful transformation of extracted information into FHIR through template-based mapping. Evaluation revealed that delimited and straightforward information can be reliably extracted. However, recurring errors across different medication leaflets indicate the pipeline requires refinement, particularly for complex and nested information. By addressing these challenges, this approach opens new pathways in information management. This work demonstrates how to combine information extraction and standardization processes, potentially laying groundwork for further research extending the approach to other healthcare areas and broadening its applicability beyond medication leaflets to enhance digital health information management.\u003c/p\u003e","manuscriptTitle":"Integrating Medication Leaflets Utilizing Fhir and an Llm- Based Question-Answer Pipeline in a Mobile Application","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-11-28 09:36:36","doi":"10.21203/rs.3.rs-8098329/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Revision requested","date":"2026-01-12T22:29:59+00:00","index":"","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-01-12T15:33:54+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-01-04T14:53:03+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"261816277362606253785261463818512550043","date":"2025-12-29T17:25:04+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2025-12-28T03:46:27+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"161109527233214794918092116618989396014","date":"2025-12-26T20:14:55+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"307520744988591099065425204037938054328","date":"2025-12-10T17:25:41+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2025-11-24T06:49:54+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2025-11-24T04:52:31+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2025-11-24T03:22:07+00:00","index":"","fulltext":""},{"type":"submitted","content":"Journal of Medical Systems","date":"2025-11-12T16:12:20+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"journal-of-medical-systems","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"","sideBox":"Learn more about [Journal of Medical Systems](https://www.springer.com/journal/10916)","snPcode":"10916","submissionUrl":"https://submission.nature.com/new-submission/10916/3","title":"Journal of Medical Systems","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false}}],"origin":"","ownerIdentity":"80c57efd-8798-44c3-b9a2-1a738916a3cd","owner":[],"postedDate":"November 28th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"under-review","subjectAreas":[],"tags":[],"updatedAt":"2026-03-22T03:08:36+00:00","versionOfRecord":[],"versionCreatedAt":"2025-11-28 09:36:36","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8098329","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8098329","identity":"rs-8098329","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.