Skip to content

healthcare API: update all DICOM v1beta1 samples to v1 #3387

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

Merged
merged 9 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 195 additions & 0 deletions healthcare/api-client/v1/dicom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
.. 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


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




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

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
-------------------------------------------------------------------------------

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




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]
[--dicom_store_id DICOM_STORE_ID]
[--pubsub_topic PUBSUB_TOPIC] [--uri_prefix URI_PREFIX]
[--content_uri CONTENT_URI]
[--export_format {FORMAT_UNSPECIFIED,DICOM,JSON_BIGQUERY_IMPORT}]
[--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.
delete-dicom-store Deletes the specified DICOM store.
get-dicom-store Gets the specified DICOM store.
list-dicom-stores Lists the DICOM stores in the given dataset.
patch-dicom-store Updates the DICOM store.
get_iam_policy Gets the IAM policy for the specified dicom store.
set_iam_policy Sets the IAM policy for the specified dicom 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:[email protected]' - group:email, as in
'group:[email protected]' - domain:domainname, as in
'domain:example.com' - serviceAccount:email, as in
'serviceAccount:my-other-
[email protected]' A role can be any IAM
role, such as 'roles/viewer', 'roles/owner', or
'roles/editor'
export-dicom-store Export data to a Google Cloud Storage bucket by
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
GCP project name
--cloud_region CLOUD_REGION
GCP region
--dataset_id DATASET_ID
Name of dataset
--dicom_store_id DICOM_STORE_ID
Name of DICOM store
--pubsub_topic PUBSUB_TOPIC
The Cloud Pub/Sub topic that notifications of changes
are published on
--uri_prefix URI_PREFIX
URI for a Google Cloud Storage directory to which
result filesshould be written (e.g., "bucket-
id/path/to/destination/dir").
--content_uri CONTENT_URI
URI for a Google Cloud Storage directory from which
filesshould be imported (e.g., "bucket-
id/path/to/destination/dir").
--export_format {FORMAT_UNSPECIFIED,DICOM,JSON_BIGQUERY_IMPORT}
Specifies the output format. If the format is
unspecified, thedefault functionality is to export to
DICOM.
--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




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}
...
positional arguments:
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
dicomweb-store-instance
Handles the POST requests specified in the DICOMweb
standard.
dicomweb-search-instance
Handles the GET requests specified in DICOMweb
standard.
dicomweb-retrieve-study
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
--project_id PROJECT_ID
GCP project name
--cloud_region CLOUD_REGION
GCP region
--dataset_id DATASET_ID
Name of dataset
--dicom_store_id DICOM_STORE_ID
Name of DICOM store
--dcm_file DCM_FILE File name for DCM file to store.
--study_uid STUDY_UID
Unique identifier for a study.
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/
32 changes: 32 additions & 0 deletions healthcare/api-client/v1/dicom/README.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file is used to generate README.rst

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.

- 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

setup:
- auth
- install_deps

samples:
- name: DICOM stores
file: dicom_stores.py
show_help: True

- name: DICOMweb
file: dicomweb.py
show_help: True

cloud_client_library: true

folder: healthcare/api-client/v1/dicom
Loading