fhir_version_conflict
A fhir connector sent an update, patch or delete with If-Match (the version id the agent sent as if_match), and the FHIR server answered that the resource has moved on: HTTP 412 Precondition Failed…
HTTP 409 · invalid_request_error · not retryable
What happened
Section titled “What happened”A fhir connector sent an update, patch or delete with If-Match (the version id the agent sent as if_match), and the FHIR server answered that the resource has moved on: HTTP 412 Precondition Failed, or 409 Conflict on HAPI FHIR. The server wrote nothing. The action is recorded as failed, sealed, and never retried: retrying with the same version can’t succeed, and a retry without it would overwrite the other writer’s change.
What to do
Section titled “What to do”Read the resource again (fhir.read), check what changed, and send the write with the new version id. If two agents write the same resource, give one of them the job.
Example
Section titled “Example”{ "error": { "type": "invalid_request_error", "code": "fhir_version_conflict", "message": "The FHIR server refused the write because the resource changed since the version sent. Nothing was written. Read it again and send the new version id.", "param": null, "request_id": "req_01j9zr3m5k8q2w7x4t6v0b1c9d", "doc_url": "https://docs.deedglass.com/errors/fhir_version_conflict" }}The message is for a person and can get more exact over time: branch on type and code, never on the message.
In the SDKs
Section titled “In the SDKs”| SDK | Raised as |
|---|---|
TypeScript (@deedglass/sdk) |
InvalidRequestError with code === "fhir_version_conflict" |
Python (deedglass) |
deedglass.InvalidRequestError with .code == "fhir_version_conflict" |