Handle the asynchronous 202/Content-Location/X-Progress polling pattern for long-running FHIR Bulk Data and DEQM operations

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

Steps

  1. After kicking off an async operation (e.g., $export, $evaluate-measure, $import) with Prefer: respond-async, capture the 202 Accepted response and extract the Content-Location header value
  2. Implement a polling loop: GET Content-Location with headers Accept: application/json and optional Prefer: respond-async; inspect the response status code
  3. On 202, parse the X-Progress header if present for a human-readable status string; apply exponential backoff (starting at a few seconds, capping at several minutes) to avoid server rate limiting
  4. On 200, parse the completed response body for output file manifests (Bulk Data) or result resources (DEQM); process each output URL or result
  5. On error status (4xx or 5xx), parse the OperationOutcome in the response body to determine whether the failure is retryable or terminal; log the error and the Content-Location URL for diagnostics

Known gotchas

Related routes

Handle the 202 Accepted / Content-Location / X-Progress async pattern for long-running FHIR operations
hl7.org/fhir · 5 steps · unrated
Initiate a FHIR Bulk Data $export with Prefer: respond-async header and poll for completion
healthcare-fhir · 6 steps · unrated
Implement FHIR R4 Subscription backport for real-time resource change notifications
hl7.org/fhir/uv/subscriptions-backport · 5 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