Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.rst

Cloud Healthcare API Python Samples

https://gstatic.com/cloudssh/images/open-btn.png

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.

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.

Install Dependencies

  1. Clone python-docs-samples and change directory to the sample directory you want to use.

    $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
  2. 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.

  3. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

    $ virtualenv env
    $ source env/bin/activate
  4. Install the dependencies needed to run the samples.

    $ pip install -r requirements.txt

Samples

Datasets

https://gstatic.com/cloudssh/images/open-btn.png

To run this sample:

$ python datasets.py

usage: datasets.py [-h] [--service_account_json SERVICE_ACCOUNT_JSON]
                   [--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:somebody@example.com' - group:email, as in
                        'group:admins@example.com' - domain:domainname, as in
                        'domain:example.com' - serviceAccount:email, as in
                        'serviceAccount:my-other-
                        app@appspot.gserviceaccount.com' 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
  --service_account_json SERVICE_ACCOUNT_JSON
                        Path to service account JSON file.
  --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.