Skip to content

Commit 002c18a

Browse files
authored
healthcare API: update all DICOM v1beta1 samples to v1 (#3387)
* healthcare API: update all DICOM v1beta1 samples to v1 * add DICOM test file * make DICOM v1 samples consistent with other modalities * remove HttpError import * shorten docstring * address review comments * fix nits * additional context on 403/404 exceptions when deleting resources in tests
1 parent 1464dfc commit 002c18a

File tree

9 files changed

+1604
-0
lines changed

9 files changed

+1604
-0
lines changed
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
.. This file is automatically generated. Do not edit this file directly.
2+
Cloud Healthcare API Python Samples
3+
===============================================================================
4+
5+
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
6+
: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
7+
8+
9+
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.
10+
- See the `migration guide`_ for information about migrating to Python client library v0.25.1.
11+
12+
.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration
13+
14+
15+
16+
17+
.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs
18+
19+
Setup
20+
-------------------------------------------------------------------------------
21+
22+
23+
Authentication
24+
++++++++++++++
25+
26+
This sample requires you to have authentication setup. Refer to the
27+
`Authentication Getting Started Guide`_ for instructions on setting up
28+
credentials for applications.
29+
30+
.. _Authentication Getting Started Guide:
31+
https://cloud.google.com/docs/authentication/getting-started
32+
33+
Install Dependencies
34+
++++++++++++++++++++
35+
36+
#. Clone python-docs-samples and change directory to the sample directory you want to use.
37+
38+
.. code-block:: bash
39+
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
40+
#. 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.
41+
42+
.. _Python Development Environment Setup Guide:
43+
https://cloud.google.com/python/setup
44+
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
45+
46+
.. code-block:: bash
47+
$ virtualenv env
48+
$ source env/bin/activate
49+
#. Install the dependencies needed to run the samples.
50+
51+
.. code-block:: bash
52+
$ pip install -r requirements.txt
53+
.. _pip: https://pip.pypa.io/
54+
.. _virtualenv: https://virtualenv.pypa.io/
55+
56+
Samples
57+
-------------------------------------------------------------------------------
58+
59+
DICOM stores
60+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61+
62+
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
63+
: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
64+
65+
66+
67+
68+
To run this sample:
69+
70+
.. code-block:: bash
71+
$ python dicom_stores.py
72+
usage: dicom_stores.py [-h] [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION]
73+
[--dataset_id DATASET_ID]
74+
[--dicom_store_id DICOM_STORE_ID]
75+
[--pubsub_topic PUBSUB_TOPIC] [--uri_prefix URI_PREFIX]
76+
[--content_uri CONTENT_URI]
77+
[--export_format {FORMAT_UNSPECIFIED,DICOM,JSON_BIGQUERY_IMPORT}]
78+
[--member MEMBER] [--role ROLE]
79+
{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}
80+
...
81+
positional arguments:
82+
{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}
83+
create-dicom-store Creates a new DICOM store within the parent dataset.
84+
delete-dicom-store Deletes the specified DICOM store.
85+
get-dicom-store Gets the specified DICOM store.
86+
list-dicom-stores Lists the DICOM stores in the given dataset.
87+
patch-dicom-store Updates the DICOM store.
88+
get_iam_policy Gets the IAM policy for the specified dicom store.
89+
set_iam_policy Sets the IAM policy for the specified dicom store. A
90+
single member will be assigned a single role. A member
91+
can be any of: - allUsers, that is, anyone -
92+
allAuthenticatedUsers, anyone authenticated with a
93+
Google account - user:email, as in
94+
'user:[email protected]' - group:email, as in
95+
'group:[email protected]' - domain:domainname, as in
96+
'domain:example.com' - serviceAccount:email, as in
97+
'serviceAccount:my-other-
98+
[email protected]' A role can be any IAM
99+
role, such as 'roles/viewer', 'roles/owner', or
100+
'roles/editor'
101+
export-dicom-store Export data to a Google Cloud Storage bucket by
102+
copying it from the DICOM store.
103+
import-dicom-store Import data into the DICOM store by copying it from
104+
the specified source.
105+
optional arguments:
106+
-h, --help show this help message and exit
107+
--project_id PROJECT_ID
108+
GCP project name
109+
--cloud_region CLOUD_REGION
110+
GCP region
111+
--dataset_id DATASET_ID
112+
Name of dataset
113+
--dicom_store_id DICOM_STORE_ID
114+
Name of DICOM store
115+
--pubsub_topic PUBSUB_TOPIC
116+
The Cloud Pub/Sub topic that notifications of changes
117+
are published on
118+
--uri_prefix URI_PREFIX
119+
URI for a Google Cloud Storage directory to which
120+
result filesshould be written (e.g., "bucket-
121+
id/path/to/destination/dir").
122+
--content_uri CONTENT_URI
123+
URI for a Google Cloud Storage directory from which
124+
filesshould be imported (e.g., "bucket-
125+
id/path/to/destination/dir").
126+
--export_format {FORMAT_UNSPECIFIED,DICOM,JSON_BIGQUERY_IMPORT}
127+
Specifies the output format. If the format is
128+
unspecified, thedefault functionality is to export to
129+
DICOM.
130+
--member MEMBER Member to add to IAM policy (e.g.
131+
"domain:example.com")
132+
--role ROLE IAM Role to give to member (e.g. "roles/viewer")
133+
DICOMweb
134+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
135+
136+
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
137+
: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
138+
139+
140+
141+
142+
To run this sample:
143+
144+
.. code-block:: bash
145+
$ python dicomweb.py
146+
usage: dicomweb.py [-h] [--base_url BASE_URL] [--project_id PROJECT_ID]
147+
[--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID]
148+
[--dicom_store_id DICOM_STORE_ID] [--dcm_file DCM_FILE]
149+
[--study_uid STUDY_UID]
150+
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
151+
...
152+
positional arguments:
153+
{dicomweb-store-instance,dicomweb-search-instance,dicomweb-retrieve-study,dicomweb-delete-study}
154+
dicomweb-store-instance
155+
Handles the POST requests specified in the DICOMweb
156+
standard.
157+
dicomweb-search-instance
158+
Handles the GET requests specified in DICOMweb
159+
standard.
160+
dicomweb-retrieve-study
161+
Handles the GET requests specified in the DICOMweb
162+
standard.
163+
dicomweb-delete-study
164+
Handles DELETE requests equivalent to the GET requests
165+
specified in the WADO-RS standard.
166+
optional arguments:
167+
-h, --help show this help message and exit
168+
--base_url BASE_URL Healthcare API URL
169+
--project_id PROJECT_ID
170+
GCP project name
171+
--cloud_region CLOUD_REGION
172+
GCP region
173+
--dataset_id DATASET_ID
174+
Name of dataset
175+
--dicom_store_id DICOM_STORE_ID
176+
Name of DICOM store
177+
--dcm_file DCM_FILE File name for DCM file to store.
178+
--study_uid STUDY_UID
179+
Unique identifier for a study.
180+
The client library
181+
-------------------------------------------------------------------------------
182+
183+
This sample uses the `Google Cloud Client Library for Python`_.
184+
You can read the documentation for more details on API usage and use GitHub
185+
to `browse the source`_ and `report issues`_.
186+
187+
.. _Google Cloud Client Library for Python:
188+
https://googlecloudplatform.github.io/google-cloud-python/
189+
.. _browse the source:
190+
https://github.com/GoogleCloudPlatform/google-cloud-python
191+
.. _report issues:
192+
https://github.com/GoogleCloudPlatform/google-cloud-python/issues
193+
194+
195+
.. _Google Cloud SDK: https://cloud.google.com/sdk/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file is used to generate README.rst
2+
3+
product:
4+
name: Cloud Healthcare API
5+
short_name: Healthcare API
6+
url: https://cloud.google.com/healthcare/docs
7+
description: >
8+
`Cloud Healthcare API`_ implements healthcare-native protocols and formats
9+
to accelerate ingestion, storage, analysis, and integration of healthcare
10+
data with cloud-based applications.
11+
12+
- See the `migration guide`_ for information about migrating to Python client library v0.25.1.
13+
14+
15+
.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration
16+
17+
setup:
18+
- auth
19+
- install_deps
20+
21+
samples:
22+
- name: DICOM stores
23+
file: dicom_stores.py
24+
show_help: True
25+
26+
- name: DICOMweb
27+
file: dicomweb.py
28+
show_help: True
29+
30+
cloud_client_library: true
31+
32+
folder: healthcare/api-client/v1/dicom

0 commit comments

Comments
 (0)