Query a FHIR server using _revinclude to fetch Provenance resources that reference returned resources, and interpret provenance to trace the origin and chain of custody of clinical data

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. Add _revinclude=Provenance:target to a FHIR search query to instruct the server to include Provenance resources that target any resource in the search result set
  2. Parse the returned Bundle for entries with search.mode=include to identify the Provenance resources, then match each Provenance.target reference to its corresponding resource in the bundle
  3. Extract agent elements from each Provenance resource to identify who acted on the data: agent.who references practitioners or organizations, and agent.onBehalfOf captures delegated actions
  4. Examine Provenance.activity.coding to classify the action (e.g., CREATE, UPDATE, TRANSFORM, VERIFY) and Provenance.entity to identify source resources that were used to derive the target
  5. Use Provenance.recorded timestamp and Provenance.occurredDateTime to reconstruct the audit trail timeline for a given clinical resource

Known gotchas

Related routes

Use _revinclude in a FHIR search to retrieve resources that reference the primary search results in the same Bundle
hl7.org · 6 steps · unrated
Record FHIR Provenance resources to document data lineage and chain of custody for clinical resources
hl7.org/fhir · 5 steps · unrated
Use _include and _revinclude to retrieve referenced resources in a single search request
hl7.org/fhir/R4 · 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