| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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 FhirStore is a datastore inside a Healthcare dataset that conforms to the FHIR (https://www. |
| --- |
| |
| # google\_healthcare\_fhir\_store |
| |
| A FhirStore is a datastore inside a Healthcare dataset that conforms to the FHIR (https://www.hl7.org/fhir/STU3/) |
| standard for Healthcare information exchange |
| |
| |
| To get more information about FhirStore, see: |
| |
| * [API documentation](https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.fhirStores) |
| * How-to Guides |
| * [Creating a FHIR store](https://cloud.google.com/healthcare/docs/how-tos/fhir) |
| |
| <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_fhir_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 Fhir Store Basic |
| |
| |
| ```hcl |
| resource "google_healthcare_fhir_store" "default" { |
| name = "example-fhir-store" |
| dataset = google_healthcare_dataset.dataset.id |
| version = "R4" |
| complex_data_type_reference_parsing = "DISABLED" |
| |
| enable_update_create = false |
| disable_referential_integrity = false |
| disable_resource_versioning = false |
| enable_history_import = false |
| default_search_handling_strict = false |
| |
| notification_config { |
| pubsub_topic = google_pubsub_topic.topic.id |
| } |
| |
| labels = { |
| label1 = "labelvalue1" |
| } |
| } |
| |
| resource "google_pubsub_topic" "topic" { |
| name = "fhir-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_fhir_store_streaming_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 Fhir Store Streaming Config |
| |
| |
| ```hcl |
| resource "google_healthcare_fhir_store" "default" { |
| name = "example-fhir-store" |
| dataset = google_healthcare_dataset.dataset.id |
| version = "R4" |
| |
| enable_update_create = false |
| disable_referential_integrity = false |
| disable_resource_versioning = false |
| enable_history_import = false |
| |
| labels = { |
| label1 = "labelvalue1" |
| } |
| |
| stream_configs { |
| resource_types = ["Observation"] |
| bigquery_destination { |
| dataset_uri = "bq://${google_bigquery_dataset.bq_dataset.project}.${google_bigquery_dataset.bq_dataset.dataset_id}" |
| schema_config { |
| recursive_structure_depth = 3 |
| last_updated_partition_config { |
| type = "HOUR" |
| expiration_ms = 1000000 |
| } |
| } |
| } |
| } |
| } |
| |
| resource "google_pubsub_topic" "topic" { |
| name = "fhir-notifications" |
| } |
| |
| resource "google_healthcare_dataset" "dataset" { |
| name = "example-dataset" |
| location = "us-central1" |
| } |
| |
| resource "google_bigquery_dataset" "bq_dataset" { |
| dataset_id = "bq_example_dataset" |
| friendly_name = "test" |
| description = "This is a test description" |
| location = "US" |
| delete_contents_on_destroy = true |
| } |
| ``` |
| <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_fhir_store_notification_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 Fhir Store Notification Config |
| |
| |
| ```hcl |
| resource "google_healthcare_fhir_store" "default" { |
| name = "example-fhir-store" |
| dataset = google_healthcare_dataset.dataset.id |
| version = "R4" |
| |
| enable_update_create = false |
| disable_referential_integrity = false |
| disable_resource_versioning = false |
| enable_history_import = false |
| |
| labels = { |
| label1 = "labelvalue1" |
| } |
| |
| notification_config { |
| pubsub_topic = "${google_pubsub_topic.topic.id}" |
| } |
| } |
| |
| resource "google_pubsub_topic" "topic" { |
| name = "fhir-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_fhir_store_notification_configs&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 Fhir Store Notification Configs |
| |
| |
| ```hcl |
| resource "google_healthcare_fhir_store" "default" { |
| provider = google-beta |
| name = "example-fhir-store" |
| dataset = google_healthcare_dataset.dataset.id |
| version = "R4" |
| |
| enable_update_create = false |
| disable_referential_integrity = false |
| disable_resource_versioning = false |
| enable_history_import = false |
| enable_history_modifications = false |
| |
| labels = { |
| label1 = "labelvalue1" |
| } |
| |
| notification_configs { |
| pubsub_topic = "${google_pubsub_topic.topic.id}" |
| send_full_resource = true |
| send_previous_resource_on_delete = true |
| } |
| } |
| |
| resource "google_pubsub_topic" "topic" { |
| provider = google-beta |
| name = "fhir-notifications" |
| } |
| |
| 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 FhirStore. |
| ** Changing this property may recreate the FHIR store (removing all data) ** |
| |
| * `dataset` - |
| (Required) |
| Identifies the dataset addressed by this request. Must be in the format |
| 'projects/{project}/locations/{location}/datasets/{dataset}' |
| |
| |
| - - - |
| |
| |
| * `version` - |
| (Optional) |
| The FHIR specification version. |
| Default value is `STU3`. |
| Possible values are: `DSTU2`, `STU3`, `R4`. |
| |
| * `complex_data_type_reference_parsing` - |
| (Optional) |
| Enable parsing of references within complex FHIR data types such as Extensions. If this value is set to ENABLED, then features like referential integrity and Bundle reference rewriting apply to all references. If this flag has not been specified the behavior of the FHIR store will not change, references in complex data types will not be parsed. New stores will have this value set to ENABLED by default after a notification period. Warning: turning on this flag causes processing existing resources to fail if they contain references to non-existent resources. |
| Possible values are: `COMPLEX_DATA_TYPE_REFERENCE_PARSING_UNSPECIFIED`, `DISABLED`, `ENABLED`. |
| |
| * `enable_update_create` - |
| (Optional) |
| Whether this FHIR store has the updateCreate capability. This determines if the client can use an Update |
| operation to create a new resource with a client-specified ID. If false, all IDs are server-assigned through |
| the Create operation and attempts to Update a non-existent resource will return errors. Please treat the audit |
| logs with appropriate levels of care if client-specified resource IDs contain sensitive data such as patient |
| identifiers, those IDs will be part of the FHIR resource path recorded in Cloud audit logs and Cloud Pub/Sub |
| notifications. |
| |
| * `disable_referential_integrity` - |
| (Optional) |
| Whether to disable referential integrity in this FHIR store. This field is immutable after FHIR store |
| creation. The default value is false, meaning that the API will enforce referential integrity and fail the |
| requests that will result in inconsistent state in the FHIR store. When this field is set to true, the API |
| will skip referential integrity check. Consequently, operations that rely on references, such as |
| Patient.get$everything, will not return all the results if broken references exist. |
| ** Changing this property may recreate the FHIR store (removing all data) ** |
| |
| * `disable_resource_versioning` - |
| (Optional) |
| Whether to disable resource versioning for this FHIR store. This field can not be changed after the creation |
| of FHIR store. If set to false, which is the default behavior, all write operations will cause historical |
| versions to be recorded automatically. The historical versions can be fetched through the history APIs, but |
| cannot be updated. If set to true, no historical versions will be kept. The server will send back errors for |
| attempts to read the historical versions. |
| ** Changing this property may recreate the FHIR store (removing all data) ** |
| |
| * `enable_history_import` - |
| (Optional) |
| Whether to allow the bulk import API to accept history bundles and directly insert historical resource |
| versions into the FHIR store. Importing resource histories creates resource interactions that appear to have |
| occurred in the past, which clients may not want to allow. If set to false, history bundles within an import |
| will fail with an error. |
| ** Changing this property may recreate the FHIR store (removing all data) ** |
| ** This property can be changed manually in the Google Cloud Healthcare admin console without recreating the FHIR store ** |
| |
| * `enable_history_modifications` - |
| (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) |
| Whether to allow the ExecuteBundle API to accept history bundles, and directly insert and overwrite historical |
| resource versions into the FHIR store. If set to false, using history bundles fails with an error. |
| |
| * `labels` - |
| (Optional) |
| User-supplied key-value pairs used to organize FHIR 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_config` - |
| (Optional) |
| A nested object resource |
| Structure is [documented below](#nested_notification_config). |
| |
| * `stream_configs` - |
| (Optional) |
| A list of streaming configs that configure the destinations of streaming export for every resource mutation in |
| this FHIR store. Each store is allowed to have up to 10 streaming configs. After a new config is added, the next |
| resource mutation is streamed to the new location in addition to the existing ones. When a location is removed |
| from the list, the server stops streaming to that location. Before adding a new config, you must add the required |
| bigquery.dataEditor role to your project's Cloud Healthcare Service Agent service account. Some lag (typically on |
| the order of dozens of seconds) is expected before the results show up in the streaming destination. |
| Structure is [documented below](#nested_stream_configs). |
| |
| * `default_search_handling_strict` - |
| (Optional) |
| If true, overrides the default search behavior for this FHIR store to handling=strict which returns an error for unrecognized search parameters. |
| If false, uses the FHIR specification default handling=lenient which ignores unrecognized search parameters. |
| The handling can always be changed from the default on an individual API call by setting the HTTP header Prefer: handling=strict or Prefer: handling=lenient. |
| |
| * `notification_configs` - |
| (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) |
| A list of notifcation configs that configure the notification for every resource mutation in this FHIR store. |
| Structure is [documented below](#nested_notification_configs). |
| |
| |
| <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. |
| |
| <a name="nested_stream_configs"></a>The `stream_configs` block supports: |
| |
| * `resource_types` - |
| (Optional) |
| Supply a FHIR resource type (such as "Patient" or "Observation"). See |
| https://www.hl7.org/fhir/valueset-resource-types.html for a list of all FHIR resource types. The server treats |
| an empty list as an intent to stream all the supported resource types in this FHIR store. |
| |
| * `bigquery_destination` - |
| (Required) |
| The destination BigQuery structure that contains both the dataset location and corresponding schema config. |
| The output is organized in one table per resource type. The server reuses the existing tables (if any) that |
| are named after the resource types, e.g. "Patient", "Observation". When there is no existing table for a given |
| resource type, the server attempts to create one. |
| See the [streaming config reference](https://cloud.google.com/healthcare/docs/reference/rest/v1beta1/projects.locations.datasets.fhirStores#streamconfig) for more details. |
| Structure is [documented below](#nested_bigquery_destination). |
| |
| |
| <a name="nested_bigquery_destination"></a>The `bigquery_destination` block supports: |
| |
| * `dataset_uri` - |
| (Required) |
| BigQuery URI to a dataset, up to 2000 characters long, in the format bq://projectId.bqDatasetId |
| |
| * `schema_config` - |
| (Required) |
| The configuration for the exported BigQuery schema. |
| Structure is [documented below](#nested_schema_config). |
| |
| |
| <a name="nested_schema_config"></a>The `schema_config` block supports: |
| |
| * `schema_type` - |
| (Optional) |
| Specifies the output schema type. |
| * ANALYTICS: Analytics schema defined by the FHIR community. |
| See https://github.com/FHIR/sql-on-fhir/blob/master/sql-on-fhir.md. |
| * ANALYTICS_V2: Analytics V2, similar to schema defined by the FHIR community, with added support for extensions with one or more occurrences and contained resources in stringified JSON. |
| * LOSSLESS: A data-driven schema generated from the fields present in the FHIR data being exported, with no additional simplification. |
| Default value is `ANALYTICS`. |
| Possible values are: `ANALYTICS`, `ANALYTICS_V2`, `LOSSLESS`. |
| |
| * `recursive_structure_depth` - |
| (Required) |
| The depth for all recursive structures in the output analytics schema. For example, concept in the CodeSystem |
| resource is a recursive structure; when the depth is 2, the CodeSystem table will have a column called |
| concept.concept but not concept.concept.concept. If not specified or set to 0, the server will use the default |
| value 2. The maximum depth allowed is 5. |
| |
| * `last_updated_partition_config` - |
| (Optional) |
| The configuration for exported BigQuery tables to be partitioned by FHIR resource's last updated time column. |
| Structure is [documented below](#nested_last_updated_partition_config). |
| |
| |
| <a name="nested_last_updated_partition_config"></a>The `last_updated_partition_config` block supports: |
| |
| * `type` - |
| (Required) |
| Type of partitioning. |
| Possible values are: `PARTITION_TYPE_UNSPECIFIED`, `HOUR`, `DAY`, `MONTH`, `YEAR`. |
| |
| * `expiration_ms` - |
| (Optional) |
| Number of milliseconds for which to keep the storage for a partition. |
| |
| <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. |
| |
| * `send_full_resource` - |
| (Optional) |
| Whether to send full FHIR resource to this Pub/Sub topic for Create and Update operation. |
| Note that setting this to true does not guarantee that all resources will be sent in the format of |
| full FHIR resource. When a resource change is too large or during heavy traffic, only the resource name will be |
| sent. Clients should always check the "payloadType" label from a Pub/Sub message to determine whether |
| it needs to fetch the full resource as a separate operation. |
| |
| * `send_previous_resource_on_delete` - |
| (Optional) |
| Whether to send full FHIR resource to this Pub/Sub topic for deleting FHIR resource. Note that setting this to |
| true does not guarantee that all previous resources will be sent in the format of full FHIR resource. When a |
| resource change is too large or during heavy traffic, only the resource name will be sent. Clients should always |
| check the "payloadType" label from a Pub/Sub message to determine whether it needs to fetch the full previous |
| resource as a separate operation. |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{dataset}}/fhirStores/{{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 |
| |
| |
| FhirStore can be imported using any of these accepted formats: |
| |
| * `{{dataset}}/fhirStores/{{name}}` |
| * `{{dataset}}/{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import FhirStore using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{dataset}}/fhirStores/{{name}}" |
| to = google_healthcare_fhir_store.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), FhirStore can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_healthcare_fhir_store.default {{dataset}}/fhirStores/{{name}} |
| $ terraform import google_healthcare_fhir_store.default {{dataset}}/{{name}} |
| ``` |