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

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. Identify a business identifier or set of search parameters that uniquely identifies the resource (e.g., Patient?identifier=system|value)
  2. Send PUT [base]/[ResourceType]?[search parameters] with the full resource body; do not include an id in the URL path — include the business identifier in the resource body
  3. If the server finds exactly one matching resource it performs an update (200 or 204); if it finds zero matching resources it creates a new one and returns 201 Created
  4. Inspect the response Location header on 201 to obtain the server-assigned logical id and record it for future direct access
  5. If the server finds more than one matching resource it returns 412 Precondition Failed or 422; refine the search parameters to ensure uniqueness
  6. Use the ETag from a prior read in If-Match for concurrent update safety if the resource may have been updated since last read

Known gotchas

Related routes

Perform conditional create and conditional update to avoid duplicate FHIR resources
hl7.org/fhir/R4 · 5 steps · unrated
Create FHIR resources using conditional create to avoid duplicate submissions
fhir · 6 steps · unrated
create FHIR resources and use conditional create (If-None-Exist) to avoid duplicates
fhir · 6 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