Skip to content

Commit

Permalink
Support healthcare fhir new notifications config (#6471)
Browse files Browse the repository at this point in the history
  • Loading branch information
joycezhou47 authored Sep 26, 2022
1 parent 434bf2c commit 3443a0d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
25 changes: 25 additions & 0 deletions mmv1/products/healthcare/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,31 @@ objects:
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.
- !ruby/object:Api::Type::Array
name: notificationConfigs
description: |-
A list of notifcation configs that configure the notification for every resource mutation in this FHIR store.
min_version: beta
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: pubsubTopic
required: true
description: |
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. [email protected] must have publisher permissions on the given
Cloud Pub/Sub topic. Not having adequate permissions will cause the calls that send notifications to fail.
- !ruby/object:Api::Type::Boolean
name: sendFullResource
description: |
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.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Creating a FHIR store':
Expand Down
7 changes: 7 additions & 0 deletions mmv1/products/healthcare/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ overrides: !ruby/object:Overrides::ResourceOverrides
fhir_store_name: "example-fhir-store"
pubsub_topic: "fhir-notifications"
bq_dataset_name: "bq_example_dataset"
- !ruby/object:Provider::Terraform::Examples
name: "healthcare_fhir_store_notification_config"
primary_resource_id: "default"
vars:
dataset_name: "example-dataset"
fhir_store_name: "example-fhir-store"
pubsub_topic: "fhir-notifications"
properties:
creationTime: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "google_healthcare_fhir_store" "default" {
name = "<%= ctx[:vars]['fhir_store_name'] %>"
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_configs {
pubsub_topic = "${google_pubsub_topic.topic.id}"
send_full_resource = true
}
}

resource "google_pubsub_topic" "topic" {
name = "<%= ctx[:vars]['pubsub_topic']%>"
}

resource "google_healthcare_dataset" "dataset" {
name = "<%= ctx[:vars]['dataset_name'] %>"
location = "us-central1"
}


0 comments on commit 3443a0d

Please sign in to comment.