# Evaluating the Effectiveness of Large Language Models in Converting Clinical Data to FHIR Format
## 1 Introduction  
The advent of modern natural language processing (NLP) techniques, driven by advances in machine learning (ML), has significantly enhanced our ability to analyze and interpret complex text data [1, 2, 3, 4]. These improvements are partly attributed to methods that encode and manipulate text data using latent representations. These methods embed text into high-dimensional vector spaces that capture the underlying semantics and structure of language. The medical field has witnessed a significant transformation in recent years with the emergence and popularization of various advanced techniques, including large language models (LLMs) [5, 6]. One of the most critical areas in which these advances have made a substantial impact is the integration and analysis of electronic health records (EHR). With rich and varied information, EHR data offer unique opportunities for developing and validating ML models that can improve diagnostic accuracy, predict patient outcomes, and personalize treatment plans [7, 8, 9]. For instance, [PERSON] and [PERSON] [9] demonstrated the potential of unstructured clinical notes to enhance mortality prediction, while [PERSON] and [PERSON] [8] showed that integrating advanced NLP techniques with detailed EHR data significantly improved medication management predictions. In healthcare informatics, converting unstructured clinical data into structured formats like Fast Healthcare Interoperability Resources (FHIR) is crucial for enhancing interoperability and improving patient care. FHIR is a standard for exchanging healthcare information electronically, facilitating the integration of disparate healthcare systems. However, a gap remains between FHIR implementation guides (IGs) and the process of building actual services, as IGs provide rules without specifying concrete methods, procedures, or tools [10]. Thus, stakeholders may feel it nontrivial to participate in the ecosystem, highlighting the need for more actionable practice guidelines to promote FHIR's fast adoption. Several studies have highlighted the complexities and importance of this task. For instance, [PERSON] [11] underscored the significance of FHIR in achieving interoperability between different healthcare systems, demonstrating its potential to improve healthcare delivery and patient outcomes. [PERSON] et al. [12] discussed the intricacies of mapping unstructured data to the highly structured and standardized FHIR format, emphasizing the need for sophisticated techniques and tools. Their work demonstrated the feasibility of a scalable clinical data normalization pipeline known as NLP2 FHIR, which integrates NLP with FHIR to model unstructured EHR data. However, the NLP2 FHIR technique currently relies on transformation scripts for mapping and content normalization, which limits its standardization and automation capabilities. Despite advances in NLP, converting unstructured clinical data, such as clinical reports, into structured formats like FHIR remains a challenging task. The importance of this conversion lies in its potential to enable seamless data sharing, enhance clinical decision support, and facilitate research and public health initiatives [13; 14]. For instance, consider the artificial example shown in Figure 1, which illustrates the conversion of information from a clinical report (on the left) to an FHIR bundle (on the right). This example underscores the well-defined structure of FHIR and highlights the complexity involved in converting even simple elements from a clinical report into this structured format. This challenge underscores the need for advanced techniques, such as those explored in our study, to facilitate this conversion process effectively. The primary objective of this research is to evaluate the effectiveness of various LLMs in converting unstructured clinical reports in Spanish into structured FHIR bundles. Different prompting techniques are employed, including providing examples of clinical reports and their corresponding FHIR bundles.