Skip to content

Commit beec2f4

Browse files
committed
Adding test cases for few missing fields
1 parent 7b6abe9 commit beec2f4

5 files changed

+97
-95
lines changed

mmv1/products/healthcare/PipelineJob.yaml

+10-87
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ examples:
4444
vars:
4545
backfill_pipeline_name: 'example_backfill_pipeline'
4646
dataset_name: 'example_dataset'
47-
fhir_store_name: 'fhir_store'
4847
mapping_pipeline_name: 'example_mapping_pipeline'
4948
- !ruby/object:Provider::Terraform::Examples
5049
name: 'healthcare_pipeline_job_whistle_mapping'
@@ -55,6 +54,16 @@ examples:
5554
source_fhirstore_name: 'source_fhir_store'
5655
dest_fhirstore_name: 'dest_fhir_store'
5756
bucket_name: 'example_bucket_name'
57+
- !ruby/object:Provider::Terraform::Examples
58+
name: 'healthcare_pipeline_job_mapping_recon_dest'
59+
primary_resource_id: 'example-mapping-pipeline'
60+
vars:
61+
pipeline_name: 'example_mapping_pipeline_job'
62+
recon_pipeline_name: 'example_recon_pipeline_job'
63+
dataset_name: 'example_dataset'
64+
source_fhirstore_name: 'source_fhir_store'
65+
dest_fhirstore_name: 'dest_fhir_store'
66+
bucket_name: 'example_bucket_name'
5867
custom_code: !ruby/object:Provider::Terraform::CustomCode
5968
decoder: templates/terraform/decoders/long_name_to_self_link.go.erb
6069
parameters:
@@ -124,51 +133,8 @@ properties:
124133
description: |
125134
Describes the mapping configuration.
126135
required: false
127-
- !ruby/object:Api::Type::NestedObject
128-
name: dataMapperConfigSource
129-
conflicts:
130-
- whistleConfigSource
131-
description: |
132-
Specifies the path to the mapping configuration for Data Mapper pipeline.
133-
required: false
134-
properties:
135-
- !ruby/object:Api::Type::String
136-
name: mapping
137-
description: |
138-
Specifies the name of the mapping in the Data Mapper workspace.
139-
required: true
140-
- !ruby/object:Api::Type::String
141-
name: mappingVersionId
142-
description: |
143-
Specifies the version ID used to select the Mapping with the name, mapping.
144-
required: false
145-
- !ruby/object:Api::Type::String
146-
name: parameterKey
147-
description: |
148-
If set, specifies the name of the parameter key used to select SQL
149-
variable parameter values for this mapping. Otherwise the default
150-
value for each SQL variable is used.
151-
required: true
152-
- !ruby/object:Api::Type::NestedObject
153-
name: gcs
154-
description: |
155-
The Cloud Storage location of the Data Mapper configuration files.
156-
Configuration source must be either a Data Mapper workspace or
157-
a Cloud Storage location but cannot be both.
158-
required: true
159-
properties:
160-
- !ruby/object:Api::Type::String
161-
name: uriPrefix
162-
description: |
163-
The Cloud Storage location URI that must locate either a bucket
164-
root or a directory within a bucket, and the contents at this
165-
location must contain the structured Data Mapper configurations.
166-
Example: gs://bucketName/path/to/configDir
167-
required: true
168136
- !ruby/object:Api::Type::NestedObject
169137
name: whistleConfigSource
170-
conflicts:
171-
- dataMapperConfigSource
172138
description: |
173139
Specifies the path to the mapping configuration for harmonization pipeline.
174140
required: false
@@ -246,51 +212,8 @@ properties:
246212
description: |
247213
Describes the mapping configuration.
248214
required: false
249-
- !ruby/object:Api::Type::NestedObject
250-
name: dataMapperConfigSource
251-
conflicts:
252-
- whistleConfigSource
253-
description: |
254-
Specifies the path to the mapping configuration for Data Mapper pipeline.
255-
required: false
256-
properties:
257-
- !ruby/object:Api::Type::String
258-
name: mapping
259-
description: |
260-
Specifies the name of the mapping in the Data Mapper workspace.
261-
required: true
262-
- !ruby/object:Api::Type::String
263-
name: mappingVersionId
264-
description: |
265-
Specifies the version ID used to select the Mapping with the name, mapping.
266-
required: false
267-
- !ruby/object:Api::Type::String
268-
name: parameterKey
269-
description: |
270-
If set, specifies the name of the parameter key used to select
271-
SQL variable parameter values for this mapping.
272-
Otherwise the default value for each SQL variable is used.
273-
required: false
274-
- !ruby/object:Api::Type::NestedObject
275-
name: gcs
276-
description: |
277-
The Cloud Storage location of the Data Mapper configuration files.
278-
Configuration source must be either a Data Mapper workspace or a
279-
Cloud Storage location but cannot be both.
280-
required: true
281-
properties:
282-
- !ruby/object:Api::Type::String
283-
name: uriPrefix
284-
description: |
285-
The Cloud Storage location URI that must locate either a bucket
286-
root or a directory within a bucket, and the contents at this
287-
location must contain the structured Data Mapper configurations.
288-
Example: gs://bucketName/path/to/configDir
289-
required: true
290215
- !ruby/object:Api::Type::NestedObject
291216
name: whistleConfigSource
292-
conflicts:
293-
- dataMapperConfigSource
294217
description: |
295218
Specifies the path to the mapping configuration for harmonization pipeline.
296219
required: true

mmv1/templates/terraform/examples/healthcare_pipeline_job_backfill.tf.erb

-8
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,4 @@ resource "google_healthcare_pipeline_job" "<%= ctx[:primary_resource_id] %>" {
1010
resource "google_healthcare_dataset" "dataset" {
1111
name = "<%= ctx[:vars]['dataset_name'] %>"
1212
location = "us-central1"
13-
}
14-
15-
resource "google_healthcare_fhir_store" "fhirstore" {
16-
name = "<%= ctx[:vars]['fhir_store_name'] %>"
17-
dataset = google_healthcare_dataset.dataset.id
18-
version = "R4"
19-
enable_update_create = true
20-
disable_referential_integrity = true
2113
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
resource "google_healthcare_pipeline_job" "recon" {
2+
name = "<%= ctx[:vars]['recon_pipeline_name'] %>"
3+
location = "us-central1"
4+
dataset = google_healthcare_dataset.dataset.id
5+
disable_lineage = true
6+
reconciliation_pipeline_job {
7+
merge_config {
8+
description = "sample description for reconciliation rules"
9+
whistle_config_source {
10+
uri = "gs://${google_storage_bucket.bucket.name}/${google_storage_bucket_object.merge_file.name}"
11+
import_uri_prefix = "gs://${google_storage_bucket.bucket.name}"
12+
}
13+
}
14+
matching_uri_prefix = "gs://${google_storage_bucket.bucket.name}"
15+
fhir_store_destination = "${google_healthcare_dataset.dataset.id}/fhirStores/${google_healthcare_fhir_store.dest_fhirstore.name}"
16+
}
17+
}
18+
19+
resource "google_healthcare_pipeline_job" "<%= ctx[:primary_resource_id] %>" {
20+
depends_on = [google_healthcare_pipeline_job.recon]
21+
name = "<%= ctx[:vars]['pipeline_name'] %>"
22+
location = "us-central1"
23+
dataset = google_healthcare_dataset.dataset.id
24+
disable_lineage = true
25+
labels = {
26+
example_label_key = "example_label_value"
27+
}
28+
mapping_pipeline_job {
29+
mapping_config {
30+
whistle_config_source {
31+
uri = "gs://${google_storage_bucket.bucket.name}/${google_storage_bucket_object.mapping_file.name}"
32+
import_uri_prefix = "gs://${google_storage_bucket.bucket.name}"
33+
}
34+
description = "example description for mapping configuration"
35+
}
36+
fhir_streaming_source {
37+
fhir_store = "${google_healthcare_dataset.dataset.id}/fhirStores/${google_healthcare_fhir_store.source_fhirstore.name}"
38+
description = "example description for streaming fhirstore"
39+
}
40+
reconciliation_destination = true
41+
}
42+
}
43+
44+
resource "google_healthcare_dataset" "dataset" {
45+
name = "<%= ctx[:vars]['dataset_name'] %>"
46+
location = "us-central1"
47+
}
48+
49+
resource "google_healthcare_fhir_store" "source_fhirstore" {
50+
name = "<%= ctx[:vars]['source_fhirstore_name'] %>"
51+
dataset = google_healthcare_dataset.dataset.id
52+
version = "R4"
53+
enable_update_create = true
54+
disable_referential_integrity = true
55+
}
56+
57+
resource "google_healthcare_fhir_store" "dest_fhirstore" {
58+
name = "<%= ctx[:vars]['dest_fhirstore_name'] %>"
59+
dataset = google_healthcare_dataset.dataset.id
60+
version = "R4"
61+
enable_update_create = true
62+
disable_referential_integrity = true
63+
}
64+
65+
resource "google_storage_bucket" "bucket" {
66+
name = "<%= ctx[:vars]['bucket_name'] %>"
67+
location = "us-central1"
68+
uniform_bucket_level_access = true
69+
}
70+
71+
resource "google_storage_bucket_object" "mapping_file" {
72+
name = "mapping.wstl"
73+
content = " "
74+
bucket = google_storage_bucket.bucket.name
75+
}
76+
77+
resource "google_storage_bucket_object" "merge_file" {
78+
name = "merge.wstl"
79+
content = " "
80+
bucket = google_storage_bucket.bucket.name
81+
}

mmv1/templates/terraform/examples/healthcare_pipeline_job_reconciliation.tf.erb

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ resource "google_healthcare_pipeline_job" "<%= ctx[:primary_resource_id] %>" {
55
disable_lineage = true
66
reconciliation_pipeline_job {
77
merge_config {
8+
description = "sample description for reconciliation rules"
89
whistle_config_source {
910
uri = "gs://${google_storage_bucket.bucket.name}/${google_storage_bucket_object.merge_file.name}"
1011
import_uri_prefix = "gs://${google_storage_bucket.bucket.name}"

mmv1/templates/terraform/examples/healthcare_pipeline_job_whistle_mapping.tf.erb

+5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ resource "google_healthcare_pipeline_job" "<%= ctx[:primary_resource_id] %>" {
33
location = "us-central1"
44
dataset = google_healthcare_dataset.dataset.id
55
disable_lineage = true
6+
labels = {
7+
example_label_key = "example_label_value"
8+
}
69
mapping_pipeline_job {
710
mapping_config {
811
whistle_config_source {
912
uri = "gs://${google_storage_bucket.bucket.name}/${google_storage_bucket_object.mapping_file.name}"
1013
import_uri_prefix = "gs://${google_storage_bucket.bucket.name}"
1114
}
15+
description = "example description for mapping configuration"
1216
}
1317
fhir_streaming_source {
1418
fhir_store = "${google_healthcare_dataset.dataset.id}/fhirStores/${google_healthcare_fhir_store.source_fhirstore.name}"
19+
description = "example description for streaming fhirstore"
1520
}
1621
fhir_store_destination = "${google_healthcare_dataset.dataset.id}/fhirStores/${google_healthcare_fhir_store.dest_fhirstore.name}"
1722
}

0 commit comments

Comments
 (0)