{"id":"1531c2ba-b419-4fb1-a4e4-4b09d81228df","task":"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","steps":["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","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","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","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","Use Provenance.recorded timestamp and Provenance.occurredDateTime to reconstruct the audit trail timeline for a given clinical resource"],"gotchas":["Not all FHIR servers populate Provenance resources automatically; many require the writing application to explicitly submit Provenance alongside data, so absence of Provenance does not mean absence of history","_revinclude is processed per page of results; when paginating, each page independently includes only the Provenance records for that page's resources, so you must process includes page by page","Provenance chaining (deriving from another Provenance) is allowed in FHIR but infrequently implemented; do not assume a single Provenance record captures the full history of a derived resource"],"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/1531c2ba-b419-4fb1-a4e4-4b09d81228df"}