Beyond Patient/$merge: A Resource-Agnostic, Client-Driven Merge for FHIR
FHIRのデータマージを拡張:リソース非依存でクライアント主導の統合を実現
Summary
The original FHIR $merge was limited to the Patient resource and relied on the server to determine merge logic. This article proposes an extension that accepts a client-supplied transaction Bundle as a plan parameter, enabling atomic and auditable data merging across all resource types.
Details
While FHIR R5 introduced Patient/$merge for merging duplicate patient records, real-world organizational merge policies vary widely (e.g., one hospital deletes the source entirely, another creates Linkage resources). The original spec was limited to Patients and assumed server control over reference updates. To address this, a new approach was developed: extending $merge to accept a standard transaction Bundle as an additional 'plan' parameter. This allows the client to explicitly define every PUT, POST, or DELETE operation required for the merge plan. The server then guarantees atomicity (all operations succeed or none do) and automatically creates audit resources (Task + Provenance). Furthermore, a new $referencing operation was introduced to generically find all resources referencing a given ID, regardless of where in the resource structure that reference appears. This makes the merge process fully auditable, resource-agnostic, and gives the client full control over the complex merge logic.
Original content copyright by respective publishers