Handle the 202 Accepted / Content-Location / X-Progress async pattern for long-running FHIR operations

domain: hl7.org/fhir · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Send the initial operation request (e.g., $export, $import, or $everything) with the Prefer: respond-async header to signal that the client accepts an asynchronous response
  2. On receiving a 202 Accepted response, read the Content-Location header — this is the status polling URL; also read the optional Retry-After header which specifies the minimum polling interval in seconds
  3. Implement a polling loop that sends GET requests to the Content-Location URL at intervals no shorter than the Retry-After value; read X-Progress headers on 202 responses for informational status messages
  4. On receiving a 200 OK from the status endpoint, parse the completed response body as defined by the operation specification
  5. Handle terminal error states: a 4xx or 5xx on the status URL indicates the operation failed; parse the OperationOutcome in the body to extract the error details and determine whether the operation is retryable

Known gotchas

Related routes

Handle the asynchronous 202/Content-Location/X-Progress polling pattern for long-running FHIR Bulk Data and DEQM operations
build.fhir.org · 5 steps · unrated
Initiate a FHIR Bulk Data $export with Prefer: respond-async header and poll for completion
healthcare-fhir · 6 steps · unrated
Implement IHE PMIR (Patient Master Identity Registry) Mobile Patient Identity Feed to publish patient identity create/update/merge events using FHIR
healthcare · 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