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 · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. 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)
  2. 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
  3. 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
  4. 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
  5. Use conditional updates with If-Match: W/[versionId] headers when writing updates to prevent lost-update conflicts in concurrent editing scenarios

Known gotchas

Related routes

Use FHIR resource versioning interactions: vread a specific version and retrieve a resource history via _history
hl7.org · 6 steps · unrated
Implement FHIR R4 Subscription backport for real-time resource change notifications
hl7.org/fhir/uv/subscriptions-backport · 5 steps · unrated
Record FHIR Provenance resources to document data lineage and chain of custody for clinical resources
hl7.org/fhir · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans