Research Article

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

49 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.

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.

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 because they evaluate complementary aspects of generated text, including lexical similarity, information coverage, and semantic alignment, and are widely used in natural language processing research.

JudgePromptPearsonRMSEMAEHit Rate
Mixtralshort0.0981.7791.3466/28
zero-shot0.1741.6181.29315/28
few-shot0.4751.6731.3679/28
LLaMA 3short0.4851.6171.31411/28
zero-shot0.4791.6141.31410/28
few-shot0.4251.6521.33913/28
LLaMA 3.1short0.3491.6211.31806/28
zero-shot0.681.6141.30712/28
few-shot0.4081.2430.88611/28

Table 1: Quantitative evaluation metrics of the proposed system.

BLEU was used to quantify syntactic similarity based on n-gram overlap between generated outputs and reference texts23. Originally developed for machine translation, it has also been applied to a wide range of text generation tasks because it captures structural correspondence between texts. In the present evaluation, the BLEU scores indicate that the generated responses preserve syntactic characteristics consistent with the reference outputs.

ROUGE was used to evaluate recall-oriented similarity, with emphasis on the coverage of relevant information in the generated texts24. In healthcare applications, this metric is particularly useful because preserving clinically relevant information is often more important than reproducing identical wording. As reported in Table 2, the ROUGE scores indicate that the generated responses retain relevant clinical content across the evaluated cases.

JudgePromptICC1ICC2ICC3ICC1kICC2kICC3K
Mixtralshort0.1360.1640.1820.320.370.4
zero-shot0.280.3530.5070.5390.6210.755
few-shot0.2240.3230.5220.4630.5880.766
LLaMA3short0.2340.3310.5320.4790.5970.773
zero-shot0.2440.340.5510.4920.6070.786
few-shot0.2180.3210.5310.4560.5870.772
LLaMA3.1short0.5210.5250.5370.7660.7680.777
zero-shot0.2460.3430.560.4950.6110.792
few-shot0.5990.5970.5890.8170.8160.811

Table 2: Inter-rater agreement metrics (ICC).

BERTScore was included to evaluate semantic similarity using contextual embeddings derived from transformer-based models25. Unlike BLEU and ROUGE, this metric compares texts according to contextual meaning rather than lexical overlap, making it suitable for evaluating clinical language generation. The BERTScore values obtained in this study indicate a high degree of semantic alignment between the generated responses and the corresponding reference texts.

Additional analyses included perplexity and cosine similarity to complement the primary evaluation metrics. Perplexity was calculated to estimate the predictability of the generated outputs, with lower values indicating lower uncertainty during text generation26. Cosine similarity was used to quantify the alignment between embedding vectors derived from the generated and reference texts, providing an additional measure of semantic coherence27.

Taken together, the evaluation metrics provide complementary information on the syntactic, semantic, and contextual characteristics of the generated responses. Figure 5 summarizes the distribution of the evaluation results across the assessed metrics, providing an overall view of system performance under the tested conditions.

The evaluation results are consistent with the expected behavior of Retrieval-Augmented Generation (RAG) in applications that require access to external knowledge sources. By incorporating retrieved documents into the response generation process, the architecture provides additional contextual information that supports clinically relevant responses in knowledge-intensive scenarios18,19. Structured prompting strategies are incorporated as complementary mechanisms to guide the reasoning process and contextual interpretation, consistent with approaches reported in recent studies20.

Qualitative analysis complemented the quantitative evaluation by examining the interpretability and clinical relevance of the generated outputs. Representative examples of system responses are shown in Figure 3 for different types of clinical queries. These examples illustrate how the platform generates contextually coherent responses across the evaluated scenarios, including cases involving more complex clinical information.

The multi-agent architecture distributes processing tasks across specialized modules responsible for complementary functions within the workflow. This organization reduces reliance on a single language model and enables multiple stages of information processing and output verification, consistent with recent multi-agent approaches reported in the literature21,22. Figure 5 summarizes the distribution of the evaluation results obtained with the different prompting strategies and language models considered in this study.

Violin plots comparing motivational prompts, methods: Pearson, MAI, M/F CE; educational analysis.
Figure 5: Performance distribution of the proposed system across different prompting strategies and language models. (A–F) The violin plots illustrate variations in response quality for short, zero-shot, and few-shot prompting approaches using LLaMA3, LLaMA3.1, and Mixtral models. The results highlight the impact of prompt design on output consistency and performance, demonstrating that structured prompting strategies tend to produce more stable and accurate responses in clinical tasks. Please click here to view a larger version of this figure.

The evaluation results are consistent with recent studies that advocate combining lexical and semantic metrics for assessing the performance of large language models4,12. In particular, embedding-based metrics have become increasingly important for capturing contextual similarity in healthcare-related language generation, where semantic interpretation extends beyond lexical matching28,29.

Overall, the evaluation indicates that the proposed platform integrates interoperability standards, Retrieval-Augmented Generation (RAG), and multi-agent processing within a unified framework for healthcare data analysis. The quantitative and qualitative results presented in this study support the feasibility of the proposed workflow under the evaluated experimental conditions and provide a basis for future validation in real-world clinical environments.

DATA AVAILABILITY

The datasets used in this study are publicly available. The chest X-ray dataset was obtained from the Indiana University Chest X-ray Collection (Open-i, U.S. National Library of Medicine), including the indiana_reports.csv and indiana_projections.csv files, available at https://openi.nlm.nih.gov/. The MedQA benchmark dataset is publicly available through its official repository. No proprietary or patient-identifiable clinical data were used in this study. All preprocessing procedures are described in the Protocol section to support reproducibility.

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 language models provides a practical framework for integrating heterogeneous clinical information. The proposed architecture brings together structured data exchange mechanisms, including FHIR and HL7, with AI-based language processing in a unified workflow that is consistent with current developments in digital health systems15,16,17.

An important aspect of the proposed workflow is the integration of Retrieval-Augmented Generation (RAG) within a multi-agent architecture. In this configuration, retrieved documents provide additional contextual information during response generation, supporting knowledge-intensive clinical tasks. This architectural design is consistent with recent studies that describe retrieval-based mechanisms as a strategy for improving contextual grounding and response reliability in large language model applications18,19.

Structured prompting strategies were incorporated into the proposed workflow to support contextual interpretation during response generation. Previous studies have reported that prompt engineering and structured reasoning techniques can improve the performance of large language models in complex decision-making tasks20. The approach adopted in this protocol is consistent with these developments and provides a structured framework for clinical language processing.

From an evaluation perspective, the use of complementary metrics allowed different dimensions of system performance to be examined. While BLEU and ROUGE provide information on syntactic similarity and content coverage23,24, embedding-based metrics such as BERTScore capture semantic relationships that may not be reflected by lexical overlap alone25. This multidimensional evaluation strategy is consistent with recent benchmarking studies that recommend combining lexical and semantic measures when assessing large language models in healthcare applications4,12.

The proposed workflow provides a reproducible methodological framework for implementing interoperable AI-based clinical decision support systems. Rather than benchmarking different artificial intelligence architectures, this study focuses on documenting the complete implementation workflow, system architecture, interoperability mechanisms, and evaluation methodology to facilitate reproducibility and future adoption. Comparative analyses involving conventional LLMs, RAG-disabled configurations, fine-tuned models, or traditional machine learning approaches are beyond the scope of this methodological contribution and represent an important direction for future research.

Future translation of the proposed framework into real-world clinical environments will require additional validation with healthcare professionals as well as compliance with applicable regulatory and ethical requirements. Depending on the intended use, such systems may be subject to Software as a Medical Device (SaMD) regulations and should comply with the requirements established by regulatory authorities, including the U.S. Food and Drug Administration (FDA) and the European Medical Device Regulation (MDR). In addition, robust data governance, cybersecurity, transparency, and clinical safety practices will be essential for supporting safe and responsible deployment in healthcare settings.

The qualitative analysis complemented the quantitative evaluation by illustrating the characteristics of the generated responses across representative clinical scenarios. The examples presented indicate that the platform was able to produce contextually coherent responses under the evaluated conditions, providing additional insight into response interpretability beyond the quantitative metrics. Similar observations have been reported in studies applying large language models to clinical applications, including diagnostic assistance and patient interaction28,29,30,31.

The proposed architecture distributes processing tasks across specialized modules responsible for complementary functions, including data validation, contextual filtering, clinical reasoning support, and output verification. This modular organization reduces reliance on a single language model and enables successive stages of information processing within the workflow. Similar architectural strategies have been described in recent studies on distributed AI systems and multi-agent frameworks designed for complex decision-making environments21,22.

Several implementation considerations may facilitate the reproducibility and deployment of the proposed protocol. Consistent mapping of clinical information to the HL7 FHIR standard helps preserve semantic interoperability throughout the data processing pipeline. Similarly, document preprocessing, chunking strategies, embedding generation, and vector indexing influence the behavior of the Retrieval-Augmented Generation workflow and should be configured and validated according to the characteristics of the target application. Prompt engineering and multi-agent orchestration may also be refined iteratively using domain-specific knowledge and expert feedback to improve contextual grounding during response generation. These implementation practices are consistent with recent developments in trustworthy artificial intelligence and retrieval-enhanced language models18,19,20.

Some limitations of this study should be acknowledged. Although the evaluation combined complementary quantitative and qualitative metrics, these measures may not fully capture all aspects of clinical reasoning. This observation is consistent with previous studies that recommend domain-specific evaluation frameworks for healthcare applications12. In addition, the platform was evaluated under controlled conditions using publicly available and anonymized benchmark datasets, which may not fully represent the variability and complexity of real-world clinical environments.

The proposed platform was developed in accordance with established healthcare interoperability standards. The adoption of HL7 and FHIR supports structured data exchange across heterogeneous healthcare information systems, providing a standardized framework for integrating clinical information from multiple sources. This architectural approach is consistent with current efforts to develop interoperable AI systems for distributed healthcare environments15,16,17.

The successful implementation of the proposed workflow depends on several critical methodological steps. First, clinical data should be consistently mapped to standardized HL7 FHIR resources to preserve semantic interoperability across heterogeneous healthcare systems15,17. Second, document preprocessing, including normalization, chunking strategy, and embedding generation, should be carefully configured because these stages directly influence retrieval quality within the Retrieval-Augmented Generation (RAG) pipeline19,32,33. Third, the vector database should be rebuilt whenever the knowledge base is updated to maintain consistency between indexed documents and retrieval results. Finally, prompt engineering and multi-agent orchestration should be iteratively validated using representative clinical scenarios to improve contextual accuracy, minimize hallucinations, and enhance the reproducibility of AI-assisted clinical decision support workflows4,3,20,31.

From a troubleshooting perspective, common implementation challenges include incomplete FHIR resource mapping, reduced retrieval performance associated with document indexing or vector database configuration, and responses affected by insufficient contextual information or suboptimal prompt engineering. These issues may be addressed through validation of interoperability resources, optimization of retrieval parameters, periodic updating or rebuilding of the vector database after modifications to the knowledge base, and continuous evaluation using complementary lexical and semantic metrics. These practices support consistent system behavior and facilitate the deployment and maintenance of AI-assisted clinical decision support workflows4,12,25,23..

From a practical perspective, deploying large language models in healthcare environments requires consideration of computational resources and infrastructure requirements. Although the proposed architecture supports both cloud-based and local execution, additional optimization strategies may be necessary depending on the scale of deployment and the computational resources available, particularly in resource-constrained settings4.

Future research may extend the proposed workflow by evaluating the platform with real-world clinical datasets and routine healthcare workflows. Additional investigations may also explore domain-specific fine-tuning strategies and the integration of explainable AI methods to improve model interpretability and support transparency during clinical decision support. These directions may contribute to a broader assessment of the platform in practical healthcare environments.

Overall, this work presents a reproducible framework for integrating healthcare interoperability standards, Retrieval-Augmented Generation (RAG), and multi-agent language model architectures within a unified clinical data processing workflow. The proposed protocol provides a structured approach for implementing and evaluating AI-assisted medical data analysis systems and may serve as a reference for future developments in interoperable clinical decision support.

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.

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.

Reprints and Permissions

Tags

FHIR IntegrationRetrieval-Augmented GenerationMulti-Agent ReasoningVector DatabaseSemantic InteroperabilityPrompt Engineering