{"id":"6be1a109-4dc3-4518-a57e-15a64ef144e7","task":"Handle the asynchronous 202/Content-Location/X-Progress polling pattern for long-running FHIR Bulk Data and DEQM operations","domain":"build.fhir.org","steps":["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","Implement a polling loop: GET Content-Location with headers Accept: application/json and optional Prefer: respond-async; inspect the response status code","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","On 200, parse the completed response body for output file manifests (Bulk Data) or result resources (DEQM); process each output URL or result","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"],"gotchas":["Some servers return 200 with a still-in-progress indicator in the body rather than 202; always check both the HTTP status code and any status field in the response body before treating a 200 as completion","The Content-Location URL is typically valid only for the lifetime of the async operation and a short window afterward; failing to download output files before the server expires them results in data loss with no retry path","Polling too aggressively (e.g., sub-second intervals) may trigger server-side rate limiting or cause the operation to be cancelled; respect Retry-After headers when provided and default to at least 10-second intervals"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:44.792Z"},"url":"https://mcp.waymark.network/r/6be1a109-4dc3-4518-a57e-15a64ef144e7"}