Export Bulk Data at the Population Level

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

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).

Export Search Parameters

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

Parameter

Description

Format

_type

Specify the types of resources to include in the response.

_type applies only to the Patient and applicable Patient Compartment resources.

Example: _type=Encounter returns only Encounter resources

Group format: https://gateway.1up.health/v1/<company-name>/bulk-export/bulk-data/r4/Group/<ID>/$export?_type=Encounter

Group example:
https://gateway.1up.health/v1/ExampleCompany/bulk-export/bulk-data/r4/Group/<ID>/$export?_type=Encounter

Client ID format: https://gateway.1up.health/v1/<company-name>/bulk-export/bulk-data/r4/$export?_type=Encounter

Client ID example: https://gateway.1up.health/v1/ExampleCompany/bulk-export/bulk-data/r4/$export?_type=Encounter

_since

Resources are included in the response if their state has changed after the specified date.

Example: Resource.meta.lastUpdated is later than the specified _since value

Group format: https://gateway.1up.health/v1/<company-name>/bulk-export/bulk-data/r4/Group/<ID>/$export?_since=YYYY-MM-DD

Group example:
https://gateway.1up.health/v1/ExampleCompany/bulk-export/bulk-data/r4/Group/<ID>/$export?_since=2021-01-01

Client ID format: https://gateway.1up.health/v1/<company-name>/bulk-export/bulk-data/r4/$export?_since=YYYY-MM-DD

Client ID example: https://gateway.1up.health/v1/ExampleCompany/bulk-export/bulk-data/r4/$export?_since=2021-01-01

Handling the NDJSON Response

The response to your export request contains a set of links to Newline Delimited JSON (NDJSON) files for the various FHIR resource types. Each NDJSON link in the response contains only one FHIR resource type, but can contain thousands of individual FHIR resources. Depending on how much data is exported, there can be multiple NDJSON links for a single resource type.

To get access the NDJSON files, you must have an access token. You can inject an access token using API test tools such as Postman or cURL. For more information about how to get an access token, see Get Access to the 1upHealth FHIR Server.

To consume the NDJSON contents, you can follow one of the links in the response using your an access token.