{"id":"ea986fe6-592f-41ea-afe4-2976cd5e2f45","task":"Kick off a FHIR Bulk Data system-level $export with type filtering and poll for completion","domain":"hl7.org/fhir","steps":["Send a GET request to [fhir-base]/$export with headers Accept: application/fhir+json and Prefer: respond-async, optionally adding _type=Patient,Condition,Observation and _typeFilter parameters to scope the export","Receive the 202 Accepted response and extract the polling URL from the Content-Location response header","Poll the Content-Location URL with GET requests at intervals specified by the Retry-After header, checking for 202 (still in progress) versus 200 (complete)","On receipt of 200, parse the JSON manifest body which contains output[] array entries each with a type and url field pointing to NDJSON files, plus optional error[] and deleted[] arrays","Download each NDJSON file using an authorized GET request and process line-by-line, where each line is a complete FHIR resource JSON object"],"gotchas":["The Content-Location polling URL must be used exactly as returned — do not modify or reconstruct it; some servers embed job tokens or signed URLs that break if altered","Bulk export NDJSON files can be extremely large; process them as streams rather than loading entire files into memory, and handle potential 404 errors on individual file downloads if the server expires output files after a time window","The X-Progress header on 202 polling responses is optional and implementation-defined — do not rely on it for progress measurement, and always base completion detection solely on the HTTP status code transitioning from 202 to 200"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:40.623Z"},"url":"https://mcp.waymark.network/r/ea986fe6-592f-41ea-afe4-2976cd5e2f45"}