Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.hl7V2Stores.export
Exports the messages to a destination. To filter messages to be exported, define a filter using the start and end time, relative to the message generation time (MSH.7).
This API returns an Operation that can be used to track the status of the job by calling operations.get.
Immediate fatal errors appear in the error field. Otherwise, when the operation finishes, a detailed response of type ExportMessagesResponse 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/*}:export
Required. The name of the source 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.export
Request body
The request body contains data with the following structure:
JSON representation
{"startTime": string,"endTime": string,"filter": string,// Union field destination can be only one of the following:"gcsDestination": {object(GcsDestination)},"pubsubDestination": {object(PubsubDestination)}// End of list of possible types for union field destination.}
This value has to come before the endTime defined below. Only messages whose sendTime lies in the range startTime (inclusive) to endTime (exclusive) are exported.
Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
This value has to come after the startTime defined below. Only messages whose sendTime lies in the range startTime (inclusive) to endTime (exclusive) are exported.
Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
filter
string
Restricts messages exported to those matching a filter, only applicable to PubsubDestination and GcsDestination. The following syntax is available:
A string field value can be written as text inside quotation marks, for example "query text". The only valid relational operation for text fields is equality(=), where text is searched within the field, rather than having the field be equal to the text. For example, "Comment = great" returns messages with great in the comment field.
A number field value can be written as an integer, a decimal, or an exponential. The valid relational operators for number fields are the equality operator(=), along with the less than/greater than operators(<, <=, >, >=). Note that there is no inequality (!=) operator. You can prepend the NOT operator to an expression to negate it.
A date field value must be written in the yyyy-mm-dd format. Fields with date and time use the RFC3339 time format. Leading zeros are required for one-digit months and days. The valid relational operators for date fields are the equality operator(=) , along with the less than/greater than operators(<, <=, >, >=). Note that there is no inequality(!=) operator. You can prepend the NOT operator to an expression to negate it.
Multiple field query expressions can be combined in one query by adding AND or OR operators between the expressions. If a boolean operator appears within a quoted string, it is not treated as special, and is just another part of the character string to be matched. You can prepend the NOT operator to an expression to negate it.
The following fields and functions are available for filtering:
messageType, from the MSH-9.1 field. For example, NOT messageType = "ADT".
send_date or sendDate, the YYYY-MM-DD date the message was sent in the dataset's timeZone, from the MSH-7 segment. For example, send_date < "2017-01-02".
sendTime, the timestamp when the message was sent, using the RFC3339 time format for comparisons, from the MSH-7 segment. For example, sendTime < "2017-01-02T00:00:00-05:00".
createTime, the timestamp when the message was created in the HL7v2 store. Use the RFC3339 time format for comparisons. For example, createTime < "2017-01-02T00:00:00-05:00".
sendFacility, the care center that the message came from, from the MSH-4 segment. For example, sendFacility = "ABC".
Note: The filter will be applied to every message in the HL7v2 store whose sendTime lies in the range defined by the startTime and the endTime. Even if the filter only matches a small set of messages, the export operation can still take a long time to finish when a lot of messages are between the specified startTime and endTime range.
Union field destination. Export destination. destination can be only one of the following:
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.
[[["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 API allows you to export HL7v2 messages from a specified store to either a Cloud Storage location or a Pub/Sub topic, as defined in the request body.\u003c/p\u003e\n"],["\u003cp\u003eYou can filter the messages to be exported based on the \u003ccode\u003esendTime\u003c/code\u003e (MSH.7) field, using a \u003ccode\u003estartTime\u003c/code\u003e and \u003ccode\u003eendTime\u003c/code\u003e range, and also by applying specific filtering criteria on various fields using the \u003ccode\u003efilter\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe export operation's status can be tracked using the \u003ccode\u003eOperation\u003c/code\u003e resource returned by this API, and successful exports return a detailed \u003ccode\u003eExportMessagesResponse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires you to specify the export destination, either \u003ccode\u003egcsDestination\u003c/code\u003e for Cloud Storage or \u003ccode\u003epubsubDestination\u003c/code\u003e for Pub/Sub, and each requires specific service agent roles for authorization.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003efilter\u003c/code\u003e parameter allows you to restrict messages by filtering based on fields like \u003ccode\u003emessageType\u003c/code\u003e, \u003ccode\u003esend_date\u003c/code\u003e, \u003ccode\u003esendTime\u003c/code\u003e, \u003ccode\u003ecreateTime\u003c/code\u003e, and \u003ccode\u003esendFacility\u003c/code\u003e using various relational operators and boolean logic.\u003c/p\u003e\n"]]],[],null,["# Method: hl7V2Stores.export\n\n**Full name**: projects.locations.datasets.hl7V2Stores.export\n\nExports the messages to a destination. To filter messages to be exported, define a filter using the start and end time, relative to the message generation time (MSH.7).\n\nThis API returns an [Operation](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation) that can be used to track the status of the job by calling `operations.get`.\n\nImmediate fatal errors appear in the [error](/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.error) field. Otherwise, when the operation finishes, a detailed response of type `ExportMessagesResponse` 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/*}:export`\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\nGcsDestination\n--------------\n\nThe Cloud Storage output destination.\n\nThe Cloud Healthcare Service Agent requires the `roles/storage.objectAdmin` Cloud IAM roles on the Cloud Storage location.\n\nContentStructure\n----------------\n\nThe content structure of the exported HL7v2 message files.\n\nPubsubDestination\n-----------------\n\nThe Pub/Sub output destination.\n\nThe Cloud Healthcare Service Agent requires the `roles/pubsub.publisher` Cloud IAM role on the Pub/Sub topic."]]