Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support healthcare dicom bq stream configure #4717

Merged
merged 15 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions mmv1/products/healthcare/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,28 @@ objects:
description: |
The fully qualified name of this dataset
output: true
- !ruby/object:Api::Type::Array
name: streamConfigs
required: false
min_version: beta
update_url: '{{dataset}}/dicomStores/{{name}}'
description: |
To enable streaming to BigQuery, configure the streamConfigs object in your DICOM store.
streamConfigs is an array, so you can specify multiple BigQuery destinations. You can stream metadata from a single DICOM store to up to five BigQuery tables in a BigQuery dataset.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::NestedObject
name: bigqueryDestination
required: true
description: |
BigQueryDestination to include a fully qualified BigQuery table URI where DICOM instance metadata will be streamed.
properties:
- !ruby/object:Api::Type::String
name: tableUri
required: true
description: |
a fully qualified BigQuery table URI where DICOM instance metadata will be streamed.

references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Creating a DICOM store':
Expand Down
10 changes: 10 additions & 0 deletions mmv1/products/healthcare/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ overrides: !ruby/object:Overrides::ResourceOverrides
dataset_name: "example-dataset"
dicom_store_name: "example-dicom-store"
pubsub_topic: "dicom-notifications"
- !ruby/object:Provider::Terraform::Examples
name: "healthcare_dicom_store_bq_stream"
min_version: beta
primary_resource_id: "default"
vars:
dataset_name: "example-dataset"
dicom_store_name: "example-dicom-store"
pubsub_topic: "dicom-notifications"
bq_dataset_name: "dicom_bq_ds"
bq_table_name: "dicom_bq_tb"
properties:
creationTime: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
resource "google_healthcare_dicom_store" "default" {
provider = google-beta

name = "<%= ctx[:vars]['dicom_store_name'] %>"
dataset = google_healthcare_dataset.dataset.id

notification_config {
pubsub_topic = google_pubsub_topic.topic.id
}

labels = {
label1 = "labelvalue1"
}

stream_configs {
bigquery_destination {
table_uri = "bq://${google_bigquery_dataset.bq_dataset.project}.${google_bigquery_dataset.bq_dataset.dataset_id}.${google_bigquery_table.bq_table.table_id}"
}
}
}

resource "google_pubsub_topic" "topic" {
provider = google-beta

name = "<%= ctx[:vars]['pubsub_topic']%>"
}

resource "google_healthcare_dataset" "dataset" {
provider = google-beta

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

resource "google_bigquery_dataset" "bq_dataset" {
provider = google-beta

dataset_id = "<%= ctx[:vars]['bq_dataset_name'] %>"
friendly_name = "test"
description = "This is a test description"
location = "US"
delete_contents_on_destroy = true
}

resource "google_bigquery_table" "bq_table" {
provider = google-beta

deletion_protection = false
dataset_id = google_bigquery_dataset.bq_dataset.dataset_id
table_id = "<%= ctx[:vars]['bq_table_name'] %>"
}