{"id":"64320302-2778-41f5-a935-45b3d5380f42","task":"Implement FHIR R4 resource versioning and use the history interaction ([base]/[Resource]/[id]/_history) to retrieve the complete version history of a clinical resource and detect changes between versions","domain":"hl7.org/fhir","steps":["Enable versioning on the FHIR server (if configurable) and verify support by checking the CapabilityStatement versioning field for each resource type (versioned, versioned-update, or no-version)","Retrieve the history of a specific resource via GET [base]/[ResourceType]/[id]/_history, optionally passing _since, _at, and _count parameters to filter the history bundle","Parse the returned Bundle of type history — each entry has a request element (method: PUT or DELETE) and a resource element containing the full resource at that version, with meta.versionId incrementing per change","Diff consecutive versions by comparing key clinical fields to identify what changed between versions, using the meta.lastUpdated timestamps and author information from associated Provenance resources to attribute changes","Use conditional updates with If-Match: W/[versionId] headers when writing updates to prevent lost-update conflicts in concurrent editing scenarios"],"gotchas":["FHIR version history does not guarantee immutability; some server implementations allow administrators to purge history entries, and the absence of a version does not prove tampering","The _history endpoint returns versions in reverse chronological order by default on most servers, but the specification does not mandate ordering; always sort by meta.versionId or meta.lastUpdated before processing","DELETE operations appear in history as an entry with request.method=DELETE and no resource body; code that assumes every history entry contains a full resource will throw null reference errors on deleted versions"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/64320302-2778-41f5-a935-45b3d5380f42"}