Article
· May 28 4m read

From Legacy to FHIR: Bridging Healthcare Data with IRIS-FHIR-Bridge


Hi Community,

In this article, I will introduce my application iris-fhir-bridge 

IRIS-FHIR-Bridge is a robust interoperability engine built on InterSystems IRIS for Health, designed to transform healthcare data across multiple formats into FHIR and vice versa. It leverages the InterSystems FHIR Object Model (HS.FHIRModel.R4.*) to enable smooth data standardization and exchange across modern and legacy healthcare systems.

🚀 Key Features

  • 🧾 CSV → FHIR Transformation

Convert structured legacy data in CSV format into FHIR resources using InterSystems' native FHIR object model.

Currently supported FHIR resources:

  • Patient
  • Encounter
  • Observation
  • Practitioner
  • Organization

✅ Can be easily extended to support other FHIR resource types.

  • 🔁 HL7 v2 → FHIR Conversion

  • 📝 CCDA → FHIR Conversion

  • 🔄 FHIR → HL7 v2 Conversion 


🔧 Conversion Workflows

CSV to FHIR (Using FHIR Object Model)
 

Parses structured CSV data and transforms it into valid FHIR resources using the InterSystems FHIR Object Model (HS.FHIRModel.R4.). Designed for production environments, this service reads structured CSV files, maps each row to corresponding FHIR resources (e.g., Patient, Encounter, Observation, etc.), and assembles them into a fully compliant FHIR Bundle. The generated FHIR Bundle is ready to be posted directly to a FHIR server, enabling seamless integration and automated ingestion of legacy tabular data into modern healthcare systems.

  • CSV_File_Service: Business service that transforms structured CSV data (patient demographics, observations, practitioners, Encounters, Organizations) into valid FHIR resources using InterSystems FHIR Object Model.

Code snippet

ClassMethod CreatePatientResource(headers As %String, line As %String) As HS.FHIRModel.R4.Patient
{
    // Get columns from header array
    set headerArray = $listfromstring(headers, ",")
    set values = $listfromstring(line, ",")
    
    //Create patient resource
    #dim patient As HS.FHIRModel.R4.Patient
    set patient = ##class(HS.FHIRModel.R4.Patient).%New()

    //Set id and identifier
    SET position = $LISTFIND(headerArray, "patientid")    
    if (position > 0)
    { 
        set patient.fhirID = $listget(values,position)
        do patient.IncludeIdentifier()
        set identifier = ##class(HS.FHIRModel.R4.Identifier).%New()
        set identifier.system = "http://irisfhirbridge.com/patient-id"
        set identifier.value = $listget(values, position)
        do patient.identifier.add(identifier) 
    }

    //Set Patient name
    SET positionfirstName= $LISTFIND(headerArray, "firstname")    
    SET positionfamilyName= $LISTFIND(headerArray, "familyname")    

    if (positionfirstName > 0)
    {          
        Do patient.IncludeName()
        set name = patient.name.MakeEntry()
        Do name.IncludeGiven()
        Do name.given.add($listget(values, positionfirstName))           
        if (positionfamilyName > 0 ) {set name.family = $listget(values, positionfamilyName) }  
        Do patient.name.add(name)       
    }
    //set gender
    SET position = $LISTFIND(headerArray, "gender")    
    if (position > 0)
    {
        set patient.gender = $listget(values,position)     
    }
    //set birth date
    SET position = $LISTFIND(headerArray, "birthdate")    
    if (position > 0)
    {
        set patient.birthDate = $listget(values,position)     
    }
    
    Return patient
}


HL7 v2 ↔ FHIR Conversion

Supports REST and file-based ingestion of HL7 v2 messages and converts them into standardized FHIR resources.

  • HL7_File_Service: Monitors a folder for HL7 v2 message files and automatically converts them into FHIR JSON files.
  • HL7_Http_Service: Monitors a folder for HL7 v2 message files and automatically converts them into FHIR JSON files.
  • image image
  • HS.FHIRServer.interop.Service: A business service responsible for converting FHIR resources back into HL7 v2 messages, ensuring two-way compatibility. image

CCDA to FHIR Conversion
 

Conversion Accepts CCDA XML documents via a RESTful API and outputs structured FHIR JSON.

  • HL7_Http_Service: Processes structured CSV data, such as patient demographics and observations, and uses the InterSystems FHIR Object Model to construct valid FHIR resources. image

 

🧰 Additional Features

  • Sample Data Files: The repository includes example HL7, CCDA, FHIR, and CSV files to help users get started.
  • Postman Collection: A ready-to-use Postman collection is available for testing all exposed REST endpoints.


🤝 Join the Innovation

As part of the InterSystems FHIR and Digital Health Interoperability Contest, IRIS-FHIR Bridget aims to contribute meaningful innovation to the healthcare community. We welcome feedback, collaboration, and ideas to evolve this tool further.

Please find a video demonstration of the application below:

https://www.youtube.com/embed/eo57qR4HLuA
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]



For more details, please visit iris-fhir-bridge open exchange application page.

Thanks
Discussion (0)1
Log in or sign up to continue