Skip to content

healthcare API: update v1beta1 datasets samples to v1 #3300

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 23 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d5dd454
healthcare API: update all v1beta1 samples to v1
noerog Apr 7, 2020
9208bba
healthcare API: use v1 instead of v1beta1 endpoint
noerog Apr 7, 2020
43856c0
healthcare API: remove FHIR conditional methods from v1 because they …
noerog Apr 8, 2020
a4a40d3
add requirements-test.txt files
noerog Apr 8, 2020
00c7dde
Change test response for searching for studies to 204
noerog Apr 8, 2020
ca944c7
fix missing param in execute_bundle.json causing test failures
noerog Apr 8, 2020
bb633cc
fix HL7v2 store failure. notificationConfig was deprecated in favor o…
noerog Apr 8, 2020
ab2c375
address review comments
noerog Apr 9, 2020
c8a5ed5
fix lint errors
noerog Apr 9, 2020
ab303f4
address review comments: use ADC and simplify credentials auth
noerog Apr 10, 2020
af4634b
address review comments
noerog Apr 13, 2020
0b7da81
delete new FHIR files, they are now in https://github.com/GoogleCloud…
noerog Apr 13, 2020
81d8e84
delete new DICOM files, they are now in https://github.com/GoogleClou…
noerog Apr 13, 2020
f7704e5
delete new HL7v2 files, they are now in https://github.com/GoogleClou…
noerog Apr 13, 2020
94f19c7
address review comments
noerog Apr 13, 2020
501d0fa
address review comments
noerog Apr 14, 2020
e14039b
clean up test_dataset fixture
noerog Apr 14, 2020
72c72a6
address review comments
noerog Apr 14, 2020
ae623b4
address review comments and add copyright dates
noerog Apr 14, 2020
e21e335
remove try/except blocks, only retries/exponential backoff in tests
noerog Apr 15, 2020
04e31b9
fix lint
noerog Apr 15, 2020
2d81c2b
remove try block from the sample
Apr 15, 2020
3fe8685
Merge branch 'master' into chc-api-v1
Apr 15, 2020
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
153 changes: 153 additions & 0 deletions healthcare/api-client/v1/datasets/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
.. 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/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.
- 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
-------------------------------------------------------------------------------

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




To run this sample:

.. code-block:: bash

$ python datasets.py

usage: datasets.py [-h] [--project_id PROJECT_ID]
[--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]
{create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,get_iam_policy,set_iam_policy,deidentify-dataset}
...

positional arguments:
{create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,get_iam_policy,set_iam_policy,deidentify-dataset}
create-dataset Creates a dataset.
delete-dataset Deletes a dataset.
get-dataset Gets any metadata associated with a dataset.
list-datasets Lists the datasets in the project.
patch-dataset Updates dataset metadata.
get_iam_policy Gets the IAM policy for the specified dataset.
set_iam_policy Sets the IAM policy for the specified dataset. 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'
deidentify-dataset Creates a new dataset containing de-identified data
from the source dataset.

optional arguments:
-h, --help show this help message and exit
--project_id PROJECT_ID
GCP project name
--cloud_region CLOUD_REGION
GCP cloud region
--dataset_id DATASET_ID
Name of dataset
--time_zone TIME_ZONE
The default timezone used by a dataset
--destination_dataset_id DESTINATION_DATASET_ID
The name of the new dataset where the de-identified
data will be written
--keeplist_tags KEEPLIST_TAGS
The data to keeplist, for example "PatientID" or
"StudyInstanceUID"
--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")





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/
28 changes: 28 additions & 0 deletions healthcare/api-client/v1/datasets/README.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: Datasets
file: datasets.py
show_help: True

cloud_client_library: true

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