Export Population-Level Data for a Group

Before you can export population-level data for a group, you must first create a group resource. After you create your group resources, you can export the population-level data for the members of the group. To export the data, you request a list of files that you can use to retrieve the data. You can then call the endpoint for each file to download the data for the group. You can also apply search parameters to your request to specify the start date for the data and the type of resources to include in the response.

After you get access to the FHIR Server and get your access token (Bearer token), you can use your access token to send a GET request or an EXPORT request to the 1up FHIR Server using the Bearer token method.

You can submit an EXPORT request for data for all FHIR resources or for a specific resource type. The base URL for all EXPORT requests at the population level is https://gateway.1up.health/v1/<customer-name>/.

You can use this base URL for the population-level endpoint with any of the other FHIR API requests.

Population-level export supports only GET and EXPORT requests to the 1up FHIR Server. PUT requests are supported only to retry a failed job. POST and DELETE requests are not supported.

If you try to submit a POST or DELETE request to the population-level endpoint, you'll receive a 403 error response.

Create a Group Resource

The first step in the process to export population-level bulk data for a group is to create a group for the member population of FHIR resources that you want to export.

Before you create your member group, it’s important to consider how many resources you want to export. Each member group can contain a maximum of 10,000 members.

Though the FHIR specification includes attributes (period and inactive) that you can specify to determine whether the members you include in a group still belong to the group, the export operation ignores those attributes. If a patient is included in the member array, data for that patient is included in the exported files. Make sure to consider this when you create your group resources.

Before you begin the process to create a group, we recommend that you review the HL7 FHIR R4 information about Resource Groups and how to format a member array in the group.

After your group is created on the 1up Platform, you can export population-level data for the group.

Export Population-Level Bulk Data for the Group

After you create your group resources, you can export the bulk data for the members of the group. To export the data, you request a list of files that you can use to retrieve the data. You can then call the endpoint for each file to download the data for the group. You can also apply search parameters to your request to specify the start date for the data and the type of resources to include in the response.

Before you begin, make sure that you have your access token. If you don't already have an access token, follow the steps in Get Access to the 1upHealth FHIR Server to get your access token.

Search Parameters

You can apply the following search parameters to your request to filter the results by resource type or date.

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

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

Example:
https://gateway.1up.health/v1/ExampleCompany/bulk-export/bulk-data/r4/Group/<ID>/$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

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

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

Get the Download Files List

You can send a request to the endpoint to get the list of download files to use to retrieve the bulk data that you exported using the FHIR $export operator. You can then use the download files to get the group bulk data from the export endpoint.

You must use the token-authentication method to get the list of files. The client header request option is not supported. If you don't already have an access token, follow the steps in Get Access to the 1upHealth FHIR Server to get your access token

For more information about access tokens, see Authentication & Authorization APIs.

For all of the example commands, make sure that you replace the <company-name> and <ID> placeholder text in the request with the correct company name and group ID values.

After you submit your request, the list of download files is returned.

Execute the Group Bulk Export Process

You can use the list of download files you retrieved to connect to the 1upHealth group export endpoint and export the group bulk data for the members you added to your group.

If you change the group resource that includes the patient list (member IDs), you must execute the bulk export operation again to capture the changes in the group.

Download Population-Level Data Exported for a Group

After you execute the population-level bulk export for the group, you can use the links to the Newline Delimited JSON (NDJSON) files for each of the FHIR resource types to download the NDJSON files and consume the data. Each NDJSON link in the response contains only one FHIR resource type, but can contain thousands of individual FHIR resources. There can also be multiple NDJSON links for a single resource type if the size of the data set requires multiple files.

Before you download the contents of the NDJSON files, make sure that you have authenticated using your access token. The client header request option is not supported. If you don't already have an access token, follow the steps in Get Access to the 1upHealth FHIR Server to get your access token

For more information about access tokens, see Authentication & Authorization APIs.

To download the contents of an NDJSON file, go to the link in the response.