Skip to main content

messages

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

Overview

Namemessages
TypeResource
Idgoogle.healthcare.messages

Fields

The following fields are returned by SELECT queries:

Successful response

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}.
createTimestring (google-datetime)Output only. The datetime when the message was created. Set by the server.
datastring (byte)Required. 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.
parsedDataobjectOutput only. The parsed version of the raw message data. (id: ParsedData)
patientIdsarrayOutput only. All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
schematizedDataobjectOutput only. The parsed version of the raw message data schematized according to this store's schemas and type definitions. (id: SchematizedData)
sendFacilitystringOutput only. The hospital that this message came from. MSH-4.
sendTimestring (google-datetime)Output only. The datetime the sending application sent this message. MSH-7.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, datasetsId, hl7V2StoresId, messagesIdviewGets an HL7v2 message.
listselectprojectsId, locationsId, datasetsId, hl7V2StoresIdpageSize, pageToken, filter, orderBy, viewLists 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.
createinsertprojectsId, locationsId, datasetsId, hl7V2StoresIdParses 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.
patchupdateprojectsId, locationsId, datasetsId, hl7V2StoresId, messagesIdupdateMaskUpdate 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.
deletedeleteprojectsId, locationsId, datasetsId, hl7V2StoresId, messagesIdDeletes an HL7v2 message.
ingestexecprojectsId, locationsId, datasetsId, hl7V2StoresIdParses 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
datasetsIdstring
hl7V2StoresIdstring
locationsIdstring
messagesIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

Gets an HL7v2 message.

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

INSERT examples

Parses 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.

INSERT INTO google.healthcare.messages (
data__message,
projectsId,
locationsId,
datasetsId,
hl7V2StoresId
)
SELECT
'{{ message }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ datasetsId }}',
'{{ hl7V2StoresId }}'
RETURNING
name,
createTime,
data,
labels,
messageType,
parsedData,
patientIds,
schematizedData,
sendFacility,
sendTime
;

UPDATE examples

Update 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.

UPDATE google.healthcare.messages
SET
data__data = '{{ data }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND hl7V2StoresId = '{{ hl7V2StoresId }}' --required
AND messagesId = '{{ messagesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
data,
labels,
messageType,
parsedData,
patientIds,
schematizedData,
sendFacility,
sendTime;

DELETE examples

Deletes an HL7v2 message.

DELETE FROM google.healthcare.messages
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND hl7V2StoresId = '{{ hl7V2StoresId }}' --required
AND messagesId = '{{ messagesId }}' --required;

Lifecycle Methods

Parses 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.

EXEC google.healthcare.messages.ingest 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required,
@hl7V2StoresId='{{ hl7V2StoresId }}' --required
@@json=
'{
"message": "{{ message }}"
}';