Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.bulk-export-group
Bulk exports a Group resource and resources in the member field, including related resources for each Patient member. The export for each Patient is identical to a GetPatientEverything request.
Accept: specifies the format of the OperationOutcome response. Only application/fhir+json is supported.
Prefer: specifies whether the response is immediate or asynchronous. Must be to respond-async because only asynchronous responses are supported.
Specify the destination for the server to write result files by setting the Cloud Storage location bulkExportGcsDestination on the FHIR store. URI of an existing Cloud Storage directory where the server writes result files, in the format gs://{bucket-id}/{path/to/destination/dir}. If there is no trailing slash, the service appends one when composing the object path. The user is responsible for creating the Cloud Storage bucket referenced.
Supports the following query parameters:
_type: string of comma-delimited FHIR resource types. If provided, only resources of the specified type(s) are exported.
_since: if provided, only resources updated after the specified time are exported.
_outputFormat: optional, specify ndjson to export data in NDJSON format. Exported file names use the format: {export_id}_{resourceType}.ndjson.
organizeOutputBy: resource type to organize the output by. Required and must be set to Patient. When specified, output files are organized by instances of the specified resource type, including the resource, referenced resources, and resources that contain references to that resource.
On success, the Content-Location header of response is set to a URL that you can use to query the status of the export. The URL is in the format projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}/operations/{export_id}. See get-fhir-operation-status for more information.
Errors generated by the FHIR store contain a JSON-encoded OperationOutcome resource describing the reason for the error.
HTTP request
GET https://healthcare.googleapis.com/v1/{name=projects/*/locations/*/datasets/*/fhirStores/*/fhir/Group/*}/$export
Required. Name of the Group resource that is exported, in format projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Group/{groupId}.
Authorization requires the following IAM permission on the specified resource name:
healthcare.fhirStores.export
Query parameters
Parameters
_since
string
Optional. If provided, only resources updated after this time are exported. The time uses the format YYYY-MM-DDThh:mm:ss.sss+zz:zz. For example, 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z. The time must be specified to the second and include a time zone.
_type
string
Optional. String of comma-delimited FHIR resource types. If provided, only resources of the specified resource type(s) are exported.
outputFormat
string
Optional. Output format of the export. This field is optional and only application/fhir+ndjson is supported.
organizeOutputBy
string
Optional. Required. The FHIR resource type used to organize exported resources. Only supports "Patient".
When organized by Patient resource, output files are grouped as follows:
Patient file(s) containing the Patient resources. Each Patient is sequentially followed by all resources the Patient references, and all resources that reference the Patient (equivalent to a GetPatientEverything request).
Individual files grouped by resource type for resources in the Group's member field and the Group resource itself.
Resources may be duplicated across multiple Patients. For example, if two Patient resources reference the same Organization resource, it will appear twice, once after each Patient. The Group resource from the request does not appear in the Patient files.
Request body
The request body must be empty.
Response body
If successful, the response is a generic HTTP response whose format is defined by the method.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[[["\u003cp\u003eThis service facilitates the bulk export of a FHIR Group resource, including its members and related resources, functioning similarly to a GetPatientEverything request for each Patient member.\u003c/p\u003e\n"],["\u003cp\u003eThe destination for the exported data must be pre-configured as a Cloud Storage location within the FHIR store's \u003ccode\u003ebulkExportGcsDestination\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eOnly asynchronous responses are supported, as specified by the \u003ccode\u003ePrefer: respond-async\u003c/code\u003e header in the request, and the status of the export can be monitored via a URL provided in the \u003ccode\u003eContent-Location\u003c/code\u003e header upon initiating the request.\u003c/p\u003e\n"],["\u003cp\u003eThe export process can be customized by using the \u003ccode\u003e_type\u003c/code\u003e parameter to filter by resource types, the \u003ccode\u003e_since\u003c/code\u003e parameter to include resources updated after a specific time, and \u003ccode\u003e_outputFormat\u003c/code\u003e parameter to specify NDJSON format.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eorganizeOutputBy\u003c/code\u003e parameter is mandatory and must be set to "Patient," allowing for the output to be organized by Patient instances and their associated resources.\u003c/p\u003e\n"]]],[],null,["# Method: fhirStores.bulk-export-group\n\n**Full name**: projects.locations.datasets.fhirStores.bulk-export-group\n\nBulk exports a Group resource and resources in the member field, including related resources for each Patient member. The export for each Patient is identical to a GetPatientEverything request.\n\nImplements the FHIR implementation guide [$export group of patients](https://build.fhir.org/ig/HL7/bulk-data/export.html#endpoint---group-of-patients).\n\nThe following headers must be set in the request:\n\n- `Accept`: specifies the format of the `OperationOutcome` response. Only `application/fhir+json` is supported.\n- `Prefer`: specifies whether the response is immediate or asynchronous. Must be to `respond-async` because only asynchronous responses are supported.\n\nSpecify the destination for the server to write result files by setting the Cloud Storage location [bulkExportGcsDestination](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores#FhirStore.FIELDS.bulk_export_gcs_destination) on the FHIR store. URI of an existing Cloud Storage directory where the server writes result files, in the format gs://{bucket-id}/{path/to/destination/dir}. If there is no trailing slash, the service appends one when composing the object path. The user is responsible for creating the Cloud Storage bucket referenced.\n\nSupports the following query parameters:\n\n- `_type`: string of comma-delimited FHIR resource types. If provided, only resources of the specified type(s) are exported.\n\n- `_since`: if provided, only resources updated after the specified time are exported.\n\n- `_outputFormat`: optional, specify ndjson to export data in NDJSON format. Exported file names use the format: {export_id}_{resourceType}.ndjson.\n\n- `organizeOutputBy`: resource type to organize the output by. Required and must be set to `Patient`. When specified, output files are organized by instances of the specified resource type, including the resource, referenced resources, and resources that contain references to that resource.\n\nOn success, the `Content-Location` header of response is set to a URL that you can use to query the status of the export. The URL is in the format `projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}/operations/{export_id}`. See [get-fhir-operation-status](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores.operations/get-fhir-operation-status#google.cloud.healthcare.v1.fhir.rest.FhirService.GetFHIROperationStatus) for more information.\n\nErrors generated by the FHIR store contain a JSON-encoded `OperationOutcome` resource describing the reason for the error.\n\n### HTTP request\n\n`GET https://healthcare.googleapis.com/v1/{name=projects/*/locations/*/datasets/*/fhirStores/*/fhir/Group/*}/$export`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-healthcare`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]