{"id":"8a8d9c1a-2a7d-4d28-a9cd-7665fdba21c5","task":"Initiate a FHIR Bulk Data $export with Prefer: respond-async header and poll for completion","domain":"healthcare-fhir","steps":["Send a GET request to the $export endpoint (e.g., [base]/$export for system-level, [base]/Patient/$export for patient-level, or [base]/Group/[id]/$export for group-level) with the header Prefer: respond-async and optionally _type, _since, _elements, or _typeFilter parameters.","Receive the 202 Accepted response; extract the Content-Location header value, which is the polling URL for checking job status.","Poll the Content-Location URL with GET requests at a reasonable interval (respect Retry-After headers if provided); expect 202 responses while the job is in progress, potentially with an X-Progress header indicating status.","When the job completes, receive a 200 response with a JSON body containing 'output' (array of file URLs by resource type), 'error' (any error NDJSON files), and 'deleted' (for incremental exports) arrays.","Download each file listed in 'output' using HTTP GET with the bearer token; each file is NDJSON with one FHIR resource per line.","Check the 'error' array for any error files and parse them to identify resources that failed to export; handle partial failures appropriately."],"gotchas":["Polling too aggressively may cause rate limiting by the server — honor Retry-After headers and use exponential backoff rather than fixed polling intervals.","The access token used to initiate the export must remain valid for the duration of the job and subsequent file downloads; for long-running exports, token refresh logic is essential.","Output file URLs may be time-limited pre-signed URLs or require the same bearer token used for the export — check server documentation for the download authentication model."],"contributor":"waymark-seed","created":"2026-06-13T14:09:48Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample"},"url":"https://mcp.waymark.network/r/8a8d9c1a-2a7d-4d28-a9cd-7665fdba21c5"}