Calling the $davinci-data-export Operation

 

This tutorial helps us understand how to call the $davinci-data-export operation for different export types and patient selections. It explains the reasoning behind each choice, the effect of key parameters, and best practices when retrieving patient data.

ATR Export (Member Attribution List)

 

Retrieve the list of members in the Group. This export does not support filtering parameters (e.g., _since, _until, patient).

Sample Request

POST https://api.payer.com/fhir/Group/12345/$davinci-data-export
Authorization: Bearer <access_token>
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: respond-async

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "exportType",
      "valueString": "hl7.fhir.us.davinci-atr"
    },
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    }
  ]
}

Notes

  • The export includes only the required resources: Group, Coverage, and Patient.
  • Intended to synchronize the provider’s member roster with the payer system.

Single Patient Export (Delta)

 

Retrieve only resources for a single patient in the Group that have changed since a specific date (lasttransmitted date/time recorded in the FHIR group). This is useful for minimizing data transfer while keeping the provider’s system up-to-date.

Sample Request

POST https://api.payer.com/fhir/Group/12345/$davinci-data-export
Authorization: Bearer <access_token>
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: respond-async

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "exportType",
      "valueString": "hl7.fhir.us.davinci-pdex#provider-delta"
    },
    {
      "name": "_since",
      "valueDateTime": "2025-10-01T00:00:00Z"
    },
    {
      "name": "patient",
      "valueReference": { "reference": "Patient/1553" }
    },
    {
      "name": "_type",
      "valueString": "Encounter"
    },
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    }
  ]
}

Notes:

  • Only resources updated since _since are returned.
  • Use _type to focus on specific FHIR resources (e.g. Encounter).

Multiple Patients Export (Delta)

 

Retrieve updates for multiple patients in the Group since the lasttransmitted date/time recorded in the FHIR group. Useful when a provider manages care for multiple members but still wants incremental updates.

Sample Request

POST https://api.payer.com/fhir/Group/12345/$davinci-data-export
Authorization: Bearer <access_token>
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: respond-async

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "exportType",
      "valueString": "hl7.fhir.us.davinci-pdex#provider-delta"
    },
    {
      "name": "_since",
      "valueDateTime": "2025-10-01T00:00:00Z"
    },
    {
      "name": "patient",
      "valueReference": { "reference": "Patient/1553" }
    },
    {
      "name": "patient",
      "valueReference": { "reference": "Patient/1678" }
    },
    {
      "name": "_type",
      "valueString": "Encounter"
    },
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    }
  ]
}

Notes:

  • Multiple patient references can be included.
  • _since and _type parameters filter the results.

Full Group Export (Download)

 

Retrieve all resources for members of the Group. Useful when setting up a new system or performing a complete refresh of data.

Sample Request

POST https://api.payer.com/fhir/Group/12345/$davinci-data-export
Authorization: Bearer <access_token>
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: respond-async

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "exportType",
      "valueString": "hl7.fhir.us.davinci-pdex#provider-download"
    },
    {
      "name": "_since",
      "valueDateTime": "2025-09-01T00:00:00Z"
    },
    {
      "name": "_until",
      "valueDateTime": "2025-10-01T00:00:00Z"
    },
    {
      "name": "_type",
      "valueString": "Encounter"
    },
    {
      "name": "_type",
      "valueString": "Coverage"
    },
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    }
  ]
}

Notes:

  • The _since and _until parameters allow filtering by date range, making the export flexible for partial or full refreshes.
  • Returns a complete set of resources for all Group members within the specified date range.
  • _until is optional.

Snapshot Export

 

Retrieve a read-only snapshot of all Group member data for viewing or reporting purposes.

Sample Request

POST https://api.payer.com/fhir/Group/12345/$davinci-data-export
Authorization: Bearer <access_token>
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: respond-async

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "exportType",
      "valueString": "hl7.fhir.us.davinci-pdex#provider-snapshot"
    },
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    }
  ]
}