Expand description
The FHIR Asynchronous Request Pattern
(https://hl7.org/fhir/R4/async.html, and the Bulk Data IG’s version of
it): a request answered with 202 Accepted and a Content-Location to
poll, where the client reads 202 with X-Progress and Retry-After
while the work runs, then the result, or an error with an
OperationOutcome, and can DELETE the location to cancel.
The work itself is an async_jobs row run by haste-health worker
(see haste_worker::async_jobs). This module is the HTTP side: the
status URL, the status and cancel endpoints, and the Prefer header
that asks for the pattern. operation is the first kind of job: an
operation invoked with Prefer: respond-async.
Modules§
- operation
- The
operationkind of job: an operation invoked withPrefer: respond-async, run later by the worker exactly as the request would have run it (the same client, middleware, scopes and access policies, from the submitter’s stored claims), with the resource it returns served as the job’s result.
Structs§
Constants§
- RESPOND_
ASYNC - The
Prefertoken that asks for the asynchronous pattern.
Functions§
- cancel_
handler DELETEof the status URL: cancels the job, or, once it has finished, gives up its result.202 Acceptedeither way;404if there is no such job or it was already cancelled.- prefers_
async - Whether the request’s
Preferheader(s) carryrespond-async. The header is a comma-separated list of preferences (respond-async, return=minimal) and may be repeated. - status_
handler GETof the status URL.- status_
url - The absolute URL the client polls for a job: sibling of the project’s FHIR root, so the same token authorizes it, but outside the FHIR routes since neither its response codes nor its bodies are FHIR interactions.