A subscription to JoVE is required to view this content. Sign in or start your free trial.

Research Article

Interoperable Web Platform Based on Large Language Models for Medical Data Analysis: A Protocol for Clinical Decision Support

171 views

⸱

DOI:

10.3791/72085

⸱

August 25th, 2026

 ,  ,  ,  , 

In This Article

Summary

This protocol describes the implementation of an interoperable web platform that integrates FHIR-based clinical data with Retrieval-Augmented Generation and multi-agent large language models for clinical decision support. The workflow enables reproducible deployment, standardized data integration, and evaluation of artificial intelligence (AI)-assisted medical data analysis.

Abstract

Clinical decision-making is frequently hindered by fragmented electronic health records and limited interoperability among heterogeneous healthcare information systems. This article presents a step-by-step protocol for implementing an interoperable web platform that integrates clinical data via the Fast Healthcare Interoperability Resources (FHIR) standard, along with Retrieval-Augmented Generation (RAG), Large Language Models (LLMs), and a multi-agent clinical reasoning framework to support medical data analysis and clinical decision support. The protocol describes the complete workflow, including computational environment configuration, clinical dataset preprocessing, FHIR-based data integration, vector database construction, retrieval configuration, prompt engineering, multi-agent orchestration, and system evaluation. Representative results demonstrate the platform's ability to generate clinically relevant and contextually consistent responses while improving semantic interoperability across heterogeneous data sources. System performance was evaluated using complementary quantitative and semantic metrics, including BLEU, ROUGE, BERTScore, and cosine similarity. A qualitative assessment was conducted using publicly available, fully anonymized benchmark healthcare datasets to evaluate the reproducibility of the proposed methodological workflow. The proposed architecture combines standardized healthcare interoperability with retrieval-enhanced language models to improve contextual reasoning, reduce hallucination, and support reproducible AI-assisted clinical workflows. This protocol provides a scalable and reproducible framework for researchers and developers seeking to implement interoperable, privacy-aware, and intelligent healthcare systems for clinical decision support, medical data analysis, and future translational research.

Introduction

Health information is routinely generated across hospitals, diagnostic centers, laboratories, and outpatient clinics, often remaining distributed among heterogeneous information systems. This fragmentation limits interoperability and restricts timely access to comprehensive patient records, creating persistent challenges for clinical care, data integration, and healthcare management1,2,3,4.

The consequences of this fragmentation become particularly evident in clinical workflows that depend on timely access to patient information. When healthcare professionals cannot retrieve complete and integrated medical records, clinical assessment becomes more difficult, increasing the risk of incomplete decision-making and reducing the efficiency of care delivery, particularly in emergency settings5,6.

Recent developments in Artificial Intelligence (AI), particularly Large Language Models (LLMs), have expanded the range of computational approaches available for healthcare applications. These models have been investigated in tasks such as diagnostic assistance, clinical triage, and decision support. For example, Jahan et al.5 evaluated the use of LLMs in biomedical tasks, while Taylor et al.7 investigated fine-tuned models for digital mental health screening, reporting encouraging results in specialized clinical settings.

The application of LLMs has also expanded to more specialized clinical domains. Song et al. 49explored their use in pneumoconiosis diagnosis, whereas Chien et al.8 applied these models to analyze workload patterns among informal caregivers. In ophthalmology, Xue et al.9 proposed a question-answering system for glaucoma diagnosis, while Tan et al.3 and Wu et al.10 reported the use of LLMs in hybrid diagnostic systems and traditional Chinese medicine consultations.

The use of LLMs is not limited to direct clinical applications. Zhang et al.11 investigated their application to emotion recognition in mental health scenarios, whereas Sarzaeim et al.12 explored intelligent policing systems that may also contribute to public health-related analyses. These studies illustrate the broad applicability of LLM-based approaches across different healthcare-related domains.

Although LLMs have expanded the possibilities for healthcare applications, their integration into clinical environments remains associated with important technical, organizational, and regulatory challenges. Practical deployment requires appropriate computational infrastructure, effective data governance, and compliance with regulatory frameworks such as the General Data Protection Regulation (GDPR) and the Brazilian General Data Protection Law (LGPD). These frameworks establish requirements for the secure and ethical processing of sensitive health information while addressing issues related to privacy, reliability, and algorithmic bias in AI-assisted healthcare systems13,14 .

Interoperability across heterogeneous healthcare data sources, including Electronic Health Records (EHRs), medical imaging systems, and Internet of Things (IoT) devices, continues to represent a major technical challenge for the deployment of AI-assisted healthcare solutions. In this context, standardized interoperability frameworks such as HL7 FHIR provide a structured mechanism for exchanging clinical information across different systems while preserving semantic consistency and supporting scalable integration.

This work presents an interoperable web platform that integrates Large Language Models with healthcare interoperability standards to support medical data analysis in heterogeneous clinical environments. The proposed architecture combines HL7 FHIR-based data integration with Retrieval-Augmented Generation (RAG) and a multi-agent processing framework to provide context-aware AI-assisted analysis while maintaining alignment with applicable data protection requirements, including the Brazilian General Data Protection Law (LGPD).

This protocol describes an interoperable architecture for integrating heterogeneous clinical data using established healthcare interoperability standards. It also details the implementation of a multi-agent processing pipeline based on large and small language models (LLMs and SLMs), together with an evaluation framework that combines quantitative metrics and qualitative analyses to assess the behavior of the proposed platform.

Access restricted. Please log in or start a trial to view this content.

Protocol

This study did not involve the recruitment of human participants, access to identifiable patient records, or experiments involving animals. The protocol was developed and evaluated exclusively using publicly available and fully anonymized datasets for methodological validation. No personal health information was accessed or processed. Therefore, approval from an Institutional Review Board (IRB) or Research Ethics Committee was not required. The protocol was developed in accordance with applicable data protection principles, including the Brazilian General Data Protection Law (LGPD), to support future applications involving clinical data.

Dataset selection and preprocessing

The proposed protocol was evaluated using publicly available and fully anonymized clinical datasets comprising structured Electronic Health Records (EHRs), clinical question-answering data, and medical imaging datasets for methodological validation. Before integration into the platform, the datasets underwent standardized preprocessing procedures, including data normalization, removal of inconsistent or incomplete records, mapping to HL7 FHIR resources, text cleaning, segmentation into retrieval chunks, and embedding generation for vector indexing. These preprocessing steps ensured semantic consistency across heterogeneous data sources, facilitating interoperability and enabling the reproducibility of the proposed workflow while maintaining compliance with applicable data privacy principles.

The datasets were obtained from publicly available benchmark repositories commonly used in artificial intelligence and digital health research. They were selected to represent heterogeneous clinical information, including structured Electronic Health Records (EHRs), unstructured clinical narratives, clinical question-answering tasks, and medical imaging metadata. Rather than evaluating a specific clinical cohort, the protocol focuses on demonstrating a reproducible implementation workflow that can be adapted to different healthcare datasets. The diversity of these benchmark datasets enables validation of the interoperability pipeline, Retrieval-Augmented Generation (RAG), and multi-agent reasoning framework across multiple clinical data modalities.

Experimental environment configuration

The experimental environment was configured to evaluate the interoperable platform under controlled and reproducible conditions. The architecture comprises data ingestion modules, interoperability layers, large language models (LLMs), and evaluation components organized into a single processing pipeline for medical data analysis. Figure 1 illustrates the complete workflow, from clinical data ingestion to the generation of diagnostic outputs.

EHR data processing diagram; clinical notes filtering; disease inference via LLM; diagnosis process.
Figure 1: Overall system workflow illustrating the processing pipeline from raw clinical data to disease status output. The process begins with Electronic Health Records (EHR) ingestion, followed by data filtering and preprocessing to extract disease-sensitive information. A structured prompt design stage integrates expert knowledge, disease definitions, and hyperparameters, enabling effective interaction with the Large Language Model (LLM). The LLM performs text inference to generate context-aware responses, which are subsequently evaluated through clinical rules to determine the final disease status. The workflow highlights the integration of data preprocessing, knowledge-driven prompting, and AI-based inference to support clinical decision-making. Please click here to view a larger version of this figure.

Healthcare interoperability architecture

The backend infrastructure adopts a modular architecture based on RESTful APIs to support communication among the platform components (Figure 2). This architecture accommodates heterogeneous clinical information, including structured Electronic Health Records (EHRs), physician notes, and metadata derived from medical imaging systems. Because these data originate from multiple sources and formats, interoperability is achieved through standardized data models, particularly the Fast Healthcare Interoperability Resources (FHIR) framework15,16,17..The adoption of FHIR supports structured information exchange while preserving scalability and flexibility in distributed healthcare environments. HL7-based communication mechanisms were also incorporated to facilitate integration with legacy clinical systems, which remain widely used in healthcare institutions16,17.

Flask API diagram showing POST/GET requests, MySQL queries, and FAISS vector store integration.
Figure 2: System architecture of the proposed interoperable platform. The web interface communicates with the backend through a Flask API using HTTP POST/GET requests. The API manages routing, query processing, and interaction with both structured and unstructured data sources. A MySQL database stores structured clinical data, while a FAISS-based vector store supports similarity search for retrieval operations. The LLaMA-based pipeline processes textual inputs and generates responses using vector representations, enabling Retrieval-Augmented Generation (RAG). The architecture highlights the integration of web services, database management, vector retrieval, and large language model inference in a unified system. Please click here to view a larger version of this figure.

Multi-agent workflow configuration

The multi-agent architecture is organized into specialized functional agents responsible for distinct stages of the workflow. A preprocessing agent performs data normalization and FHIR mapping, followed by a retrieval agent responsible for semantic search within the vector database. A reasoning agent integrates the retrieved context with the LLM to generate responses, while a validation agent verifies output consistency and formatting before the final response is returned. Agent coordination follows a sequential orchestration strategy in which the output of each agent serves as the input for the subsequent stage, ensuring a reproducible and modular implementation.

Clinical data integration

The data integration layer aggregates information from multiple clinical sources and prepares it for downstream processing. Preprocessing includes data normalization, tokenization, and entity alignment to improve semantic consistency across heterogeneous datasets. Because clinical information varies in structure and quality, these operations help reduce noise and facilitate interaction with AI models. Structured mapping strategies were also applied to harmonize different data formats and maintain compatibility with the processing pipeline, as illustrated in Figure 315,16,17.

Healthcare decision-making process diagram; steps: query complexity, recruitment, analysis, synthesis.
Figure 3: Detailed example of the multi-agent clinical reasoning process. The figure illustrates how a clinical query is analyzed through multiple stages, including complexity assessment, specialist recruitment, collaborative discussion, and final decision-making. This process demonstrates the system’s ability to dynamically adapt reasoning strategies based on query complexity, improving both efficiency and diagnostic accuracy in clinical decision support scenarios. Please click here to view a larger version of this figure.

Configure the Retrieval-Augmented Generation pipeline

Retrieval-Augmented Generation (RAG) is incorporated to provide context-aware analysis by combining information retrieval with the generative capabilities of large language models. User queries are converted into vector representations using embedding models and matched against the vector database using semantic similarity search to retrieve the most relevant contextual passages. The retrieved documents are then combined with the original query before inference by the LLM. This strategy helps provide contextual information during response generation and has been associated with improved factual consistency and reduced hallucination in knowledge-intensive applications, including healthcare18,19. Figure 1 and Figure 3 illustrate the overall retrieval workflow and the corresponding reasoning process.

For each user request, the final prompt is dynamically constructed by combining the original query with the most relevant contextual passages retrieved from the vector database. The retrieved information is incorporated as contextual evidence before inference, allowing the language model to generate responses grounded in the retrieved healthcare knowledge while preserving semantic consistency and reducing unsupported generations.

Prompt engineering and multi-agent reasoning

The protocol incorporates structured prompting strategies to improve contextual interpretation during response generation. These prompting techniques, together with advanced inference mechanisms, help guide the reasoning process in complex clinical scenarios and are consistent with recent developments reported in the literature20.

The architecture includes a multi-agent framework composed of specialized modules that perform distinct functions within the processing pipeline, including data validation, context filtering, clinical reasoning support, and output verification. The modular organization allows tasks to be executed sequentially or in parallel, providing flexibility for different processing requirements (Figure 4). Distributing these activities across multiple agents reduces reliance on a single language model and supports a more robust processing workflow. This architectural strategy is consistent with recent developments in distributed artificial intelligence and intelligent system design21,22.

Query process diagram; decision flow for simple vs. complicated medical problems; team analysis.
Figure 4: Multi-agent decision framework for clinical reasoning. The process begins with a user query, which is evaluated by an agent checker responsible for assessing query complexity. For complex cases, the system dynamically recruits a multi-disciplinary team (MDT) of specialized agents that engage in iterative discussion rounds to analyze the problem and synthesize knowledge before producing a final decision. For simpler cases, the query is handled by a primary care clinician (PCC) agent, enabling faster response generation. This adaptive architecture balances efficiency and analytical depth, improving decision quality and system scalability in healthcare applications. Please click here to view a larger version of this figure.

Performance evaluation

System performance was evaluated using complementary metrics that capture both linguistic quality and semantic consistency of the generated outputs. BLEU was applied to measure syntactic similarity based on n-gram overlap23, whereas ROUGE assessed recall and content coverage, particularly in summarization and information extraction tasks24. Semantic similarity was evaluated with BERTScore, which uses contextual embeddings derived from transformer-based models to compare generated and reference texts25. Additional analyses included perplexity and cosine similarity to examine model confidence and semantic coherence, respectively26,27.

The selected evaluation metrics provide complementary perspectives on system performance by combining lexical and semantic analyses. This combination is particularly relevant in healthcare applications, where contextual interpretation is as important as lexical similarity. The platform was evaluated in a controlled computational environment that supports both cloud-based and local deployment. Local execution of LLMs was included as an option to support data privacy requirements and reduce reliance on external services when processing sensitive clinical information. This deployment strategy is compatible with data protection frameworks and can be adapted to different operational environments4.

Access restricted. Please log in or start a trial to view this content.

Results

System performance was assessed using complementary quantitative metrics together with qualitative analysis to examine both linguistic accuracy and semantic consistency of the generated outputs. This evaluation strategy combines lexical and semantic measures to provide a broader characterization of model behavior in healthcare-related language generation tasks.

Table 1 presents the quantitative results obtained with BLEU, ROUGE, and BERTScore. These metrics were selected becau...

Access restricted. Please log in or start a trial to view this content.

Discussion

The evaluation presented in this study represents a methodological validation performed using publicly available and fully anonymized benchmark healthcare datasets. No prospective clinical validation involving healthcare professionals or patient recruitment was conducted, as the objective of this work is to demonstrate a reproducible implementation protocol rather than clinical effectiveness.

The findings of this study suggest that combining healthcare interoperability standards with large lan...

Access restricted. Please log in or start a trial to view this content.

Disclosures

The authors declare no competing financial interests or personal relationships that could have influenced the work reported in this manuscript. Generative artificial intelligence (AI) tools were used exclusively to assist with language editing, grammar correction, and improvements in manuscript readability. All scientific content, study design, methodology, data analysis, interpretation of results, and editorial decisions were developed, verified, and approved by the authors, who assume full responsibility for the content of this manuscript.

Acknowledgements

The authors would like to thank the Laboratory of Embedded and Distributed Systems (LESC), Federal University of Ceará (UFC), for providing the research environment and technical discussions that supported the development of this work. The authors also acknowledge the developers and maintainers of the open-source software, interoperability standards, and publicly available datasets used throughout this study.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
FAISSMeta Platforms Inc.Version 1.8.0Vector database used for similarity search in the Retrieval-Augmented Generation (RAG) pipeline.
FHIR StandardHL7 InternationalRelease 4 (R4)Healthcare interoperability standard adopted for structured clinical data exchange.
FlaskPallets ProjectsVersion 3.0.3Python web framework used to implement the RESTful backend API.
HL7 StandardHL7 InternationalVersion 2.xLegacy messaging protocol used for interoperability with hospital information systems.
HTTP REST APICustom ImplementationN/ARESTful communication layer between frontend, backend, database and AI services.
LangChainLangChain Inc.Version 0.3.xFramework used to integrate LLMs, prompt engineering and Retrieval-Augmented Generation workflows.
LangGraphLangChain Inc.Version 0.2.xFramework used for orchestrating the multi-agent clinical reasoning workflow.
LLaMA 3.1 8B InstructMeta Platforms Inc.Version 3.1Large Language Model employed for clinical reasoning and natural language generation.
MySQL Community ServerOracle CorporationVersion 8.0Relational database used to store structured clinical data.
OllamaOllama Inc.Version 0.9.xLocal inference engine used for executing Large Language Models while preserving patient privacy.
PythonPython Software FoundationVersion 3.11Programming language used for implementing the complete platform.
PyTorchLinux FoundationVersion 2.4Deep learning framework used for Large Language Model inference.
Retrieval-Augmented Generation (RAG) PipelineCustom ImplementationN/AAI framework combining semantic retrieval with LLM inference for context-aware response generation.
Sentence TransformersHugging Face Inc.all-MiniLM-L6-v2Embedding model used to generate dense vector representations for semantic document retrieval.
Ubuntu LinuxCanonical Ltd.Version 24.04 LTSOperating system used for development and experimental evaluation.
Visual Studio CodeMicrosoft CorporationVersion 1.100Integrated development environment used for software implementation and debugging.

References

  1. Chukwu E, Garg L. A systematic review of blockchain in healthcare: frameworks, prototypes, and implementations. IEEE Access. 2020;8:21196-21214. doi:10.1109/ACCESS.2020.2969881.
  2. Al-Nbhany WANA, Zahary AT, Al-Shargabi AA. Blockchain-IoT healthcare applications and trends: a review. IEEE Access. 2024;12:4178-4212. doi:10.1109/ACCESS.2023.3349187.
  3. Tan Y, et al. MedChatZH: a Chinese medical large language model. Comput Biol Med. 2024;172:108290.
  4. OLLAMA TEAM. Ollama: Run Large Language Models locally. Version 0.x. San Francisco: Ollama, 2024.
  5. Jahan I, Laskar MTR, Peng C, Huang JX. A comprehensive evaluation of large language models on benchmark biomedical text processing tasks. Comput Biol Med. 2024;171:108189. doi:10.1016/j.compbiomed.2024.108189.
  6. Liu X, Zhou Y, Wang Z, et al. Disease topic modeling of users' inquiry texts: a text mining-based PQDR-LDA model for analyzing the online medical records. IEEE Trans Eng Manag. 2023.
  7. Taylor N, Kormilitzin A, Lorge I, Nevado-Holgado A, Cipriani A, Joyce DW. Model development for bespoke large language models for digital triage assistance in mental health care. Artif Intell Med. 2024;157:102988.
  8. Song M, et al. PneumoLLM: a large language vision model for pneumonia diagnosis. Med Image Anal. 2024;97:103248.
  9. Chien SC, Yen CM, Chang YH, Chen YE, Liu CC, Hsiao YP, et al. Using large language model (LLM) to identify high-burden informal caregivers in long-term care. Comput Methods Programs Biomed. 2024;255:108329. doi:10.1016/j.cmpb.2024.108329.
  10. Xue X, Zhang D, Sun C, et al. Xiaoqing: a Q&A model for glaucoma based on LLMs. Comput Biol Med. 2024;174:108399.
  11. Wu D, Nie L, Mumtaz RA, Agarwal K. A LLM-based hybrid-transformer diagnosis system in healthcare. IEEE J Biomed Health Inform. 2024.
  12. Zhang Y, et al. LLM-enhanced multi-teacher knowledge distillation for modality-incomplete emotion recognition in daily healthcare. IEEE J Biomed Health Inform. 2024.
  13. Sarzaeim P, Mahmoud QH, Azim A. A framework for LLM-assisted smart policing system. IEEE Access. 2024;12:74915-74929. doi:10.1109/ACCESS.2024.3404862.
  14. Leme RS, Blank M. Lei Geral de Proteção de Dados e segurança da informação na área da saúde. Cad Ibero-Am Direito Sanit. 2020;9(3):210-224. doi:10.17566/ciads.v9i3.690.
  15. Zaganelli MV, Binda Filho DL. O sigilo médico e os dados sensíveis na telemedicina à luz da Lei Geral de Proteção de Dados. RECIIS. 2023;17(3):729-740. doi:10.29397/reciis.v17i3.3689.
  16. Tabari P, Costagliola G, De Rosa M, Boeker M. State-of-the-art Fast Healthcare Interoperability Resources (FHIR)-based data model and structure implementations: systematic scoping review. JMIR Med Inform. 2024.
  17. Martinez T, et al. HL7 systems and interoperability ecosystems in modern healthcare. IEEE Rev Biomed Eng. 2024.
  18. Chen L, et al. HL7 integration and semantic interoperability in distributed healthcare networks. IEEE J Biomed Health Inform. 2024.
  19. Liu W, Li W, Huang W, Gao Y. Security framework for medical data sharing. Telemed E-Health. 2024.
  20. Basile LJ, Carbonara N, Panniello U, Pellegrino R. How can technological resources improve the quality of healthcare service? IEEE Trans Eng Manag. 2024;71:5771-5781. doi:10.1109/TEM.2022.3192405.
  21. Singh A, et al. Prompt engineering in large language models: a survey using SWOT analysis [preprint]. arXiv. 2024
  22. Chen L, Chen Y, Liang W, Li X, Li KC, Wang J, Xiong N. MASS: a multiattribute sketch secure data sharing scheme for IoT wearable medical devices based on blockchain. IEEE Internet Things J. 2025;12(2):1990-2001. doi:10.1109/JIOT.2024.3468733.
  23. Autoridade Nacional de Proteção de Dados (BR). Diretrizes para agentes de tratamento de pequeno porte. Brasília (DF): ANPD; 2021.
  24. Patel R, Kim H. Interoperability in EHR. IEEE Transactions on Biomedical Engineering, v. 70, n. 8, p. 2341-2354, ago. 2023. DOI: 10.1109/TBME.2023.3241567.
  25. Zhang T, Kishore V, Wu F, Weinberger KQ, Artzi Y. BERTScore: evaluating text generation with BERT. In: International Conference on Learning Representations (ICLR); 2020.
  26. Chen X, Lu X, Li Q, Li D, Zhu F. Integration of LLM and Human-AI Coordination for Power Dispatching With Connected Electric Vehicles Under SAGVNs. IEEE Trans Veh Technol. 2025;74(2):1992-2002. doi:10.1109/TVT.2024.3434969
  27. Zhou S, Chen C, Gu HH. Testing and evaluating SNOMED CT web browsers' textual search feature. In: Proceedings of the IEEE International Conference on Bioinformatics and Biomedicine (BIBM); 2019.
  28. McPeak G, Sautmann A, George O, Hallal A, Simal EA, Schwartz AL, Abaluck J, Ravi N, Pless R. An LLM's medical testing recommendations in a Nigerian clinic: potential and limits of prompt engineering for clinical decision support. In: Proceedings of the 2024 IEEE 12th International Conference on Healthcare Informatics (ICHI); 2024.
  29. LLAMA TEAM, AI @ META. The Llama 3 Herd of Models. arXiv preprint arXiv:2407.21783, 2024. Disponível em: https://arxiv.org/abs/2407.21783.
  30. Conselho Nacional de Saúde (BR). Resolução nº 466, de 12 de dezembro de 2012. Aprova as diretrizes e normas regulamentadoras de pesquisas envolvendo seres humanos. Brasília (DF): Ministério da Saúde; 2012.
  31. Singhal K, Azizi S, Tu T, et al. Large language models encode clinical knowledge. Nature. 2023;620:172-180. doi:10.1038/s41586-023-06291-2.
  32. Sahoo P, et al. A systematic survey of prompt engineering in large language models [preprint]. arXiv. 2024. Available from: https://arxiv.org/abs/2402.07927
  33. Yan Y, Hou Y, Xiao Y, Zhang R, Wang Q. KNOWNET: guided health information seeking from LLMs via knowledge graph integration. IEEE Trans Vis Comput Graph. 2024.

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Explore More Articles

FHIR IntegrationRetrieval-Augmented GenerationMulti-Agent ReasoningVector DatabaseSemantic InteroperabilityPrompt Engineering