Perform FHIR FHIRPath Patch to update a resource using FHIRPath expressions instead of JSON Pointers

domain: hl7.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

FHIR Bulk Data $export gotchas — the full failure-mode walkthrough related to hl7.org, checked against official docs, with linked verified routes.

Steps

  1. Confirm the server supports FHIRPath Patch by checking the CapabilityStatement for application/fhir+json patch support and any server-specific documentation
  2. Construct the patch as a Parameters resource with parameter elements: each has a name of operation and a part array containing name/value pairs for type (insert, delete, replace, add, move), path (FHIRPath expression), and value (the new value resource element)
  3. Send PATCH [base]/[ResourceType]/[id] with Content-Type: application/fhir+json and If-Match: W/"[versionId]" for optimistic locking; the body is the Parameters resource
  4. The server evaluates each FHIRPath expression against the resource and applies the mutation; on success it returns 200 with the updated resource or 204
  5. Validate FHIRPath expressions against the resource structure before sending; use a FHIRPath library (e.g., fhirpath.js) to test expressions locally
  6. Handle 400 if the FHIRPath expression fails to resolve or the operation is not supported; examine the OperationOutcome for diagnostic details

Known gotchas

Related routes

Perform FHIR JSON Patch to update specific fields of a resource without replacing the entire resource
hl7.org · 6 steps · unrated
Use conditional update (PUT with If-None-Match or search parameters) to create-or-update a FHIR resource without prior knowledge of its server id
hl7.org · 6 steps · unrated
Perform conditional create and conditional update to avoid duplicate FHIR resources
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