One FHIR Store, Two APIs: Serving R4 and R6 Coexistence with FML
One FHIR Store, Two Versions: Serving R4 and R6 with FML - Health Samurai
Summary
Addressing the necessity of long-term coexistence between FHIR R4 and R6, a development team built a system that stores FHIR R4 in a single dataset and computes R6 via FHIR Mapping Language (FML). This design eliminates the complexity of version-specific data duplication and synchronization.
Details
As FHIR R6 enters its final ballots, the long-term coexistence with R4 is deemed inevitable. This project tackled the question of whether multiple versions should be handled within a single dataset. The clear consensus was to maintain a single dataset. The team designed a single store, using PostgreSQL, to hold only FHIR R4. R4 interacts with this store via a direct API, while R6 is served as a computed projection from R4 using FHIR Mapping Language (FML). FML executes 164 maps from R4 to R6, and 63 maps from R6 to R4 (including hand-written maps). The core benefit of this design is that all writes go to the same row, preventing version conflicts and synchronization issues. Furthermore, R6 responses carry the same ID and version ID as the stored R4 resource, ensuring consistency across both versions. This approach addresses the practical requirement that data must be readable and usable across versions over a long period.
Original content copyright by respective publishers