|
| 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 | +Authentication |
| 35 | +++++++++++++++ |
| 36 | + |
| 37 | +Authentication for this service is done via an `API Key`_. To obtain an API |
| 38 | +Key: |
| 39 | + |
| 40 | +1. Open the `Cloud Platform Console`_ |
| 41 | +2. Make sure that billing is enabled for your project. |
| 42 | +3. From the **Credentials** page, create a new **API Key** or use an existing |
| 43 | + one for your project. |
| 44 | + |
| 45 | +.. _API Key: |
| 46 | + https://developers.google.com/api-client-library/python/guide/aaa_apikeys |
| 47 | +.. _Cloud Console: https://console.cloud.google.com/project?_ |
| 48 | + |
| 49 | +Install Dependencies |
| 50 | +++++++++++++++++++++ |
| 51 | + |
| 52 | +#. Clone python-docs-samples and change directory to the sample directory you want to use. |
| 53 | + |
| 54 | + .. code-block:: bash |
| 55 | +
|
| 56 | + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git |
| 57 | +
|
| 58 | +#. 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. |
| 59 | + |
| 60 | + .. _Python Development Environment Setup Guide: |
| 61 | + https://cloud.google.com/python/setup |
| 62 | + |
| 63 | +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. |
| 64 | + |
| 65 | + .. code-block:: bash |
| 66 | +
|
| 67 | + $ virtualenv env |
| 68 | + $ source env/bin/activate |
| 69 | +
|
| 70 | +#. Install the dependencies needed to run the samples. |
| 71 | + |
| 72 | + .. code-block:: bash |
| 73 | +
|
| 74 | + $ pip install -r requirements.txt |
| 75 | +
|
| 76 | +.. _pip: https://pip.pypa.io/ |
| 77 | +.. _virtualenv: https://virtualenv.pypa.io/ |
| 78 | + |
| 79 | +Samples |
| 80 | +------------------------------------------------------------------------------- |
| 81 | + |
| 82 | +Datasets |
| 83 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 84 | + |
| 85 | +.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
| 86 | + :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 |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +To run this sample: |
| 92 | + |
| 93 | +.. code-block:: bash |
| 94 | +
|
| 95 | + $ python datasets.py |
| 96 | +
|
| 97 | + usage: datasets.py [-h] --service_account_json SERVICE_ACCOUNT_JSON --api_key |
| 98 | + API_KEY --project_id PROJECT_ID --cloud_region CLOUD_REGION |
| 99 | + --dataset_id DATASET_ID [--time_zone TIME_ZONE] |
| 100 | + [--destination_dataset_id DESTINATION_DATASET_ID] |
| 101 | + [--whitelist_tags WHITELIST_TAGS] |
| 102 | + {create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,deidentify-dataset} |
| 103 | + ... |
| 104 | +
|
| 105 | + positional arguments: |
| 106 | + {create-dataset,delete-dataset,get-dataset,list-datasets,patch-dataset,deidentify-dataset} |
| 107 | + create-dataset Creates a dataset. |
| 108 | + delete-dataset Deletes a dataset. |
| 109 | + get-dataset Gets any metadata associated with a dataset. |
| 110 | + list-datasets Lists the datasets in the project. |
| 111 | + patch-dataset Updates dataset metadata. |
| 112 | + deidentify-dataset Creates a new dataset containing de-identified data |
| 113 | + from the source dataset. |
| 114 | +
|
| 115 | + optional arguments: |
| 116 | + -h, --help show this help message and exit |
| 117 | + --service_account_json SERVICE_ACCOUNT_JSON |
| 118 | + Path to service account JSON file. |
| 119 | + --api_key API_KEY Your API key. |
| 120 | + --project_id PROJECT_ID |
| 121 | + GCP project name |
| 122 | + --cloud_region CLOUD_REGION |
| 123 | + GCP cloud region |
| 124 | + --dataset_id DATASET_ID |
| 125 | + Name of dataset |
| 126 | + --time_zone TIME_ZONE |
| 127 | + The default timezone used by a dataset |
| 128 | + --destination_dataset_id DESTINATION_DATASET_ID |
| 129 | + The name of the new dataset where the de-identified |
| 130 | + data will be written |
| 131 | + --whitelist_tags WHITELIST_TAGS |
| 132 | + The data to whitelist, for example "PatientID" or |
| 133 | + "StudyInstanceUID" |
| 134 | +
|
| 135 | +
|
| 136 | +
|
| 137 | +
|
| 138 | +
|
| 139 | +The client library |
| 140 | +------------------------------------------------------------------------------- |
| 141 | + |
| 142 | +This sample uses the `Google Cloud Client Library for Python`_. |
| 143 | +You can read the documentation for more details on API usage and use GitHub |
| 144 | +to `browse the source`_ and `report issues`_. |
| 145 | + |
| 146 | +.. _Google Cloud Client Library for Python: |
| 147 | + https://googlecloudplatform.github.io/google-cloud-python/ |
| 148 | +.. _browse the source: |
| 149 | + https://github.com/GoogleCloudPlatform/google-cloud-python |
| 150 | +.. _report issues: |
| 151 | + https://github.com/GoogleCloudPlatform/google-cloud-python/issues |
| 152 | + |
| 153 | + |
| 154 | +.. _Google Cloud SDK: https://cloud.google.com/sdk/ |
0 commit comments