| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Cloud Healthcare" |
| description: |- |
| A Hl7V2Store is a datastore inside a Healthcare dataset that conforms to the FHIR (https://www. |
| --- |
| |
| # google\_healthcare\_hl7\_v2\_store |
| |
| A Hl7V2Store is a datastore inside a Healthcare dataset that conforms to the FHIR (https://www.hl7.org/hl7V2/STU3/) |
| standard for Healthcare information exchange |
| |
| |
| To get more information about Hl7V2Store, see: |
| |
| * [API documentation](https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores) |
| * How-to Guides |
| * [Creating a HL7v2 Store](https://cloud.google.com/healthcare/docs/how-tos/hl7v2) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=healthcare_hl7_v2_store_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Healthcare Hl7 V2 Store Basic |
| |
| |
| ```hcl |
| resource "google_healthcare_hl7_v2_store" "store" { |
| name = "example-hl7-v2-store" |
| dataset = google_healthcare_dataset.dataset.id |
| reject_duplicate_message = true |
| |
| notification_configs { |
| pubsub_topic = google_pubsub_topic.topic.id |
| } |
| |
| labels = { |
| label1 = "labelvalue1" |
| } |
| } |
| |
| resource "google_pubsub_topic" "topic" { |
| name = "hl7-v2-notifications" |
| } |
| |
| resource "google_healthcare_dataset" "dataset" { |
| name = "example-dataset" |
| location = "us-central1" |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=healthcare_hl7_v2_store_parser_config&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Healthcare Hl7 V2 Store Parser Config |
| |
| |
| ```hcl |
| resource "google_healthcare_hl7_v2_store" "store" { |
| provider = google-beta |
| name = "example-hl7-v2-store" |
| dataset = google_healthcare_dataset.dataset.id |
| |
| parser_config { |
| allow_null_header = false |
| segment_terminator = "Jw==" |
| schema = <<EOF |
| { |
| "schemas": [{ |
| "messageSchemaConfigs": { |
| "ADT_A01": { |
| "name": "ADT_A01", |
| "minOccurs": 1, |
| "maxOccurs": 1, |
| "members": [{ |
| "segment": { |
| "type": "MSH", |
| "minOccurs": 1, |
| "maxOccurs": 1 |
| } |
| }, |
| { |
| "segment": { |
| "type": "EVN", |
| "minOccurs": 1, |
| "maxOccurs": 1 |
| } |
| }, |
| { |
| "segment": { |
| "type": "PID", |
| "minOccurs": 1, |
| "maxOccurs": 1 |
| } |
| }, |
| { |
| "segment": { |
| "type": "ZPD", |
| "minOccurs": 1, |
| "maxOccurs": 1 |
| } |
| }, |
| { |
| "segment": { |
| "type": "OBX" |
| } |
| }, |
| { |
| "group": { |
| "name": "PROCEDURE", |
| "members": [{ |
| "segment": { |
| "type": "PR1", |
| "minOccurs": 1, |
| "maxOccurs": 1 |
| } |
| }, |
| { |
| "segment": { |
| "type": "ROL" |
| } |
| } |
| ] |
| } |
| }, |
| { |
| "segment": { |
| "type": "PDA", |
| "maxOccurs": 1 |
| } |
| } |
| ] |
| } |
| } |
| }], |
| "types": [{ |
| "type": [{ |
| "name": "ZPD", |
| "primitive": "VARIES" |
| } |
| |
| ] |
| }], |
| "ignoreMinOccurs": true |
| } |
| EOF |
| } |
| } |
| |
| resource "google_healthcare_dataset" "dataset" { |
| provider = google-beta |
| name = "example-dataset" |
| location = "us-central1" |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=healthcare_hl7_v2_store_unschematized&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Healthcare Hl7 V2 Store Unschematized |
| |
| |
| ```hcl |
| resource "google_healthcare_hl7_v2_store" "store" { |
| provider = google-beta |
| name = "example-hl7-v2-store" |
| dataset = google_healthcare_dataset.dataset.id |
| |
| parser_config { |
| allow_null_header = false |
| segment_terminator = "Jw==" |
| version = "V2" |
| } |
| } |
| |
| resource "google_healthcare_dataset" "dataset" { |
| provider = google-beta |
| name = "example-dataset" |
| location = "us-central1" |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `name` - |
| (Required) |
| The resource name for the Hl7V2Store. |
| ** Changing this property may recreate the Hl7v2 store (removing all data) ** |
| |
| * `dataset` - |
| (Required) |
| Identifies the dataset addressed by this request. Must be in the format |
| 'projects/{project}/locations/{location}/datasets/{dataset}' |
| |
| |
| - - - |
| |
| |
| * `reject_duplicate_message` - |
| (Optional) |
| Determines whether duplicate messages are allowed. |
| |
| * `parser_config` - |
| (Optional) |
| A nested object resource |
| Structure is [documented below](#nested_parser_config). |
| |
| * `labels` - |
| (Optional) |
| 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. |
| An object containing a list of "key": value pairs. |
| Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. |
| |
| **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. |
| Please refer to the field `effective_labels` for all of the labels present on the resource. |
| |
| * `notification_configs` - |
| (Optional) |
| 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. |
| Structure is [documented below](#nested_notification_configs). |
| |
| * `notification_config` - |
| (Optional, Deprecated) |
| A nested object resource |
| Structure is [documented below](#nested_notification_config). |
| |
| ~> **Warning:** `notification_config` is deprecated and will be removed in a future major release. Use `notification_configs` instead. |
| |
| |
| <a name="nested_parser_config"></a>The `parser_config` block supports: |
| |
| * `allow_null_header` - |
| (Optional) |
| Determines whether messages with no header are allowed. |
| |
| * `segment_terminator` - |
| (Optional) |
| Byte(s) to be used as the segment terminator. If this is unset, '\r' will be used as segment terminator. |
| A base64-encoded string. |
| |
| * `schema` - |
| (Optional) |
| JSON encoded string for schemas used to parse messages in this |
| store if schematized parsing is desired. |
| |
| * `version` - |
| (Optional) |
| The version of the unschematized parser to be used when a custom `schema` is not set. |
| Default value is `V1`. |
| Possible values are: `V1`, `V2`, `V3`. |
| |
| <a name="nested_notification_configs"></a>The `notification_configs` block supports: |
| |
| * `pubsub_topic` - |
| (Required) |
| The Cloud Pub/Sub topic that notifications of changes are published on. Supplied by the client. |
| PubsubMessage.Data will contain the resource name. PubsubMessage.MessageId is the ID of this message. |
| It is guaranteed to be unique within the topic. PubsubMessage.PublishTime is the time at which the message |
| was published. Notifications are only sent if the topic is non-empty. Topic names must be scoped to a |
| project. service-PROJECT_NUMBER@gcp-sa-healthcare.iam.gserviceaccount.com must have publisher permissions on the given |
| Cloud Pub/Sub topic. Not having adequate permissions will cause the calls that send notifications to fail. |
| If a notification cannot be published to Cloud Pub/Sub, errors will be logged to Stackdriver |
| |
| * `filter` - |
| (Optional) |
| 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: |
| * 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". |
| * sendFacility, the care center that the message came from, from the MSH-4 segment. For example, sendFacility = "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":*. |
| |
| <a name="nested_notification_config"></a>The `notification_config` block supports: |
| |
| * `pubsub_topic` - |
| (Required) |
| The Cloud Pub/Sub topic that notifications of changes are published on. Supplied by the client. |
| PubsubMessage.Data will contain the resource name. PubsubMessage.MessageId is the ID of this message. |
| It is guaranteed to be unique within the topic. PubsubMessage.PublishTime is the time at which the message |
| was published. Notifications are only sent if the topic is non-empty. Topic names must be scoped to a |
| project. service-PROJECT_NUMBER@gcp-sa-healthcare.iam.gserviceaccount.com must have publisher permissions on the given |
| Cloud Pub/Sub topic. Not having adequate permissions will cause the calls that send notifications to fail. |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{dataset}}/hl7V2Stores/{{name}}` |
| |
| * `self_link` - |
| The fully qualified name of this dataset |
| |
| * `terraform_labels` - |
| The combination of labels configured directly on the resource |
| and default labels configured on the provider. |
| |
| * `effective_labels` - |
| All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| Hl7V2Store can be imported using any of these accepted formats: |
| |
| * `{{dataset}}/hl7V2Stores/{{name}}` |
| * `{{dataset}}/{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Hl7V2Store using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{dataset}}/hl7V2Stores/{{name}}" |
| to = google_healthcare_hl7_v2_store.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Hl7V2Store can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_healthcare_hl7_v2_store.default {{dataset}}/hl7V2Stores/{{name}} |
| $ terraform import google_healthcare_hl7_v2_store.default {{dataset}}/{{name}} |
| ``` |