messages
Creates, updates, deletes, gets or lists a messages
resource.
Overview
Name | messages |
Type | Resource |
Id | google.healthcare.messages |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output 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} . |
createTime | string | Output only. The datetime when the message was created. Set by the server. |
data | string | Required. Raw message bytes. |
labels | object | User-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. |
messageType | string | Output only. The message type for this message. MSH-9.1. |
parsedData | object | The content of a HL7v2 message in a structured format. |
patientIds | array | Output only. All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message. |
schematizedData | object | The content of an HL7v2 message in a structured format as specified by a schema. |
sendFacility | string | Output only. The hospital that this message came from. MSH-4. |
sendTime | string | Output only. The datetime the sending application sent this message. MSH-7. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | datasetsId, hl7V2StoresId, locationsId, messagesId, projectsId | Gets an HL7v2 message. |
list | SELECT | datasetsId, hl7V2StoresId, locationsId, projectsId | 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. |
create | INSERT | datasetsId, hl7V2StoresId, locationsId, projectsId | 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. |
delete | DELETE | datasetsId, hl7V2StoresId, locationsId, messagesId, projectsId | Deletes an HL7v2 message. |
patch | UPDATE | datasetsId, hl7V2StoresId, locationsId, messagesId, projectsId | 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. |
ingest | EXEC | datasetsId, hl7V2StoresId, locationsId, projectsId | 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. |
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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.healthcare.messages (
datasetsId,
hl7V2StoresId,
locationsId,
projectsId,
message
)
SELECT
'{{ datasetsId }}',
'{{ hl7V2StoresId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ message }}'
;
- name: your_resource_model_name
props:
- name: message
value:
- name: name
value: string
- name: data
value: string
- name: createTime
value: string
- name: sendFacility
value: string
- name: sendTime
value: string
- name: messageType
value: string
- name: patientIds
value:
- - name: value
value: string
- name: type
value: string
- name: labels
value: object
- name: parsedData
value:
- name: segments
value:
- - name: segmentId
value: string
- name: setId
value: string
- name: fields
value: object
- name: schematizedData
value:
- name: data
value: string
- name: error
value: string
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 }}';