Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.hl7V2Stores.import
Import messages to the HL7v2 store by loading data from the specified sources. This method is optimized to load large quantities of data using import semantics that ignore some HL7v2 store configuration options and are not suitable for all use cases. It is primarily intended to load data into an empty HL7v2 store that is not being used by other clients.
An existing message will be overwritten if a duplicate message is imported. A duplicate message is a message with the same raw bytes as a message that already exists in this HL7v2 store. When a message is overwritten, its labels will also be overwritten.
The import operation is idempotent unless the input data contains multiple valid messages with the same raw bytes but different labels. In that case, after the import completes, the store contains exactly one message with those raw bytes but there is no ordering guarantee on which version of the labels it has. The operation result counters do not count duplicated raw bytes as an error and count one success for each message in the input, which might result in a success count larger than the number of messages in the HL7v2 store.
If some messages fail to import, for example due to parsing errors, successfully imported messages are not rolled back.
This method returns an Operation that can be used to track the status of the import by calling operations.get.
Immediate fatal errors appear in the error field, errors are also logged to Cloud Logging (see Viewing error logs in Cloud Logging). Otherwise, when the operation finishes, a response of type ImportMessagesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata.
HTTP request
POST https://healthcare.googleapis.com/v1beta1/{name=projects/*/locations/*/datasets/*/hl7V2Stores/*}:import
Required. The name of the target HL7v2 store, in the format projects/{projectId}/locations/{locationId}/datasets/{datasetId}/hl7v2Stores/{hl7v2_store_id}
Authorization requires the following IAM permission on the specified resource name:
healthcare.hl7v2Stores.import
Request body
The request body contains data with the following structure:
JSON representation
{// Union field source can be only one of the following:"gcsSource": {object(GcsSource)}// End of list of possible types for union field source.}
Fields
Union field source. Specifies the import source and configuration.
To enable the Cloud Healthcare API to read from resources in your project such as Cloud Storage buckets, you must give the consumer Cloud Healthcare API service account the proper permissions. The service account is: service-{PROJECT_NUMBER}@gcp-sa-healthcare.iam.gserviceaccount.com. The PROJECT_NUMBER identifies the project that contains the target HL7v2 store. To get the project number, go to the Cloud Console Dashboard. source can be only one of the following:
Specifies the configuration for importing data from Cloud Storage.
JSON representation
{"uri": string}
Fields
uri
string
Points to a Cloud Storage URI containing file(s) to import.
The URI must be in the following format: gs://{bucket_id}/{objectId}. The URI can include wildcards in objectId and thus identify multiple files. Supported wildcards:
* to match 0 or more non-separator characters
** to match 0 or more characters (including separators). Must be used at the end of a path and with no other wildcards in the path. Can also be used with a file extension (such as .ndjson), which imports all files with the extension in the specified directory and its sub-directories. For example, gs://my-bucket/my-directory/**.ndjson imports all files with .ndjson extensions in my-directory/ and its sub-directories.
? to match 1 character
Files matching the wildcard are expected to contain content only, no metadata.
[[["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 method allows for importing large quantities of HL7v2 messages into an HL7v2 store, optimized for loading data into an empty store.\u003c/p\u003e\n"],["\u003cp\u003eDuplicate messages, identified by identical raw bytes, will be overwritten upon import, including their labels.\u003c/p\u003e\n"],["\u003cp\u003eThe import process is idempotent, except when multiple messages with identical raw bytes but different labels are present, in which case the outcome is not guaranteed regarding which labels are retained.\u003c/p\u003e\n"],["\u003cp\u003eImport failures do not roll back successfully imported messages, and the operation's success count might exceed the actual number of messages in the HL7v2 store due to duplicate raw bytes being counted individually.\u003c/p\u003e\n"],["\u003cp\u003eData is imported from Cloud Storage using a specified URI, with wildcard support for importing multiple files, and requires specific IAM roles for the Cloud Healthcare Service Agent.\u003c/p\u003e\n"]]],[],null,["# Method: hl7V2Stores.import\n\n**Full name**: projects.locations.datasets.hl7V2Stores.import\n\nImport messages to the HL7v2 store by loading data from the specified sources. This method is optimized to load large quantities of data using import semantics that ignore some HL7v2 store configuration options and are not suitable for all use cases. It is primarily intended to load data into an empty HL7v2 store that is not being used by other clients.\n\nAn existing message will be overwritten if a duplicate message is imported. A duplicate message is a message with the same raw bytes as a message that already exists in this HL7v2 store. When a message is overwritten, its labels will also be overwritten.\n\nThe import operation is idempotent unless the input data contains multiple valid messages with the same raw bytes but different labels. In that case, after the import completes, the store contains exactly one message with those raw bytes but there is no ordering guarantee on which version of the labels it has. The operation result counters do not count duplicated raw bytes as an error and count one success for each message in the input, which might result in a success count larger than the number of messages in the HL7v2 store.\n\nIf some messages fail to import, for example due to parsing errors, successfully imported messages are not rolled back.\n\nThis method returns an [Operation](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation) that can be used to track the status of the import by calling `operations.get`.\n\nImmediate fatal errors appear in the [error](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.error) field, errors are also logged to Cloud Logging (see [Viewing error logs in Cloud Logging](https://cloud.google.com/healthcare/docs/how-tos/logging)). Otherwise, when the operation finishes, a response of type `ImportMessagesResponse` is returned in the [response](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.response) field. The [metadata](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.metadata) field type for this operation is [OperationMetadata](/healthcare-api/docs/reference/rest/v1beta1/OperationMetadata).\n\n### HTTP request\n\n`POST https://healthcare.googleapis.com/v1beta1/{name=projects/*/locations/*/datasets/*/hl7V2Stores/*}:import`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\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).\n\nGcsSource\n---------\n\nSpecifies the configuration for importing data from Cloud Storage."]]