Retrieving HL7v2 messages in bulk Stay organized with collections Save and categorize content based on your preferences.
Beta
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
This page explains how to bulk read messages from an HL7v2 store using theprojects.locations.datasets.hl7V2Stores.messages.batchGet method.You can usebatchGet to retrieve up to 100 HL7v2 messages with a single call.
You can use theprojects.locations.datasets.hl7V2Stores.messages.getmessage to retrieve a single HL7v2 message at a time, but if you have many messages,you might encounter excessive network costs. To retrieve multiple messagesin one API call, usebatchGet.
Getting HL7v2 messages in bulk
The following samples show how to get the contents of HL7v2 messages in bulk.
For more information, seeprojects.locations.datasets.hl7V2Stores.messages.batchGet.
curl
To get HL7v2 messages in bulk, make aGET request and specify the following information:
- The name of the parent dataset
- The name of the HL7v2 store
- An access token
- The query parameter
nameswith the names of the HL7v2 messages you want toretrieve. For eachnamesvalue, enter the fully qualified path to themessage in the format:projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID/messages/MESSAGE_ID
The following sample shows aGET request usingcurl.
curl-XGET\-H"Authorization: Bearer$(gcloudauthapplication-defaultprint-access-token)"\"https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID /locations/LOCATION/datasets/DATASET_ID /hl7V2Stores/HL7V2_STORE_ID/messages:batchGet?names=MESSAGE_NAME_1&names=MESSAGE_NAME_2&names=MESSAGE_NAME_3&view=FULL"
If the request is successful, the server returns the response in JSON format:
{ "messages" : [ { "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID/messages/MESSAGE_ID" } ]}PowerShell
To get HL7v2 messages in bulk, make aGET request and specify the following information:
- The name of the parent dataset
- The name of the HL7v2 store
- An access token
- The query parameter
nameswith the names of the HL7v2 messages you want toretrieve. For eachnamesvalue, enter the fully qualified path to themessage in the format:projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID/messages/MESSAGE_ID
The following sample shows aGET request using Windows PowerShell.
$cred=gcloudauthapplication-defaultprint-access-token$headers=@{Authorization="Bearer$cred"}Invoke-WebRequest`-MethodGet`-Headers$headers`-Uri"https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID/messages:batchGet?names=MESSAGE_NAME_1&names=MESSAGE_NAME_2&names=MESSAGE_NAME_3&view=FULL"|Select-Object-ExpandContent
If the request is successful, the server returns the response in JSON format:
{ "messages" : [ { "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID/messages/MESSAGE_ID" } ]}See also
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.