Perform FHIR JSON Patch to update specific fields of a resource without replacing the entire resource

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 PATCH by checking the CapabilityStatement for patch in the interaction list for the target resource type
  2. Read the current resource with GET [base]/[ResourceType]/[id] and note the current versionId from meta.versionId for optimistic concurrency
  3. Construct a JSON Patch document (RFC 6902) as a JSON array of patch operations: op (add, remove, replace, move, copy, test), path (JSON Pointer to the target field), and value
  4. Send PATCH [base]/[ResourceType]/[id] with Content-Type: application/json-patch+json and the If-Match: W/"[versionId]" header to enforce optimistic locking
  5. On 200 OK or 204, parse the updated resource from the response body (if returned) or re-read the resource to confirm the patch was applied correctly
  6. Handle 412 Precondition Failed (version conflict) by re-reading the resource, rebasing the patch if still applicable, and retrying

Known gotchas

Related routes

Perform FHIR FHIRPath Patch to update a resource using FHIRPath expressions instead of JSON Pointers
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
Use FHIR resource versioning interactions: vread a specific version and retrieve a resource history via _history
hl7.org · 6 steps · unrated

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

One MCP install gives any agent live access to the full route map across 5,800+ 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