Skip to content

Commit 82bca93

Browse files
author
Takashi Matsuo
authored
[healthcare] testing: use multiple projects (#4064)
1 parent c41351e commit 82bca93

24 files changed

+621
-305
lines changed

healthcare/api-client/datasets/README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`
1717

1818
.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs
1919

20+
To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
21+
22+
To run the sample, you need to have `Healthcare Dataset Administrator` role.
23+
24+
25+
26+
2027
Setup
2128
-------------------------------------------------------------------------------
2229

healthcare/api-client/datasets/README.rst.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ product:
1414

1515
.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration
1616

17+
required_api_url: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
18+
required_role: Healthcare Dataset Administrator
19+
1720
setup:
1821
- auth
1922
- install_deps
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Default TEST_CONFIG_OVERRIDE for python repos.
16+
17+
# You can copy this file into your directory, then it will be inported from
18+
# the noxfile.py.
19+
20+
# The source of truth:
21+
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py
22+
23+
TEST_CONFIG_OVERRIDE = {
24+
# You can opt out from the test for specific Python versions.
25+
'ignored_versions': ["2.7"],
26+
27+
# An envvar key for determining the project id to use. Change it
28+
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
29+
# build specific Cloud project. You can also use your own string
30+
# to use your own Cloud project.
31+
# 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
32+
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
33+
34+
# A dictionary you want to inject into your test. Don't put any
35+
# secrets here. These values will override predefined values.
36+
'envs': {},
37+
}

healthcare/api-client/dicom/README.rst

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`
1717

1818
.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs
1919

20+
To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
21+
22+
23+
To run the sample, you need to have the following roles:
24+
* `Healthcare Dataset Administrator`
25+
* `Healthcare DICOM Store Administrator`
26+
* `Healthcare DICOM Editor`
27+
* `Healthcare DICOM Viewer`
28+
29+
You also need to give write access for the storage bucket to the Healthcare Service agent service account.
30+
31+
2032
Setup
2133
-------------------------------------------------------------------------------
2234

@@ -167,12 +179,13 @@ To run this sample:
167179
[--base_url BASE_URL] [--project_id PROJECT_ID]
168180
[--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID]
169181
[--dicom_store_id DICOM_STORE_ID] [--dcm_file DCM_FILE]
170-
[--study_uid STUDY_UID]
171-
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
182+
[--study_uid STUDY_UID] [--series_uid SERIES_UID]
183+
[--instance_uid INSTANCE_UID]
184+
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-search-studies,dicomweb-retrieve-instance,dicomweb-retrieve-rendered,dicomweb-delete-study}
172185
...
173186
174187
positional arguments:
175-
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
188+
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-search-studies,dicomweb-retrieve-instance,dicomweb-retrieve-rendered,dicomweb-delete-study}
176189
dicomweb-store-instance
177190
Handles the POST requests specified in the DICOMweb
178191
standard.
@@ -182,6 +195,15 @@ To run this sample:
182195
dicomweb-retrieve-study
183196
Handles the GET requests specified in the DICOMweb
184197
standard.
198+
dicomweb-search-studies
199+
Handles the GET requests specified in the DICOMweb
200+
standard.
201+
dicomweb-retrieve-instance
202+
Handles the GET requests specified in the DICOMweb
203+
standard.
204+
dicomweb-retrieve-rendered
205+
Handles the GET requests specified in the DICOMweb
206+
standard.
185207
dicomweb-delete-study
186208
Handles DELETE requests equivalent to the GET requests
187209
specified in the WADO-RS standard.
@@ -202,6 +224,10 @@ To run this sample:
202224
--dcm_file DCM_FILE File name for DCM file to store.
203225
--study_uid STUDY_UID
204226
Unique identifier for a study.
227+
--series_uid SERIES_UID
228+
Unique identifier for a series.
229+
--instance_uid INSTANCE_UID
230+
Unique identifier for an instance.
205231
206232
207233

healthcare/api-client/dicom/README.rst.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ product:
1414

1515
.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration
1616

17+
required_api_url: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
18+
required_roles:
19+
- Healthcare Dataset Administrator
20+
- Healthcare DICOM Store Administrator
21+
- Healthcare DICOM Editor
22+
- Healthcare DICOM Viewer
23+
24+
other_required_steps: >
25+
You also need to give write access for the storage bucket to the Healthcare
26+
Service agent service account.
27+
1728
setup:
1829
- auth
1930
- install_deps
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Default TEST_CONFIG_OVERRIDE for python repos.
16+
17+
# You can copy this file into your directory, then it will be inported from
18+
# the noxfile.py.
19+
20+
# The source of truth:
21+
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py
22+
23+
TEST_CONFIG_OVERRIDE = {
24+
# You can opt out from the test for specific Python versions.
25+
'ignored_versions': ["2.7"],
26+
27+
# An envvar key for determining the project id to use. Change it
28+
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
29+
# build specific Cloud project. You can also use your own string
30+
# to use your own Cloud project.
31+
# 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
32+
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
33+
34+
# A dictionary you want to inject into your test. Don't put any
35+
# secrets here. These values will override predefined values.
36+
'envs': {},
37+
}

healthcare/api-client/fhir/README.rst

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`
1717

1818
.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs
1919

20+
To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
21+
22+
23+
To run the sample, you need to have the following roles:
24+
* `Healthcare Dataset Administrator`
25+
* `Healthcare FHIR Store Administrator`
26+
* `Healthcare FHIR Resource Editor`
27+
28+
29+
2030
Setup
2131
-------------------------------------------------------------------------------
2232

@@ -85,17 +95,18 @@ To run this sample:
8595
[--fhir_store_id FHIR_STORE_ID]
8696
[--pubsub_topic PUBSUB_TOPIC] [--gcs_uri GCS_URI]
8797
[--member MEMBER] [--role ROLE]
88-
{create-fhir-store,delete-fhir-store,get-fhir-store,list-fhir-stores,patch-fhir-store,import-fhir-store,export-fhir-store-gcs,get_iam_policy,set_iam_policy}
98+
{create-fhir-store,delete-fhir-store,get-fhir-store,list-fhir-stores,patch-fhir-store,import-fhir-resources,export-fhir-store-gcs,get_iam_policy,set_iam_policy}
8999
...
90100
91101
positional arguments:
92-
{create-fhir-store,delete-fhir-store,get-fhir-store,list-fhir-stores,patch-fhir-store,import-fhir-store,export-fhir-store-gcs,get_iam_policy,set_iam_policy}
102+
{create-fhir-store,delete-fhir-store,get-fhir-store,list-fhir-stores,patch-fhir-store,import-fhir-resources,export-fhir-store-gcs,get_iam_policy,set_iam_policy}
93103
create-fhir-store Creates a new FHIR store within the parent dataset.
94104
delete-fhir-store Deletes the specified FHIR store.
95105
get-fhir-store Gets the specified FHIR store.
96106
list-fhir-stores Lists the FHIR stores in the given dataset.
97107
patch-fhir-store Updates the FHIR store.
98-
import-fhir-store Import resources into the FHIR store by copying them
108+
import-fhir-resources
109+
Import resources into the FHIR store by copying them
99110
from the specified source.
100111
export-fhir-store-gcs
101112
Export resources to a Google Cloud Storage bucket by
@@ -160,36 +171,46 @@ To run this sample:
160171
[--dataset_id DATASET_ID]
161172
[--fhir_store_id FHIR_STORE_ID]
162173
[--resource_type RESOURCE_TYPE]
163-
[--resource_id RESOURCE_ID] [--bundle BUNDLE]
174+
[--resource_id RESOURCE_ID] [--patient_id PATIENT_ID]
175+
[--encounter_id ENCOUNTER_ID] [--bundle BUNDLE]
164176
[--uri_prefix URI_PREFIX] [--version_id VERSION_ID]
165-
{create-resource,delete-resource,conditional-delete-resource,get-resource,list-resource-history,export-resources,execute_bundle,get-resource-history,delete-resource-purge,update-resource,conditional-update-resource,patch-resource,conditional-patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata}
177+
{create-patient,create-encounter,create-observation,delete-resource,conditional-delete-resource,get-resource,list-resource-history,execute-bundle,get-resource-history,delete-resource-purge,update-resource,conditional-update-resource,patch-resource,conditional-patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata}
166178
...
167179
168180
positional arguments:
169-
{create-resource,delete-resource,conditional-delete-resource,get-resource,list-resource-history,export-resources,execute_bundle,get-resource-history,delete-resource-purge,update-resource,conditional-update-resource,patch-resource,conditional-patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata}
170-
create-resource Creates a new resource in a FHIR store.
171-
delete-resource Creates a new resource in a FHIR store.
181+
{create-patient,create-encounter,create-observation,delete-resource,conditional-delete-resource,get-resource,list-resource-history,execute-bundle,get-resource-history,delete-resource-purge,update-resource,conditional-update-resource,patch-resource,conditional-patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata}
182+
create-patient Creates a new Patient resource in a FHIR store.
183+
create-encounter Creates a new Encounter resource in a FHIR store based
184+
on a Patient.
185+
create-observation Creates a new Observation resource in a FHIR store
186+
based on an Encounter.
187+
delete-resource Deletes a FHIR resource. Regardless of whether the
188+
operation succeeds or fails, the server returns a 200
189+
OK HTTP status code. To check that the resource was
190+
successfully deleted, search for or get the resource
191+
and see if it exists.
172192
conditional-delete-resource
173-
Deletes an existing resource specified by search
174-
criteria.
193+
Deletes FHIR resources that match a search query.
175194
get-resource Gets a FHIR resource.
176195
list-resource-history
177196
Gets the history of a resource.
178-
export-resources Exports resources in a FHIR store.
179-
export-resources Exports resources in a FHIR store.
180-
execute_bundle Executes the operations in the given bundle.
197+
execute-bundle Executes the operations in the given bundle.
181198
get-resource-history
182199
Gets a version resource.
183200
delete-resource-purge
184201
Deletes versions of a resource (excluding current
185202
version).
186203
update-resource Updates an existing resource.
187204
conditional-update-resource
188-
Updates an existing resource specified by search
189-
criteria.
205+
If a resource is found based on the search criteria
206+
specified in the query parameters, updates the entire
207+
contents of that resource.
190208
patch-resource Updates part of an existing resource..
191209
conditional-patch-resource
192-
Updates part of an existing resource..
210+
If a resource is found based on the search criteria
211+
specified in the query parameters, updates part of
212+
that resource by applying the operations specified in
213+
a JSON Patch document.
193214
search-resources-get
194215
Searches resources in the given FHIR store using the
195216
searchResources GET method.
@@ -216,7 +237,13 @@ To run this sample:
216237
--resource_type RESOURCE_TYPE
217238
The type of resource. First letter must be capitalized
218239
--resource_id RESOURCE_ID
219-
Name of a FHIR resource
240+
Identifier for a FHIR resource
241+
--patient_id PATIENT_ID
242+
Identifier for a Patient resource. Can be used as a
243+
reference for an Encounter/Observation
244+
--encounter_id ENCOUNTER_ID
245+
Identifier for an Encounter resource. Can be used as a
246+
reference for an Observation
220247
--bundle BUNDLE Name of file containing bundle of operations to
221248
execute
222249
--uri_prefix URI_PREFIX

0 commit comments

Comments
 (0)