Paul Richardson
September 25, 2023

Migrating Between Versions of FHIR

Chief Executive Officer

FHIR is the best way to solve the interoperability problems of diverse IT systems. Yet as FHIR matures and is increasingly adopted, it has created a FHIR-internal problem: the diversity of FHIR versions and profiles. You may plan to adopt FHIR version X in profile Y – yet the organisation you exchange data with is using Version (X-1) with profile Z – or worse, plans to migrate from version (X-1) to version (X+1). Which transforms should you build? How will you maintain them, as FHIR versions and profiles change?

The FHIR Transform Engine (FTE) is an excellent foundation for this. By developing transforms as mappings, using a graphical mapping editor, transform definitions are declarative, understandable, and easy to maintain and adapt. The FTE mapping notation has the power to handle the most complex problems. In adapting transforms to new FHIR versions and profiles, this will give you a head start. However, FTE has facilities to make it easier still.

There are two possible approaches to FHIR version conversion. The first is to adapt an existing transform to a different FHIR version or profile. The second is to keep the previous transform, and use a ‘bridging’ transform from FHIR to FHIR,  to the new version and profile. Depending on the circumstances, one or the other may be needed. FTE helps you do both.

If you need to adapt an existing FTE transform to new FHIR version and profile, you start from the existing (non-FHIR) mapped structure and mappings, and couple the mappings to the new FHIR version and profile. Most mappings will still be valid, but there will be mismatches where the new profile differs from the old. FTE has a mapping validator, which will alert you to the mismatches – which you can then correct, until the mapping set validates fully. You then use the powerful FTE test tools to ensure that the new transform does what you require.

FHIR-to-FHIR bridging transforms can be built in a variety of ways.  HL7 International provides a large number of FHIR-to-FHIR version conversions, in the standard FHIR Mapping Language (FML). However, these only transform FHIR between the core FHIR versions, and they do not handle profiled FHIR. Adapting these transforms to local profiled FHIR requires skill in FML – which is by no means easy to learn and use. After more than 5 years, FML is still not widely adopted, and FML skills are scarce. It is best to use the FML transforms as documentation of what HL7 intends in the different versions, rather than try to adapt them.

How does FTE help you build FHIR-to-FHIR transforms? If you define both the source and the target of a transform to be FHIR (in different versions and profiles), then FTE builds a default mapping set, in which all the obvious X-to-X mappings (wherever the two profiles do not differ) are made automatically. You only need to edit mappings by hand in the places where the profiles differ. Then you gain the other benefits of FTE, such as rapid mapping and testing, easily understood declarative mappings, flexible deployment, and fast execution.