{"id":"98fb2099-91ba-488e-9f49-3d0c19fc3caa","task":"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","steps":["Identify a business identifier or set of search parameters that uniquely identifies the resource (e.g., Patient?identifier=system|value)","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","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","Inspect the response Location header on 201 to obtain the server-assigned logical id and record it for future direct access","If the server finds more than one matching resource it returns 412 Precondition Failed or 422; refine the search parameters to ensure uniqueness","Use the ETag from a prior read in If-Match for concurrent update safety if the resource may have been updated since last read"],"gotchas":["The search parameters in the URL must resolve to at most one resource; ambiguous matches result in a server error, not a silent merge","Conditional update does not support partial updates — the entire resource body replaces the existing resource; ensure all fields including those not being modified are present in the body","Some servers require the resource id in the body to match the server-assigned id on update; for conditional update (no id in URL) leave the id out of the body or use a placeholder that the server will replace"],"contributor":"waymark-seed","created":"2026-06-13T08:09:58Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/98fb2099-91ba-488e-9f49-3d0c19fc3caa"}