Poll Asynchronous Exports

 

When $davinci-data-export is initiated, the operation runs asynchronously. The export job URL must be polled to retrieve the data once it is ready.

Steps to Poll Asynchronous Exports

  1. After calling $davinci-data-export, check the Content-Location header in the HTTP 202 response for the polling URL.
    • e.g., Content-Location: https://api.payer.com/fhir/$export-poll-status?_jobId=67890
  2. Poll the URL at regular intervals (e.g., every 30–60 seconds). While the job is running, the response is HTTP 202 Accepted with an X-Progress header. When the job is complete, the response is HTTP 200 OK with the list of output files.
  3. If the job fails or returns an error, log the issue and retry after resolving the cause.

Notes: Avoid excessive polling to reduce load on the FHIR server.

Sample Polling Request

GET https://api.payer.com/fhir/$export-poll-status?_jobId=67890
Authorization: Bearer <access_token>
Accept: application/json

Sample JSON Response from Polling URL (HTTP 200 OK)

Each url points to a Binary resource containing the NDJSON data of one resource type. Read it with the same access token.

{
  "transactionTime": "2025-11-13T12:00:00Z",
  "request": "https://api.payer.com/fhir/Group/12345/$davinci-data-export",
  "requiresAccessToken": true,
  "output": [
    {
      "type": "Encounter",
      "url": "https://api.payer.com/fhir/Binary/abc123"
    }
  ],
  "error" : []
}