Skip to content

Commit 5a3cd08

Browse files
noerogTakashi Matsuo
andauthored
healthcare API: update v1beta1 datasets samples to v1 (#3300)
* healthcare API: update all v1beta1 samples to v1 * healthcare API: use v1 instead of v1beta1 endpoint * healthcare API: remove FHIR conditional methods from v1 because they are only in v1beta1 * add requirements-test.txt files * Change test response for searching for studies to 204 * fix missing param in execute_bundle.json causing test failures * fix HL7v2 store failure. notificationConfig was deprecated in favor of notificationConfigs * address review comments: use ADC and simplify credentials auth * delete new FHIR files, they are now in #3384 * delete new DICOM files, they are now in #3387 * delete new HL7v2 files, they are now in #3388 * clean up test_dataset fixture * remove try block from the sample * more robust test setup and cleanup Co-authored-by: Takashi Matsuo <[email protected]>
1 parent 51e1839 commit 5a3cd08

File tree

6 files changed

+772
-0
lines changed

6 files changed

+772
-0
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
.. This file is automatically generated. Do not edit this file directly.
2+
3+
Cloud Healthcare API Python Samples
4+
===============================================================================
5+
6+
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
7+
: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
8+
9+
10+
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.
11+
- See the `migration guide`_ for information about migrating to Python client library v0.25.1.
12+
13+
.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration
14+
15+
16+
17+
18+
.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs
19+
20+
Setup
21+
-------------------------------------------------------------------------------
22+
23+
24+
Authentication
25+
++++++++++++++
26+
27+
This sample requires you to have authentication setup. Refer to the
28+
`Authentication Getting Started Guide`_ for instructions on setting up
29+
credentials for applications.
30+
31+
.. _Authentication Getting Started Guide:
32+
https://cloud.google.com/docs/authentication/getting-started
33+
34+
Install Dependencies
35+
++++++++++++++++++++
36+
37+
#. Clone python-docs-samples and change directory to the sample directory you want to use.
38+
39+
.. code-block:: bash
40+
41+
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
42+
43+
#. 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.
44+
45+
.. _Python Development Environment Setup Guide:
46+
https://cloud.google.com/python/setup
47+
48+
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
49+
50+
.. code-block:: bash
51+
52+
$ virtualenv env
53+
$ source env/bin/activate
54+
55+
#. Install the dependencies needed to run the samples.
56+
57+
.. code-block:: bash
58+
59+
$ pip install -r requirements.txt
60+
61+
.. _pip: https://pip.pypa.io/
62+
.. _virtualenv: https://virtualenv.pypa.io/
63+
64+
Samples
65+
-------------------------------------------------------------------------------
66+
67+
Datasets
68+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
69+
70+
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
71+
: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
72+
73+
74+
75+
76+
To run this sample:
77+
78+
.. code-block:: bash
79+
80+
$ python datasets.py
81+
82+
usage: datasets.py [-h] [--project_id PROJECT_ID]
83+
[--cloud_region CLOUD_REGION]
84+
[--dataset_id DATASET_ID] [--time_zone TIME_ZONE]
85+
[--destination_dataset_id DESTINATION_DATASET_ID]
86+
[--keeplist_tags KEEPLIST_TAGS] [--member MEMBER]
87+
[--role ROLE]
88+
{create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,get_iam_policy,set_iam_policy,deidentify-dataset}
89+
...
90+
91+
positional arguments:
92+
{create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,get_iam_policy,set_iam_policy,deidentify-dataset}
93+
create-dataset Creates a dataset.
94+
delete-dataset Deletes a dataset.
95+
get-dataset Gets any metadata associated with a dataset.
96+
list-datasets Lists the datasets in the project.
97+
patch-dataset Updates dataset metadata.
98+
get_iam_policy Gets the IAM policy for the specified dataset.
99+
set_iam_policy Sets the IAM policy for the specified dataset. A
100+
single member will be assigned a single role. A member
101+
can be any of: - allUsers, that is, anyone -
102+
allAuthenticatedUsers, anyone authenticated with a
103+
Google account - user:email, as in
104+
'user:[email protected]' - group:email, as in
105+
'group:[email protected]' - domain:domainname, as in
106+
'domain:example.com' - serviceAccount:email, as in
107+
'serviceAccount:my-other-
108+
[email protected]' A role can be any IAM
109+
role, such as 'roles/viewer', 'roles/owner', or
110+
'roles/editor'
111+
deidentify-dataset Creates a new dataset containing de-identified data
112+
from the source dataset.
113+
114+
optional arguments:
115+
-h, --help show this help message and exit
116+
--project_id PROJECT_ID
117+
GCP project name
118+
--cloud_region CLOUD_REGION
119+
GCP cloud region
120+
--dataset_id DATASET_ID
121+
Name of dataset
122+
--time_zone TIME_ZONE
123+
The default timezone used by a dataset
124+
--destination_dataset_id DESTINATION_DATASET_ID
125+
The name of the new dataset where the de-identified
126+
data will be written
127+
--keeplist_tags KEEPLIST_TAGS
128+
The data to keeplist, for example "PatientID" or
129+
"StudyInstanceUID"
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+
134+
135+
136+
137+
138+
The client library
139+
-------------------------------------------------------------------------------
140+
141+
This sample uses the `Google Cloud Client Library for Python`_.
142+
You can read the documentation for more details on API usage and use GitHub
143+
to `browse the source`_ and `report issues`_.
144+
145+
.. _Google Cloud Client Library for Python:
146+
https://googlecloudplatform.github.io/google-cloud-python/
147+
.. _browse the source:
148+
https://github.com/GoogleCloudPlatform/google-cloud-python
149+
.. _report issues:
150+
https://github.com/GoogleCloudPlatform/google-cloud-python/issues
151+
152+
153+
.. _Google Cloud SDK: https://cloud.google.com/sdk/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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: Datasets
23+
file: datasets.py
24+
show_help: True
25+
26+
cloud_client_library: true
27+
28+
folder: healthcare/api-client/v1/datasets

0 commit comments

Comments
 (0)