Package google.cloud.healthcare.v1beta1.hl7v2

Index

Hl7V2Service

A service for handling HL7v2 messages (v2.x).

CreateHl7V2Store

rpc CreateHl7V2Store(CreateHl7V2StoreRequest) returns (Hl7V2Store)

Creates a new HL7v2 store within the parent dataset.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateMessage

rpc CreateMessage(CreateMessageRequest) returns (Message)

Creates a message and sends a notification to the Cloud Pub/Sub topic. If configured, the MLLP adapter listens to messages created by this method and sends those back to the hospital. A successful response indicates the message has been persisted to storage and a Cloud Pub/Sub notification has been sent. Sending to the hospital by the MLLP adapter happens asynchronously.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteHl7V2Store

rpc DeleteHl7V2Store(DeleteHl7V2StoreRequest) returns (Empty)

Deletes the specified HL7v2 store and removes all messages that are contained within it.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteMessage

rpc DeleteMessage(DeleteMessageRequest) returns (Empty)

Deletes an HL7v2 message.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetHl7V2Store

rpc GetHl7V2Store(GetHl7V2StoreRequest) returns (Hl7V2Store)

Gets the specified HL7v2 store.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetMessage

rpc GetMessage(GetMessageRequest) returns (Message)

Gets an HL7v2 message.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IngestMessage

rpc IngestMessage(IngestMessageRequest) returns (IngestMessageResponse)

Ingests a new HL7v2 message from the hospital and sends a notification to the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was successfully stored. Otherwise an error is returned.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListHl7V2Stores

rpc ListHl7V2Stores(ListHl7V2StoresRequest) returns (ListHl7V2StoresResponse)

Lists the HL7v2 stores in the given dataset.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListMessages

rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse)

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.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateHl7V2Store

rpc UpdateHl7V2Store(UpdateHl7V2StoreRequest) returns (Hl7V2Store)

Updates the HL7v2 store.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateMessage

rpc UpdateMessage(UpdateMessageRequest) returns (Message)

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.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateHl7V2StoreRequest

Creates a new HL7v2 store.

Fields
parent

string

The name of the dataset this HL7v2 store belongs to.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.hl7V2Stores.create
hl7_v2_store_id

string

The ID of the HL7v2 store that is being created. The string must match the following regex: [\p{L}\p{N}_\-\.]{1,256}.

hl7_v2_store

Hl7V2Store

Configuration info for this HL7v2 store.

CreateMessageRequest

Creates a new message.

Fields
parent

string

The name of the dataset this message belongs to.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.hl7V2Messages.create
message

Message

HL7v2 message.

DeleteHl7V2StoreRequest

Deletes the specified HL7v2 store.

Fields
name

string

The resource name of the HL7v2 store to delete.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.hl7V2Stores.delete

DeleteMessageRequest

Deletes a message from the specified HL7v2 store.

Fields
name

string

The resource name of the HL7v2 message to delete.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.hl7V2Messages.delete

GetHl7V2StoreRequest

Gets an HL7v2 store.

Fields
name

string

The resource name of the HL7v2 store to get.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.hl7V2Stores.get

GetMessageRequest

Gets a message from the specified HL7v2 store.

Fields
name

string

The resource name of the HL7v2 message to retrieve.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.hl7V2Messages.get
view

MessageView

Specifies which parts of the Message resource to return in the response. When unspecified, equivalent to FULL.

GroupOrSegment

Construct representing a logical group or a segment.

Fields

Union field value.

value can be only one of the following:

segment

SchemaSegment

group

SchemaGroup

Hl7SchemaConfig

Root config message for HL7v2 schema. This contains a schema structure of groups and segments, and filters that determine which messages to apply the schema structure to.

Fields
version[]

VersionSource

Each VersionSource is tested and only if they all match is the schema used for the message.

message_schema_configs

map<string, SchemaGroup>

Map from each HL7v2 message type and trigger event pair, such as ADT_A04, to its schema configuration root group.

Hl7TypesConfig

Root config for HL7v2 datatype definitions for a specific HL7v2 version.

Fields
version[]

VersionSource

The version selectors that this config applies to. A message must match ALL version sources to apply.

type[]

Type

The HL7v2 type definitions.

Hl7V2Store

Represents an HL7v2 store.

Fields
name

string

Output only. Resource name of the HL7v2 store, of the form projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}.

notification_config
(deprecated)

NotificationConfig

The notification destination all messages (both Ingest & Create) are published on. Only the message name is sent as part of the notification. If this is unset, no notifications are sent. Supplied by the client.

parser_config

ParserConfig

The configuration for the parser. It determines how the server parses the messages.

labels

map<string, string>

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}][\p{Ll}\p{Lo}\p{N}_-]{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.

notification_configs[]

Hl7V2NotificationConfig

A list of notification configs. Each configuration uses a filter to determine whether to publish a message (both Ingest & Create) on the corresponding notification destination. Only the message name is sent as part of the notification. Supplied by the client.

reject_duplicate_message

bool

Determines whether duplicate messages should be rejected. A duplicate message is a message with the same raw bytes as a message that has already been ingested/created in this HL7v2 store. The default value is false, meaning that the store accepts the duplicate messages and it also returns the same ACK message in the IngestMessageResponse as has been returned previously. Note that only one resource is created in the store. When this field is set to true, CreateMessage/IngestMessage requests with a duplicate message will be rejected by the store, and IngestMessageErrorDetail returns a NACK message upon rejection.

Hl7V2NotificationConfig

Specifies where and whether to send notifications upon changes to a data store.

Fields
pubsub_topic

string

The Cloud Pub/Sub topic that notifications of changes are published on. Supplied by the client. The notification is a PubsubMessage with the following fields:

  • PubsubMessage.Data contains the resource name.
  • PubsubMessage.MessageId is the ID of this notification. It is guaranteed to be unique within the topic.
  • PubsubMessage.PublishTime is the time at which the message was published.

Note that notifications are only sent if the topic is non-empty. Topic names must be scoped to a project. Cloud Healthcare API service account must have publisher permissions on the given Pub/Sub topic. Not having adequate permissions causes the calls that send notifications to fail.

If a notification cannot be published to Cloud Pub/Sub, errors will be logged to Cloud Logging (see [Viewing logs](/healthcare/docs/how- tos/logging)).

filter

string

Restricts notifications sent for messages matching a filter. If this is empty, all messages are matched. Syntax: https://cloud.google.com/appengine/docs/standard/python/search/query_strings

Fields/functions available for filtering are:

  • message_type, from the MSH-9.1 field. For example, NOT message_type = "ADT".
  • send_date or sendDate, the YYYY-MM-DD date the message was sent in the dataset's time_zone, from the MSH-7 segment. For example, send_date < "2017-01-02".
  • send_time, the timestamp when the message was sent, using the RFC3339 time format for comparisons, from the MSH-7 segment. For example, send_time < "2017-01-02T00:00:00-05:00".
  • send_facility, the care center that the message came from, from the MSH-4 segment. For example, send_facility = "ABC".
  • PatientId(value, type), which matches if the message lists a patient having an ID of the given value and type in the PID-2, PID-3, or PID-4 segments. For example, PatientId("123456", "MRN").
  • labels.x, a string value of the label with key x as set using the Message.labels map. For example, labels."priority"="high". The operator :* can be used to assert the existence of a label. For example, labels."priority":*.

IngestMessageErrorDetail

Contains the HL7v2 NACK message for ingest message failure.

Fields
hl7_nack

bytes

HL7v2 NACK message.

IngestMessageRequest

Ingests a message into the specified HL7v2 store.

Fields
parent

string

The name of the HL7v2 store this message belongs to.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.hl7V2Messages.ingest
message

Message

HL7v2 message to ingest.

IngestMessageResponse

Acknowledges that a message has been ingested into the specified HL7v2 store.

Fields
hl7_ack

bytes

HL7v2 ACK message.

message

Message

Created message resource.

ListHl7V2StoresRequest

Lists the HL7v2 stores in the given dataset.

Fields
parent

string

Name of the dataset.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.hl7V2Stores.list
page_size

int32

Limit on the number of HL7v2 stores to return in a single response. If zero the default page size of 100 is used.

page_token

string

The next_page_token value returned from the previous List request, if any.

filter

string

Restricts stores returned to those matching a filter. Syntax: https://cloud.google.com/appengine/docs/standard/python/search/query_strings Only filtering on labels is supported. For example, labels.key=value.

ListHl7V2StoresResponse

Lists the HL7v2 stores in the given dataset.

Fields
hl7_v2_stores[]

Hl7V2Store

The returned HL7v2 stores. Won't be more HL7v2 stores than the value of page_size in the request.

next_page_token

string

Token to retrieve the next page of results or empty if there are no more results in the list.

ListMessagesRequest

Lists the messages in the specified HL7v2 store.

Fields
parent

string

Name of the HL7v2 store to retrieve messages from.

Authorization requires the following IAM permission on the specified resource parent:

  • healthcare.hl7V2Messages.list
page_size

int32

Limit on the number of messages to return in a single response. If zero the default page size of 100 is used.

page_token

string

The next_page_token value returned from the previous List request, if any.

filter

string

Restricts messages returned to those matching a filter. Syntax: https://cloud.google.com/appengine/docs/standard/python/search/query_strings

Fields/functions available for filtering are:

  • message_type, from the MSH-9.1 field. For example, NOT message_type = "ADT".
  • send_date or sendDate, the YYYY-MM-DD date the message was sent in the dataset's time_zone, from the MSH-7 segment. For example, send_date < "2017-01-02".
  • send_time, the timestamp when the message was sent, using the RFC3339 time format for comparisons, from the MSH-7 segment. For example, send_time < "2017-01-02T00:00:00-05:00".
  • send_facility, the care center that the message came from, from the MSH-4 segment. For example, send_facility = "ABC".
  • PatientId(value, type), which matches if the message lists a patient having an ID of the given value and type in the PID-2, PID-3, or PID-4 segments. For example, PatientId("123456", "MRN").
  • labels.x, a string value of the label with key x as set using the Message.labels map. For example, labels."priority"="high". The operator :* can be used to assert the existence of a label. For example, labels."priority":*.
order_by

string

Orders messages returned by the specified order_by clause. Syntax: https://cloud.google.com/apis/design/design_patterns#sorting_order

Fields available for ordering are:

  • send_time
view

MessageView

Specifies the parts of the Message to return in the response. When unspecified, equivalent to BASIC. Setting this to anything other than BASIC with a page_size larger than the default can generate a large response, which impacts the performance of this method.

ListMessagesResponse

Lists the messages in the specified HL7v2 store.

Fields
hl7_v2_messages[]

Message

The returned Messages. Won't be more Messages than the value of page_size in the request. See view for populated fields.

next_page_token

string

Token to retrieve the next page of results or empty if there are no more results in the list.

Message

A complete HL7v2 message. See http://www.hl7.org/implement/standards/index.cfm?ref=common for details on the standard.

Fields
name

string

Resource name of the Message, of the form projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}. Assigned by the server.

data

bytes

Raw message bytes.

create_time

Timestamp

Output only. The datetime when the message was created. Set by the server.

send_facility

string

The hospital that this message came from. MSH-4.

send_time

Timestamp

The datetime the sending application sent this message. MSH-7.

message_type

string

The message type for this message. MSH-9.1.

patient_ids[]

PatientId

All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.

labels

map<string, string>

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}][\p{Ll}\p{Lo}\p{N}_-]{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.

parsed_data

ParsedData

Output only. The parsed version of the raw message data.

schematized_data

SchematizedData

The parsed version of the raw message data schematized according to this store's schemas and type definitions.

MessageView

Enums
MESSAGE_VIEW_UNSPECIFIED Not specified, equivalent to FULL for getMessage, equivalent to BASIC for listMessages.
RAW_ONLY Server responses include all the message fields except parsed_data field.
PARSED_ONLY Server responses include all the message fields except data field.
FULL Server responses include all the message fields.
BASIC Server responses include only the name field.

ParsedData

The content of an HL7v2 message in a structured format.

Fields
segments[]

Segment

ParserConfig

The configuration for the parser. It determines how the server parses the messages.

Fields
allow_null_header

bool

Determines whether messages with no header are allowed.

segment_terminator

bytes

Byte(s) to use as the segment terminator. If this is unset, '\r' is used as segment terminator, matching the HL7 version 2 specification.

schema

SchemaPackage

Schemas used to parse messages in this store, if schematized parsing is desired.

SchemaGroup

An HL7v2 logical group construct.

Fields
name

string

The name of this group. For example, "ORDER_DETAIL".

choice

bool

True indicates that this is a choice group, meaning that only one of its segments can exist in a given message.

min_occurs

int32

The minimum number of times this group must be present/repeated.

max_occurs

int32

The maximum number of times this group can be repeated. 0 or -1 means unbounded.

members[]

GroupOrSegment

Nested groups and/or segments.

SchemaPackage

A schema package contains a set of schemas and type definitions.

Fields
schematized_parsing_type

SchematizedParsingType

Determines how messages that don't parse successfully are handled.

schemas[]

Hl7SchemaConfig

Schema configs that are layered based on their VersionSources that match the incoming message. Schema configs present in higher indices override those in lower indices with the same message type and trigger event if their VersionSources all match an incoming message.

types[]

Hl7TypesConfig

Schema type definitions that are layered based on their VersionSources that match the incoming message. Type definitions present in higher indices override those in lower indices with the same type name if their VersionSources all match an incoming message.

ignore_min_occurs

bool

Flag to ignore all min_occurs restrictions in the schema. This means that incoming messages can omit any group, segment, field, component, or subcomponent.

SchemaSegment

An HL7v2 Segment.

Fields
type

string

The Segment type. For example, "PID".

min_occurs

int32

The minimum number of times this segment can be present in this group.

max_occurs

int32

The maximum number of times this segment can be present in this group. 0 or -1 means unbounded.

SchematizedData

The content of an HL7v2 message in a structured format as specified by a schema.

Fields

Union field result.

result can be only one of the following:

data

string

JSON output of the parser.

error

string

The error output of the parser.

SchematizedParsingType

Determines the failure mode for schematized parsing.

Enums
SCHEMATIZED_PARSING_TYPE_UNSPECIFIED Unspecified schematized parsing type, equivalent to SOFT_FAIL.
SOFT_FAIL Messages that fail to parse are still stored and ACKed but a parser error is stored in place of the schematized data.
HARD_FAIL Messages that fail to parse are rejected from ingestion/insertion and return an error code.

Segment

A segment in a structured format.

Fields
segment_id

string

A string that indicates the type of segment. For example, EVN or PID.

set_id

string

Set ID for segments that can be in a set. This can be empty if it's missing or isn't applicable.

fields

map<string, string>

A mapping from the positional location to the value. The key string uses zero-based indexes separated by dots to identify Fields, components and sub-components. A bracket notation is also used to identify different instances of a repeated field. Regex for key: (\d+)([\d+])?(.\d+)?(.\d+)?

Examples of (key, value) pairs:

  • (0.1, "hemoglobin") denotes that the first component of Field 0 has the value "hemoglobin".

  • (1.1.2, "CBC") denotes that the second sub-component of the first component of Field 1 has the value "CBC".

  • (1[0].1, "HbA1c") denotes that the first component of the first Instance of Field 1, which is repeated, has the value "HbA1c".

Type

A type definition for some HL7v2 type (incl. Segments and Datatypes).

Fields
name

string

The name of this type. This would be the segment or datatype name. For example, "PID" or "XPN".

primitive

Primitive

If this is a primitive type then this field is the type of the primitive For example, STRING. Leave unspecified for composite types.

fields[]

Field

The (sub) fields this type has (if not primitive).

Field

A (sub) field of a type.

Fields
name

string

The name of the field. For example, "PID-1" or just "1".

type

string

The type of this field. A Type with this name must be defined in an Hl7TypesConfig.

table

string

The HL7v2 table this field refers to. For example, PID-15 (Patient's Primary Language) usually refers to table "0296".

min_occurs

int32

The minimum number of times this field must be present/repeated.

max_occurs

int32

The maximum number of times this field can be repeated. 0 or -1 means unbounded.

Primitive

Enums
PRIMITIVE_UNSPECIFIED Not a primitive.
STRING String primitive.
VARIES Element that can have unschematized children.
UNESCAPED_STRING Like STRING, but all delimiters below this element are ignored.

UpdateHl7V2StoreRequest

Request to update the given HL7v2 store. For example, to change the Cloud Pub/Sub topic.

Fields
hl7_v2_store

Hl7V2Store

The HL7v2 store to update. Only fields listed in update_mask are applied.

update_mask

FieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

UpdateMessageRequest

Request to update labels on the given message.

Fields
message

Message

The message resource which updates the resource on the server. Only fields listed in update_mask are applied.

Authorization requires the following IAM permission on the specified resource message:

  • healthcare.hl7V2Messages.update
update_mask

FieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

VersionSource

Describes a selector for extracting and matching an MSH field to a value.

Fields
msh_field

string

The field to extract from the MSH segment. For example, "3.1" or "18[1].1".

value

string

The value to match with the field. For example, "My Application Name" or "2.3".