Skip to content

Add CHC API alpha datasets and FHIR samples and tests. #1783

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 12 commits into from
Oct 30, 2018
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
154 changes: 154 additions & 0 deletions healthcare/api-client/datasets/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
.. 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

Authentication
++++++++++++++

Authentication for this service is done via an `API Key`_. To obtain an API
Key:

1. Open the `Cloud Platform Console`_
2. Make sure that billing is enabled for your project.
3. From the **Credentials** page, create a new **API Key** or use an existing
one for your project.

.. _API Key:
https://developers.google.com/api-client-library/python/guide/aaa_apikeys
.. _Cloud Console: https://console.cloud.google.com/project?_

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] --service_account_json SERVICE_ACCOUNT_JSON --api_key
API_KEY --project_id PROJECT_ID --cloud_region CLOUD_REGION
--dataset_id DATASET_ID [--time_zone TIME_ZONE]
[--destination_dataset_id DESTINATION_DATASET_ID]
[--whitelist_tags WHITELIST_TAGS]
{create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,deidentify-dataset}
...

positional arguments:
{create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,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.
deidentify-dataset Creates a new dataset containing de-identified data
from the source dataset.

optional arguments:
-h, --help show this help message and exit
--service_account_json SERVICE_ACCOUNT_JSON
Path to service account JSON file.
--api_key API_KEY Your API key.
--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
--whitelist_tags WHITELIST_TAGS
The data to whitelist, for example "PatientID" or
"StudyInstanceUID"





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/
29 changes: 29 additions & 0 deletions healthcare/api-client/datasets/README.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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
- auth_api_key
- install_deps

samples:
- name: Datasets
file: datasets.py
show_help: True

cloud_client_library: true

folder: healthcare/api-client/datasets
Loading