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.
This sample requires you to have authentication setup. Refer to the Authentication Getting Started Guide for instructions on setting up credentials for applications.
Authentication for this service is done via an API Key. To obtain an API Key:
- Open the `Cloud Platform Console`_
- Make sure that billing is enabled for your project.
- From the Credentials page, create a new API Key or use an existing one for your project.
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
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.
Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
$ virtualenv env $ source env/bin/activateInstall the dependencies needed to run the samples.
$ pip install -r requirements.txt
To run this sample:
$ python fhir_stores.py
usage: fhir_stores.py [-h] [--service_account_json SERVICE_ACCOUNT_JSON]
[--api_key API_KEY] [--project_id PROJECT_ID]
[--cloud_region CLOUD_REGION] [--dataset_id DATASET_ID]
[--fhir_store_id FHIR_STORE_ID]
[--pubsub_topic PUBSUB_TOPIC]
{create-fhir-store,delete-fhir-store,get-fhir-store,list-fhir-stores,patch-fhir-store}
...
positional arguments:
{create-fhir-store,delete-fhir-store,get-fhir-store,list-fhir-stores,patch-fhir-store}
create-fhir-store Creates a new FHIR store within the parent dataset.
delete-fhir-store Deletes the specified FHIR store.
get-fhir-store Gets the specified FHIR store.
list-fhir-stores Lists the FHIR stores in the given dataset.
patch-fhir-store Updates the FHIR store.
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 cloud project name
--cloud_region CLOUD_REGION
GCP cloud region
--dataset_id DATASET_ID
Name of dataset
--fhir_store_id FHIR_STORE_ID
Name of FHIR store
--pubsub_topic PUBSUB_TOPIC
The Cloud Pub/Sub topic where notifications of changes
are published
To run this sample:
$ python fhir_resources.py
usage: fhir_resources.py [-h] [--service_account_json SERVICE_ACCOUNT_JSON]
[--base_url BASE_URL] [--project_id PROJECT_ID]
[--cloud_region CLOUD_REGION]
[--dataset_id DATASET_ID]
[--fhir_store_id FHIR_STORE_ID]
[--resource_type RESOURCE_TYPE]
[--resource_id RESOURCE_ID]
{create-resource,delete-resource,get-resource,update-resource,patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata}
...
positional arguments:
{create-resource,delete-resource,get-resource,update-resource,patch-resource,search-resources-get,search-resources-post,get-patient-everything,get-metadata}
create-resource Creates a new resource in a FHIR store.
delete-resource Creates a new resource in a FHIR store.
get-resource Gets a FHIR resource.
update-resource Updates an existing resource.
patch-resource Updates part of an existing resource..
search-resources-get
Searches resources in the given FHIR store using the
searchResources GET method.
search-resources-post
Searches resources in the given FHIR store using the
searchResources GET method.
get-patient-everything
Gets all the resources in the patient compartment.
get-metadata Gets the capabilities statement for a FHIR store.
optional arguments:
-h, --help show this help message and exit
--service_account_json SERVICE_ACCOUNT_JSON
Path to service account JSON file.
--base_url BASE_URL Healthcare API URL.
--project_id PROJECT_ID
GCP project name
--cloud_region CLOUD_REGION
GCP region
--dataset_id DATASET_ID
Name of dataset
--fhir_store_id FHIR_STORE_ID
Name of FHIR store
--resource_type RESOURCE_TYPE
The type of resource. First letter must be capitalized
--resource_id RESOURCE_ID
Name of a FHIR resourceThis 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.