{"id":"05adcf80-844f-4741-b3ce-bc14289463e9","task":"Parse the Content-Location manifest from a completed FHIR Bulk Data $export and download NDJSON output files with error file handling","domain":"hl7.org","steps":["After the async export completes, parse the JSON response body; extract the output array (successfully exported files) and the error array (files containing OperationOutcome resources for failed resources)","For each entry in output[], record the type (resource type) and url; download each file via GET with Authorization: Bearer {token}; stream large files to avoid memory exhaustion","For each line in each downloaded NDJSON file, parse the JSON object and validate it is the expected resourceType before processing","For each entry in error[], download the error NDJSON file and parse each OperationOutcome to identify which resources failed export and why; log for remediation","Verify total resource counts in the manifest (if provided by the server) against the count of NDJSON lines downloaded to detect truncated files or download failures"],"gotchas":["NDJSON files may not have a .ndjson extension and content-type headers may vary; rely on the manifest output[].type field to determine resource type rather than file extension or content-type","Error files contain OperationOutcome resources, not the failed FHIR resources themselves; you cannot recover the content of failed resources from the error file alone","Bulk Data output file URLs may require the same Bearer token used for the export kick-off; attempting to download files without a valid token (or with an expired token from a long-running export) results in 401 errors"],"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:40:37.260Z"},"url":"https://mcp.waymark.network/r/05adcf80-844f-4741-b3ce-bc14289463e9"}