72.10.1Poll 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.

72.10.1.1Steps to Poll Asynchronous Exports

  1. After calling $davinci-data-export, check the Location header in the HTTP 202 response for the polling URL.
    • e.g., Content-Location: https://api.payer.com/fhir/Group/12345/export-status/67890
  2. Poll the URL at regular intervals (e.g., every 30–60 seconds) until the job status shows completed.
  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

POST https://api.payer.com/fhir/Group/12345/export-status/67890
Authorization: Bearer <access_token>
Accept: application/json
Content-Type: application/fhir+json

Sample JSON Response from Polling URL

{
  "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/BulkData/exports/job12345/Encounter.ndjson"
    }
  ],
  "error" : []
}