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

[healthcare] testing: use multiple projects #4064

Merged
merged 3 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 7 additions & 0 deletions healthcare/api-client/datasets/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`

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

To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/healthcare.googleapis.com

To run the sample, you need to have `Healthcare Dataset Administrator` role.




Setup
-------------------------------------------------------------------------------

Expand Down
3 changes: 3 additions & 0 deletions healthcare/api-client/datasets/README.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ product:

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

required_api_url: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
required_role: Healthcare Dataset Administrator

setup:
- auth
- install_deps
Expand Down
37 changes: 37 additions & 0 deletions healthcare/api-client/datasets/noxfile_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default TEST_CONFIG_OVERRIDE for python repos.

# You can copy this file into your directory, then it will be inported from
# the noxfile.py.

# The source of truth:
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
'ignored_versions': ["2.7"],

# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
# to use your own Cloud project.
# 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',

# A dictionary you want to inject into your test. Don't put any
# secrets here. These values will override predefined values.
'envs': {},
}
32 changes: 29 additions & 3 deletions healthcare/api-client/dicom/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`

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

To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/healthcare.googleapis.com


To run the sample, you need to have the following roles:
* `Healthcare Dataset Administrator`
* `Healthcare DICOM Store Administrator`
* `Healthcare DICOM Editor`
* `Healthcare DICOM Viewer`

You also need to give write access for the storage bucket to the Healthcare Service agent service account.


Setup
-------------------------------------------------------------------------------

Expand Down Expand Up @@ -167,12 +179,13 @@ To run this sample:
[--base_url BASE_URL] [--project_id PROJECT_ID]
[--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID]
[--dicom_store_id DICOM_STORE_ID] [--dcm_file DCM_FILE]
[--study_uid STUDY_UID]
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
[--study_uid STUDY_UID] [--series_uid SERIES_UID]
[--instance_uid INSTANCE_UID]
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-search-studies,dicomweb-retrieve-instance,dicomweb-retrieve-rendered,dicomweb-delete-study}
...

positional arguments:
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-search-studies,dicomweb-retrieve-instance,dicomweb-retrieve-rendered,dicomweb-delete-study}
dicomweb-store-instance
Handles the POST requests specified in the DICOMweb
standard.
Expand All @@ -182,6 +195,15 @@ To run this sample:
dicomweb-retrieve-study
Handles the GET requests specified in the DICOMweb
standard.
dicomweb-search-studies
Handles the GET requests specified in the DICOMweb
standard.
dicomweb-retrieve-instance
Handles the GET requests specified in the DICOMweb
standard.
dicomweb-retrieve-rendered
Handles the GET requests specified in the DICOMweb
standard.
dicomweb-delete-study
Handles DELETE requests equivalent to the GET requests
specified in the WADO-RS standard.
Expand All @@ -202,6 +224,10 @@ To run this sample:
--dcm_file DCM_FILE File name for DCM file to store.
--study_uid STUDY_UID
Unique identifier for a study.
--series_uid SERIES_UID
Unique identifier for a series.
--instance_uid INSTANCE_UID
Unique identifier for an instance.



Expand Down
11 changes: 11 additions & 0 deletions healthcare/api-client/dicom/README.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ product:

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

required_api_url: https://console.cloud.google.com/apis/library/healthcare.googleapis.com
required_roles:
- Healthcare Dataset Administrator
- Healthcare DICOM Store Administrator
- Healthcare DICOM Editor
- Healthcare DICOM Viewer

other_required_steps: >
You also need to give write access for the storage bucket to the Healthcare
Service agent service account.

setup:
- auth
- install_deps
Expand Down
37 changes: 37 additions & 0 deletions healthcare/api-client/dicom/noxfile_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default TEST_CONFIG_OVERRIDE for python repos.

# You can copy this file into your directory, then it will be inported from
# the noxfile.py.

# The source of truth:
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
'ignored_versions': ["2.7"],

# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
# to use your own Cloud project.
# 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',

# A dictionary you want to inject into your test. Don't put any
# secrets here. These values will override predefined values.
'envs': {},
}
61 changes: 44 additions & 17 deletions healthcare/api-client/fhir/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`

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

To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/healthcare.googleapis.com


To run the sample, you need to have the following roles:
* `Healthcare Dataset Administrator`
* `Healthcare FHIR Store Administrator`
* `Healthcare FHIR Resource Editor`



Setup
-------------------------------------------------------------------------------

Expand Down Expand Up @@ -85,17 +95,18 @@ To run this sample:
[--fhir_store_id FHIR_STORE_ID]
[--pubsub_topic PUBSUB_TOPIC] [--gcs_uri GCS_URI]
[--member MEMBER] [--role ROLE]
{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}
{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}
...

positional arguments:
{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}
{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}
create-fhir-store Creates a new FHIR store within the parent dataset.
delete-fhir-store Deletes the specified FHIR store.
get-fhir-store Gets the specified FHIR store.
list-fhir-stores Lists the FHIR stores in the given dataset.
patch-fhir-store Updates the FHIR store.
import-fhir-store Import resources into the FHIR store by copying them
import-fhir-resources
Import resources into the FHIR store by copying them
from the specified source.
export-fhir-store-gcs
Export resources to a Google Cloud Storage bucket by
Expand Down Expand Up @@ -160,36 +171,46 @@ To run this sample:
[--dataset_id DATASET_ID]
[--fhir_store_id FHIR_STORE_ID]
[--resource_type RESOURCE_TYPE]
[--resource_id RESOURCE_ID] [--bundle BUNDLE]
[--resource_id RESOURCE_ID] [--patient_id PATIENT_ID]
[--encounter_id ENCOUNTER_ID] [--bundle BUNDLE]
[--uri_prefix URI_PREFIX] [--version_id VERSION_ID]
{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}
{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}
...

positional arguments:
{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}
create-resource Creates a new resource in a FHIR store.
delete-resource Creates a new resource in a FHIR store.
{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}
create-patient Creates a new Patient resource in a FHIR store.
create-encounter Creates a new Encounter resource in a FHIR store based
on a Patient.
create-observation Creates a new Observation resource in a FHIR store
based on an Encounter.
delete-resource Deletes a FHIR resource. Regardless of whether the
operation succeeds or fails, the server returns a 200
OK HTTP status code. To check that the resource was
successfully deleted, search for or get the resource
and see if it exists.
conditional-delete-resource
Deletes an existing resource specified by search
criteria.
Deletes FHIR resources that match a search query.
get-resource Gets a FHIR resource.
list-resource-history
Gets the history of a resource.
export-resources Exports resources in a FHIR store.
export-resources Exports resources in a FHIR store.
execute_bundle Executes the operations in the given bundle.
execute-bundle Executes the operations in the given bundle.
get-resource-history
Gets a version resource.
delete-resource-purge
Deletes versions of a resource (excluding current
version).
update-resource Updates an existing resource.
conditional-update-resource
Updates an existing resource specified by search
criteria.
If a resource is found based on the search criteria
specified in the query parameters, updates the entire
contents of that resource.
patch-resource Updates part of an existing resource..
conditional-patch-resource
Updates part of an existing resource..
If a resource is found based on the search criteria
specified in the query parameters, updates part of
that resource by applying the operations specified in
a JSON Patch document.
search-resources-get
Searches resources in the given FHIR store using the
searchResources GET method.
Expand All @@ -216,7 +237,13 @@ To run this sample:
--resource_type RESOURCE_TYPE
The type of resource. First letter must be capitalized
--resource_id RESOURCE_ID
Name of a FHIR resource
Identifier for a FHIR resource
--patient_id PATIENT_ID
Identifier for a Patient resource. Can be used as a
reference for an Encounter/Observation
--encounter_id ENCOUNTER_ID
Identifier for an Encounter resource. Can be used as a
reference for an Observation
--bundle BUNDLE Name of file containing bundle of operations to
execute
--uri_prefix URI_PREFIX
Expand Down
Loading