Export Bulk Data (Multi Tenant)

You can use the FHIR® Bulk Data APIs ($export operator) to transfer data and analyze data at the population level using a synchronous workflow.

This topic is for customers in a 1up multi-tenant environment (MTE). If you are a 1up customer with a single-tenant environment, see Bulk Data Export (Single Tenant).

To retrieve a list of bulk data files for your client application that you can download, you can submit a request to the analytics bulk-data endpoint with the FHIR Export operator ($export).

Bulk Export with an Access Token

Use this endpoint to export bulk data for a given 1up user using the FHIR® Export operator ($export) . This initial request returns a list of download files, which can be individually requested to retrieve the data.

This request relies on having an Access Token obtained using Auth APIs (first get an authorization code, then exchange for an access token for a 1up user). You can also use client header authorization with the $export operator.

curl --location --request GET 'https://analytics.xxxxfhir.com/bulk-data/r4/$export' \
--header 'Authorization: Bearer {{accessToken}}'

Bulk Export with a Client Header

Use this endpoint to export bulk data for all of your client ID’s 1up users' FHIR data using the FHIR® Export operator ($export). This initial request returns a list of download files, which can be individually requested to retrieve the data.

This uses your client ID and client secret in the header of your request.

curl --location --request GET 'https://analytics.xxxxfhir.com/bulk-data/r4/$export' \
--header 'client_id: xxx' \
--header 'client_secret: yyy' \
--header 'x-oneup-user-id: client'

Export Search Parameters

For FHIR R4, 1up supports the following search parameters for the Export operator ($export).

Parameter

Description

Example

_type

Allows you to specify which types of resources will be included in the response.

For example, _type=Encounter would return only Encounter resources

analytics.{{baseUrl}}/bulk-data/r4/$export?_type=Encounter

Example — analytics.1up.health/bulk-data/r4/$export?_type=Encounter

_since

Resources will only be included in the response if their state has changed after the supplied time (such as if Resource.meta.lastUpdated is later than the supplied _since time).

analytics.1up.health/bulk-data/r4/$export?_since=2021-01-01

Handling NDJSON Response

The response will contain a set of links to Newline Delimited JSON (NDJSON) files for various FHIR resource types. Each NDJSON link in response will contain only one FHIR resource type. but can contain 1000s of individual FHIR resources. Depending on how much data is being exported, there may even be multiple NDJSON links for a single Resource Type.

To access the .ndjson files, you must have either an access token or client credential headers. You can inject an access token using API test tools such as Postman or cURL.

To consume the NDJSON contents, you can follow one of the links in the response using either an access token or client credentials headers.