diff --git a/healthcare/api-client/datasets/README.rst b/healthcare/api-client/datasets/README.rst index 02ead8f0e9c..49d24246967 100644 --- a/healthcare/api-client/datasets/README.rst +++ b/healthcare/api-client/datasets/README.rst @@ -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 ------------------------------------------------------------------------------- diff --git a/healthcare/api-client/datasets/README.rst.in b/healthcare/api-client/datasets/README.rst.in index f8a0666d1df..024423a8538 100644 --- a/healthcare/api-client/datasets/README.rst.in +++ b/healthcare/api-client/datasets/README.rst.in @@ -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 diff --git a/healthcare/api-client/datasets/noxfile_config.py b/healthcare/api-client/datasets/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/datasets/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/dicom/README.rst b/healthcare/api-client/dicom/README.rst index d3020a7b482..8f42336f326 100644 --- a/healthcare/api-client/dicom/README.rst +++ b/healthcare/api-client/dicom/README.rst @@ -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 ------------------------------------------------------------------------------- @@ -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. @@ -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. @@ -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. diff --git a/healthcare/api-client/dicom/README.rst.in b/healthcare/api-client/dicom/README.rst.in index 58d9153c3fc..b8dbb2dc5b9 100644 --- a/healthcare/api-client/dicom/README.rst.in +++ b/healthcare/api-client/dicom/README.rst.in @@ -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 diff --git a/healthcare/api-client/dicom/noxfile_config.py b/healthcare/api-client/dicom/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/dicom/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/fhir/README.rst b/healthcare/api-client/fhir/README.rst index 32e0c790998..b1ea3ea9cbf 100644 --- a/healthcare/api-client/fhir/README.rst +++ b/healthcare/api-client/fhir/README.rst @@ -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 ------------------------------------------------------------------------------- @@ -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 @@ -160,24 +171,30 @@ 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 @@ -185,11 +202,15 @@ To run this sample: 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. @@ -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 diff --git a/healthcare/api-client/fhir/README.rst.in b/healthcare/api-client/fhir/README.rst.in index 3e75afb70d5..4b84084ae33 100644 --- a/healthcare/api-client/fhir/README.rst.in +++ b/healthcare/api-client/fhir/README.rst.in @@ -1,252 +1,38 @@ -.. This file is automatically generated. Do not edit this file directly. +# This file is used to generate README.rst -Cloud Healthcare API Python Samples -=============================================================================== +product: + name: Cloud Healthcare API + short_name: Healthcare API + url: https://cloud.google.com/healthcare/docs + description: > + `Cloud Healthcare API`_ implements healthcare-native protocols and formats + to accelerate ingestion, storage, analysis, and integration of healthcare + data with cloud-based applications. -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/fhir/README.rst + - See the `migration guide`_ for information about migrating to Python client library v0.25.1. -This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications. -- See the `migration guide`_ for information about migrating to Python client library v0.25.1. + .. _migration guide: https://cloud.google.com/vision/docs/python-client-migration -.. _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 FHIR Store Administrator +- Healthcare FHIR Resource Editor +setup: +- auth +- install_deps +samples: +- name: FHIR stores + file: fhir_stores.py + show_help: True +- name: FHIR resources + file: fhir_resources.py + show_help: True -.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs +cloud_client_library: true -Setup -------------------------------------------------------------------------------- - - -Authentication -++++++++++++++ - -This sample requires you to have authentication setup. Refer to the -`Authentication Getting Started Guide`_ for instructions on setting up -credentials for applications. - -.. _Authentication Getting Started Guide: - https://cloud.google.com/docs/authentication/getting-started - -Install Dependencies -++++++++++++++++++++ - -#. Clone python-docs-samples and change directory to the sample directory you want to use. - - .. code-block:: bash - - $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git - -#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. - - .. _Python Development Environment Setup Guide: - https://cloud.google.com/python/setup - -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. - - .. code-block:: bash - - $ virtualenv env - $ source env/bin/activate - -#. Install the dependencies needed to run the samples. - - .. code-block:: bash - - $ pip install -r requirements.txt - -.. _pip: https://pip.pypa.io/ -.. _virtualenv: https://virtualenv.pypa.io/ - -Samples -------------------------------------------------------------------------------- - -FHIR stores -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/fhir/fhir_stores.py,healthcare/api-client/fhir/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python fhir_stores.py - - usage: fhir_stores.py [-h] [--service_account_json SERVICE_ACCOUNT_JSON] - [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION] - [--dataset_id DATASET_ID] - [--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} - ... - - 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 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 - from the specified source. - export-fhir-store-gcs - Export resources to a Google Cloud Storage bucket by - copying them from the FHIR store. - get_iam_policy Gets the IAM policy for the specified FHIR store. - set_iam_policy Sets the IAM policy for the specified FHIR store. A - single member will be assigned a single role. A member - can be any of: - allUsers, that is, anyone - - allAuthenticatedUsers, anyone authenticated with a - Google account - user:email, as in - 'user:somebody@example.com' - group:email, as in - 'group:admins@example.com' - domain:domainname, as in - 'domain:example.com' - serviceAccount:email, as in - 'serviceAccount:my-other- - app@appspot.gserviceaccount.com' A role can be any IAM - role, such as 'roles/viewer', 'roles/owner', or - 'roles/editor' - - optional arguments: - -h, --help show this help message and exit - --service_account_json SERVICE_ACCOUNT_JSON - Path to service account JSON file. - --project_id PROJECT_ID - GCP cloud project name - --cloud_region CLOUD_REGION - GCP cloud region - --dataset_id DATASET_ID - Name of dataset - --fhir_store_id FHIR_STORE_ID - Name of FHIR store - --pubsub_topic PUBSUB_TOPIC - The Cloud Pub/Sub topic where notifications of changes - are published - --gcs_uri GCS_URI URI for a Google Cloud Storage directory from which - filesshould be import or to which result filesshould - be written (e.g., "bucket- - id/path/to/destination/dir"). - --member MEMBER Member to add to IAM policy (e.g. - "domain:example.com") - --role ROLE IAM Role to give to member (e.g. "roles/viewer") - - - -FHIR resources -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/fhir/fhir_resources.py,healthcare/api-client/fhir/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python fhir_resources.py - - usage: fhir_resources.py [-h] [--service_account_json SERVICE_ACCOUNT_JSON] - [--base_url BASE_URL] [--project_id PROJECT_ID] - [--cloud_region CLOUD_REGION] - [--dataset_id DATASET_ID] - [--fhir_store_id FHIR_STORE_ID] - [--resource_type RESOURCE_TYPE] - [--resource_id RESOURCE_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} - ... - - positional arguments: - {create-patient,create-encounter,create-observation,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 Creates a new Patient resource in a FHIR store. - create-encounter Creates a new Encounter resource in a FHIR store. - create-observation Creates a new Observation resource in a FHIR store. - delete-resource Creates a new resource in a FHIR store. - conditional-delete-resource - Deletes an existing resource specified by search - criteria. - 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. - 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. - patch-resource Updates part of an existing resource. - conditional-patch-resource - Updates part of an existing resource. - search-resources-get - Searches resources in the given FHIR store using the - searchResources GET method. - search-resources-post - Searches resources in the given FHIR store using the - searchResources GET method. - get-patient-everything - Gets all the resources in the patient compartment. - get-metadata Gets the capabilities statement for a FHIR store. - - optional arguments: - -h, --help show this help message and exit - --service_account_json SERVICE_ACCOUNT_JSON - Path to service account JSON file. - --base_url BASE_URL Healthcare API URL. - --project_id PROJECT_ID - GCP project name - --cloud_region CLOUD_REGION - GCP region - --dataset_id DATASET_ID - Name of dataset - --fhir_store_id FHIR_STORE_ID - Name of FHIR store - --resource_type RESOURCE_TYPE - The type of resource. First letter must be capitalized - --resource_id RESOURCE_ID - Name of 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 - Prefix of gs:// URIs for import and export - --version_id VERSION_ID - Version of a FHIR resource - - - - - -The client library -------------------------------------------------------------------------------- - -This sample uses the `Google Cloud Client Library for Python`_. -You can read the documentation for more details on API usage and use GitHub -to `browse the source`_ and `report issues`_. - -.. _Google Cloud Client Library for Python: - https://googlecloudplatform.github.io/google-cloud-python/ -.. _browse the source: - https://github.com/GoogleCloudPlatform/google-cloud-python -.. _report issues: - https://github.com/GoogleCloudPlatform/google-cloud-python/issues - - -.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file +folder: healthcare/api-client/fhir diff --git a/healthcare/api-client/fhir/noxfile_config.py b/healthcare/api-client/fhir/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/fhir/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/hl7v2/README.rst b/healthcare/api-client/hl7v2/README.rst index acafbaf1f47..1c23eea2d08 100644 --- a/healthcare/api-client/hl7v2/README.rst +++ b/healthcare/api-client/hl7v2/README.rst @@ -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 HL7v2 Store Administrator` +* `Healthcare HL7v2 Message Editor` + + + Setup ------------------------------------------------------------------------------- diff --git a/healthcare/api-client/hl7v2/README.rst.in b/healthcare/api-client/hl7v2/README.rst.in index dc8dc117cf6..62efc12df56 100644 --- a/healthcare/api-client/hl7v2/README.rst.in +++ b/healthcare/api-client/hl7v2/README.rst.in @@ -14,6 +14,12 @@ 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 HL7v2 Store Administrator +- Healthcare HL7v2 Message Editor + setup: - auth - install_deps diff --git a/healthcare/api-client/hl7v2/noxfile_config.py b/healthcare/api-client/hl7v2/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/hl7v2/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/v1/datasets/README.rst b/healthcare/api-client/v1/datasets/README.rst index 576d087b280..5444d6b0172 100644 --- a/healthcare/api-client/v1/datasets/README.rst +++ b/healthcare/api-client/v1/datasets/README.rst @@ -4,7 +4,7 @@ Cloud Healthcare API Python Samples =============================================================================== .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/datasets/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/datasets/README.rst This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications. @@ -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 ------------------------------------------------------------------------------- @@ -68,7 +75,7 @@ Datasets +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/datasets/datasets.py,healthcare/api-client/datasets/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/datasets/datasets.py,healthcare/api-client/v1/datasets/README.rst @@ -80,8 +87,8 @@ To run this sample: $ python datasets.py usage: datasets.py [-h] [--project_id PROJECT_ID] - [--cloud_region CLOUD_REGION] - [--dataset_id DATASET_ID] [--time_zone TIME_ZONE] + [--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID] + [--time_zone TIME_ZONE] [--destination_dataset_id DESTINATION_DATASET_ID] [--keeplist_tags KEEPLIST_TAGS] [--member MEMBER] [--role ROLE] @@ -150,4 +157,4 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/healthcare/api-client/v1/datasets/README.rst.in b/healthcare/api-client/v1/datasets/README.rst.in index 6e47a6f6384..9ea8d18c436 100644 --- a/healthcare/api-client/v1/datasets/README.rst.in +++ b/healthcare/api-client/v1/datasets/README.rst.in @@ -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 diff --git a/healthcare/api-client/v1/datasets/noxfile_config.py b/healthcare/api-client/v1/datasets/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/v1/datasets/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/v1/dicom/README.rst b/healthcare/api-client/v1/dicom/README.rst index 6d117852df7..e2bdc469fd1 100644 --- a/healthcare/api-client/v1/dicom/README.rst +++ b/healthcare/api-client/v1/dicom/README.rst @@ -1,9 +1,10 @@ .. This file is automatically generated. Do not edit this file directly. + Cloud Healthcare API Python Samples =============================================================================== .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/dicom/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/dicom/README.rst This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications. @@ -16,6 +17,17 @@ 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` + + + Setup ------------------------------------------------------------------------------- @@ -36,20 +48,27 @@ Install Dependencies #. Clone python-docs-samples and change directory to the sample directory you want to use. .. code-block:: bash + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + #. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup + #. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. .. code-block:: bash + $ virtualenv env $ source env/bin/activate + #. Install the dependencies needed to run the samples. .. code-block:: bash + $ pip install -r requirements.txt + .. _pip: https://pip.pypa.io/ .. _virtualenv: https://virtualenv.pypa.io/ @@ -60,7 +79,7 @@ DICOM stores +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/dicom/dicom_stores.py,healthcare/api-client/dicom/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/dicom/dicom_stores.py,healthcare/api-client/v1/dicom/README.rst @@ -68,9 +87,11 @@ DICOM stores To run this sample: .. code-block:: bash + $ python dicom_stores.py - usage: dicom_stores.py [-h] [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION] - [--dataset_id DATASET_ID] + + usage: dicom_stores.py [-h] [--project_id PROJECT_ID] + [--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID] [--dicom_store_id DICOM_STORE_ID] [--pubsub_topic PUBSUB_TOPIC] [--uri_prefix URI_PREFIX] [--content_uri CONTENT_URI] @@ -78,6 +99,7 @@ To run this sample: [--member MEMBER] [--role ROLE] {create-dicom-store,delete-dicom-store,get-dicom-store,list-dicom-stores,patch-dicom-store,get_iam_policy,set_iam_policy,export-dicom-store,import-dicom-store} ... + positional arguments: {create-dicom-store,delete-dicom-store,get-dicom-store,list-dicom-stores,patch-dicom-store,get_iam_policy,set_iam_policy,export-dicom-store,import-dicom-store} create-dicom-store Creates a new DICOM store within the parent dataset. @@ -102,6 +124,7 @@ To run this sample: copying it from the DICOM store. import-dicom-store Import data into the DICOM store by copying it from the specified source. + optional arguments: -h, --help show this help message and exit --project_id PROJECT_ID @@ -130,11 +153,14 @@ To run this sample: --member MEMBER Member to add to IAM policy (e.g. "domain:example.com") --role ROLE IAM Role to give to member (e.g. "roles/viewer") + + + DICOMweb +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/dicom/dicomweb.py,healthcare/api-client/dicom/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/dicom/dicomweb.py,healthcare/api-client/v1/dicom/README.rst @@ -142,15 +168,19 @@ DICOMweb To run this sample: .. code-block:: bash + $ python dicomweb.py + usage: dicomweb.py [-h] [--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. @@ -160,9 +190,19 @@ 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. + optional arguments: -h, --help show this help message and exit --base_url BASE_URL Healthcare API URL @@ -177,6 +217,15 @@ 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. + + + + + The client library ------------------------------------------------------------------------------- @@ -192,4 +241,4 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/healthcare/api-client/v1/dicom/README.rst.in b/healthcare/api-client/v1/dicom/README.rst.in index b594007cea7..8160f116a72 100644 --- a/healthcare/api-client/v1/dicom/README.rst.in +++ b/healthcare/api-client/v1/dicom/README.rst.in @@ -14,6 +14,13 @@ 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 + setup: - auth - install_deps diff --git a/healthcare/api-client/v1/dicom/noxfile_config.py b/healthcare/api-client/v1/dicom/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/v1/dicom/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/v1/fhir/README.rst b/healthcare/api-client/v1/fhir/README.rst index c17d45e76f3..20291dd244a 100644 --- a/healthcare/api-client/v1/fhir/README.rst +++ b/healthcare/api-client/v1/fhir/README.rst @@ -4,7 +4,7 @@ Cloud Healthcare API Python Samples =============================================================================== .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/fhir/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/fhir/README.rst This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications. @@ -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 ------------------------------------------------------------------------------- @@ -68,7 +78,7 @@ FHIR stores +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/fhir/fhir_stores.py,healthcare/api-client/fhir/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/fhir/fhir_stores.py,healthcare/api-client/v1/fhir/README.rst @@ -79,22 +89,28 @@ To run this sample: $ python fhir_stores.py - usage: fhir_stores.py [-h] [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION] - [--dataset_id DATASET_ID] + usage: fhir_stores.py [-h] [--project_id PROJECT_ID] + [--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID] [--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,get-fhir-store-metadata,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,get-fhir-store-metadata,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. + get-fhir-store-metadata + Gets the FHIR capability statement (STU3, R4), or the + conformance statement in the DSTU2 case for the store, + which contains a description of functionality + supported by the server. 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 @@ -140,7 +156,7 @@ FHIR resources +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/fhir/fhir_resources.py,healthcare/api-client/fhir/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/fhir/fhir_resources.py,healthcare/api-client/v1/fhir/README.rst @@ -156,21 +172,28 @@ 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,get-resource,list-resource-history,export-resources,execute_bundle,get-resource-history,delete-resource-purge,update-resource,patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata} + {create-patient,create-encounter,create-observation,delete-resource,get-resource,list-resource-history,execute-bundle,get-resource-history,delete-resource-purge,update-resource,patch-resource,search-resources-get,search-resources-post,get-patient-everything} ... 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,get-resource,list-resource-history,execute-bundle,get-resource-history,delete-resource-purge,update-resource,patch-resource,search-resources-get,search-resources-post,get-patient-everything} + 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. 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 @@ -179,14 +202,13 @@ To run this sample: update-resource Updates an existing resource. patch-resource Updates part of an existing resource. search-resources-get - Searches resources in the given FHIR store using the - searchResources GET method. + Searches resources in the given FHIR store. It uses + the searchResources GET method. search-resources-post - Searches resources in the given FHIR store using the - searchResources GET method. + Searches resources in the given FHIR store. It uses + the searchResources GET method. get-patient-everything Gets all the resources in the patient compartment. - get-metadata Gets the capabilities statement for a FHIR store. optional arguments: -h, --help show this help message and exit @@ -202,7 +224,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 @@ -229,4 +257,4 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/healthcare/api-client/v1/fhir/README.rst.in b/healthcare/api-client/v1/fhir/README.rst.in index 13fea87d8f6..afcd6596361 100644 --- a/healthcare/api-client/v1/fhir/README.rst.in +++ b/healthcare/api-client/v1/fhir/README.rst.in @@ -14,6 +14,12 @@ 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 FHIR Store Administrator +- Healthcare FHIR Resource Editor + setup: - auth - install_deps diff --git a/healthcare/api-client/v1/fhir/noxfile_config.py b/healthcare/api-client/v1/fhir/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/v1/fhir/noxfile_config.py @@ -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': {}, +} diff --git a/healthcare/api-client/v1/hl7v2/README.rst b/healthcare/api-client/v1/hl7v2/README.rst index bd9b1fc7df6..a762e1791bb 100644 --- a/healthcare/api-client/v1/hl7v2/README.rst +++ b/healthcare/api-client/v1/hl7v2/README.rst @@ -1,9 +1,10 @@ .. This file is automatically generated. Do not edit this file directly. + Cloud Healthcare API Python Samples =============================================================================== .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/hl7v2/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/hl7v2/README.rst This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications. @@ -16,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 HL7v2 Store Administrator` +* `Healthcare HL7v2 Message Editor` + + + Setup ------------------------------------------------------------------------------- @@ -36,20 +47,27 @@ Install Dependencies #. Clone python-docs-samples and change directory to the sample directory you want to use. .. code-block:: bash + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + #. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup + #. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. .. code-block:: bash + $ virtualenv env $ source env/bin/activate + #. Install the dependencies needed to run the samples. .. code-block:: bash + $ pip install -r requirements.txt + .. _pip: https://pip.pypa.io/ .. _virtualenv: https://virtualenv.pypa.io/ @@ -60,7 +78,7 @@ HL7v2 stores +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/hl7v2/hl7v2_stores.py,healthcare/api-client/hl7v2/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/hl7v2/hl7v2_stores.py,healthcare/api-client/v1/hl7v2/README.rst @@ -68,14 +86,17 @@ HL7v2 stores To run this sample: .. code-block:: bash + $ python hl7v2_stores.py - usage: hl7v2_stores.py [-h] [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION] - [--dataset_id DATASET_ID] + + usage: hl7v2_stores.py [-h] [--project_id PROJECT_ID] + [--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID] [--hl7v2_store_id HL7V2_STORE_ID] [--pubsub_topic PUBSUB_TOPIC] [--member MEMBER] [--role ROLE] {create-hl7v2-store,delete-hl7v2-store,get-hl7v2-store,list-hl7v2-stores,patch-hl7v2-store,get_iam_policy,set_iam_policy} ... + positional arguments: {create-hl7v2-store,delete-hl7v2-store,get-hl7v2-store,list-hl7v2-stores,patch-hl7v2-store,get_iam_policy,set_iam_policy} create-hl7v2-store Creates a new HL7v2 store within the parent dataset. @@ -96,6 +117,7 @@ To run this sample: app@appspot.gserviceaccount.com' A role can be any IAM role, such as 'roles/viewer', 'roles/owner', or 'roles/editor' + optional arguments: -h, --help show this help message and exit --project_id PROJECT_ID @@ -112,11 +134,14 @@ To run this sample: --member MEMBER Member to add to IAM policy (e.g. "domain:example.com") --role ROLE IAM Role to give to member (e.g. "roles/viewer") + + + HL7v2 messages +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/hl7v2/hl7v2_messages.py,healthcare/api-client/hl7v2/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/v1/hl7v2/hl7v2_messages.py,healthcare/api-client/v1/hl7v2/README.rst @@ -124,7 +149,9 @@ HL7v2 messages To run this sample: .. code-block:: bash + $ python hl7v2_messages.py + usage: hl7v2_messages.py [-h] [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID] @@ -134,6 +161,7 @@ To run this sample: [--label_key LABEL_KEY] [--label_value LABEL_VALUE] {create-hl7v2-message,delete-hl7v2-message,get-hl7v2-message,ingest-hl7v2-message,list-hl7v2-messages,patch-hl7v2-message} ... + positional arguments: {create-hl7v2-message,delete-hl7v2-message,get-hl7v2-message,ingest-hl7v2-message,list-hl7v2-messages,patch-hl7v2-message} create-hl7v2-message @@ -152,6 +180,7 @@ To run this sample: support for filtering. patch-hl7v2-message Updates the message. + optional arguments: -h, --help show this help message and exit --project_id PROJECT_ID @@ -170,15 +199,24 @@ To run this sample: Arbitrary label key to apply to the message --label_value LABEL_VALUE Arbitrary label value to apply to the message + + + + + The client library ------------------------------------------------------------------------------- + This sample uses the `Google Cloud Client Library for Python`_. You can read the documentation for more details on API usage and use GitHub to `browse the source`_ and `report issues`_. + .. _Google Cloud Client Library for Python: https://googlecloudplatform.github.io/google-cloud-python/ .. _browse the source: https://github.com/GoogleCloudPlatform/google-cloud-python .. _report issues: https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ + + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/healthcare/api-client/v1/hl7v2/README.rst.in b/healthcare/api-client/v1/hl7v2/README.rst.in index 6179ec147ba..d0b9b5648bb 100644 --- a/healthcare/api-client/v1/hl7v2/README.rst.in +++ b/healthcare/api-client/v1/hl7v2/README.rst.in @@ -14,6 +14,12 @@ 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 HL7v2 Store Administrator +- Healthcare HL7v2 Message Editor + setup: - auth - install_deps diff --git a/healthcare/api-client/v1/hl7v2/noxfile_config.py b/healthcare/api-client/v1/hl7v2/noxfile_config.py new file mode 100644 index 00000000000..cfd0d439150 --- /dev/null +++ b/healthcare/api-client/v1/hl7v2/noxfile_config.py @@ -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': {}, +}