Skip to main content

messages

Creates, updates, deletes, gets or lists a messages resource.

Overview

Namemessages
TypeResource
Idgoogle.healthcare.messages

Fields

NameDatatypeDescription
namestringOutput only. Resource name of the Message, of the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}.
createTimestringOutput only. The datetime when the message was created. Set by the server.
datastringRequired. Raw message bytes.
labelsobjectUser-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.
messageTypestringOutput only. The message type for this message. MSH-9.1.
parsedDataobjectThe content of a HL7v2 message in a structured format.
patientIdsarrayOutput only. All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
schematizedDataobjectThe content of an HL7v2 message in a structured format as specified by a schema.
sendFacilitystringOutput only. The hospital that this message came from. MSH-4.
sendTimestringOutput only. The datetime the sending application sent this message. MSH-7.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatasetsId, hl7V2StoresId, locationsId, messagesId, projectsIdGets an HL7v2 message.
listSELECTdatasetsId, hl7V2StoresId, locationsId, projectsIdLists all the messages in the given HL7v2 store with support for filtering. Note: HL7v2 messages are indexed asynchronously, so there might be a slight delay between the time a message is created and when it can be found through a filter.
createINSERTdatasetsId, hl7V2StoresId, locationsId, projectsIdParses and stores an HL7v2 message. This method triggers an asynchronous notification to any Pub/Sub topic configured in Hl7V2Store.Hl7V2NotificationConfig, if the filtering matches the message. If an MLLP adapter is configured to listen to a Pub/Sub topic, the adapter transmits the message when a notification is received.
deleteDELETEdatasetsId, hl7V2StoresId, locationsId, messagesId, projectsIdDeletes an HL7v2 message.
patchUPDATEdatasetsId, hl7V2StoresId, locationsId, messagesId, projectsIdUpdate the message. The contents of the message in Message.data and data extracted from the contents such as Message.create_time cannot be altered. Only the Message.labels field is allowed to be updated. The labels in the request are merged with the existing set of labels. Existing labels with the same keys are updated.
ingestEXECdatasetsId, hl7V2StoresId, locationsId, projectsIdParses and stores an HL7v2 message. This method triggers an asynchronous notification to any Pub/Sub topic configured in Hl7V2Store.Hl7V2NotificationConfig, if the filtering matches the message. If an MLLP adapter is configured to listen to a Pub/Sub topic, the adapter transmits the message when a notification is received. If the method is successful, it generates a response containing an HL7v2 acknowledgment (ACK) message. If the method encounters an error, it returns a negative acknowledgment (NACK) message. This behavior is suitable for replying to HL7v2 interface systems that expect these acknowledgments.

SELECT examples

Lists all the messages in the given HL7v2 store with support for filtering. Note: HL7v2 messages are indexed asynchronously, so there might be a slight delay between the time a message is created and when it can be found through a filter.

SELECT
name,
createTime,
data,
labels,
messageType,
parsedData,
patientIds,
schematizedData,
sendFacility,
sendTime
FROM google.healthcare.messages
WHERE datasetsId = '{{ datasetsId }}'
AND hl7V2StoresId = '{{ hl7V2StoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new messages resource.

/*+ create */
INSERT INTO google.healthcare.messages (
datasetsId,
hl7V2StoresId,
locationsId,
projectsId,
message
)
SELECT
'{{ datasetsId }}',
'{{ hl7V2StoresId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ message }}'
;

UPDATE example

Updates a messages resource.

/*+ update */
UPDATE google.healthcare.messages
SET
data = '{{ data }}',
labels = '{{ labels }}'
WHERE
datasetsId = '{{ datasetsId }}'
AND hl7V2StoresId = '{{ hl7V2StoresId }}'
AND locationsId = '{{ locationsId }}'
AND messagesId = '{{ messagesId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified messages resource.

/*+ delete */
DELETE FROM google.healthcare.messages
WHERE datasetsId = '{{ datasetsId }}'
AND hl7V2StoresId = '{{ hl7V2StoresId }}'
AND locationsId = '{{ locationsId }}'
AND messagesId = '{{ messagesId }}'
AND projectsId = '{{ projectsId }}';