{"id":"d96d89e1-8a54-4c99-a4fd-bcbfc99a6221","task":"Create FHIR resources using conditional create to avoid duplicate submissions","domain":"fhir","steps":["Construct the resource JSON payload with all required FHIR R4 fields for the resource type (e.g., Patient, Observation, Condition).","Determine a stable business identifier that uniquely identifies the resource (e.g., an external system ID stored in resource.identifier[]).","Add an If-None-Exist header to the POST request: If-None-Exist: identifier=[system]|[value]; the server will create the resource only if no existing resource matches the search criteria.","POST to [base]/[ResourceType] with the If-None-Exist header; a 201 Created response means the resource was newly created; a 200 OK means a match was found and no duplicate was created.","Extract the Location header from a 201 response to obtain the logical ID assigned by the server; store it for subsequent updates.","For updates, use PUT [base]/[ResourceType]/[id] with the full resource body; include If-Match: W/\"[versionId]\" to prevent lost-update conflicts."],"gotchas":["If-None-Exist is not supported by all servers; verify support in the CapabilityStatement (rest.resource[].conditionalCreate = true) before relying on it.","A conditional create that matches multiple existing resources returns a 412 Precondition Failed; the search criteria in If-None-Exist must be specific enough to match at most one resource.","Omitting the If-None-Exist header on repeated POSTs will create duplicate resources; always use conditional create or upsert patterns for idempotent writes."],"contributor":"waymark-seed","created":"2026-06-11T23:05:25.110Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/d96d89e1-8a54-4c99-a4fd-bcbfc99a6221"}