Quickstart using the gcloud command-line tool

This page shows you how to use the gcloud tool to create, update, and view details about a dataset and create FHIR, HL7v2, or DICOM stores. It also provides steps to clean up the resources you created.

Before you begin

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the GCP Console, on the project selector page, select or create a GCP project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Google Cloud Platform project.

    Learn how to enable billing

  4. Enable the Cloud Healthcare API.

    Enable the API

  5. Based on how you are using the gcloud command-line tool, complete one of the following steps:
    • If you are using Google Cloud Shell, go to Google Cloud Platform Console and then click the Activate Cloud Shell button at the top of the console window.

      Go to Google Cloud Platform Console

      A Google Cloud Shell session opens inside a new frame at the bottom of the console and displays a command-line prompt. It can take a few seconds for the shell session to initialize.

    • If you are using a Compute Engine virtual machine, open the virtual machine's terminal window.
    • If you are using the gcloud tool on your machine, install and initialize Cloud SDK.

Create a dataset

Datasets are the basic containers that hold healthcare data in Google Cloud Platform. To use Cloud Healthcare API, you must create at least one dataset.

Tip: You can edit placeholder values in requests, denoted by the VARIABLES syntax, in this page and then copy the entire command.

To create a dataset, run the gcloud alpha healthcare datasets create command.

  • The DATASET_ID must be unique within the region. It can be any Unicode string of 1 to 256 characters consisting of numbers, letters, underscores, dashes, and periods.
  • The region can be us-central1, europe-west2, europe-west4, northamerica-northeast1, or us. To use the default region for the project, omit the --location option.

The following sample shows how to create a dataset.

gcloud alpha healthcare datasets create DATASET_ID \
    --location=REGION

If the request is successful, the command prompt displays:

Created dataset [DATASET_ID]

Get dataset details

You can view details about the dataset and verify that it was created.

To get details about a dataset, run the gcloud alpha healthcare datasets describe command.

The following sample shows how to get details about a dataset.

gcloud alpha healthcare datasets describe DATASET_ID \
    --location=REGION

If the request is successful, the command prompt displays the dataset details:

name: projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID
timeZone: TIME_ZONE

Edit a dataset

To update a dataset, run the gcloud alpha healthcare datasets update command.

The following sample shows how to update the timezone of a dataset. For example, you can set the time zone to "Canada/Eastern".

gcloud alpha healthcare datasets update DATASET_ID \
    --location=REGION \
    --time-zone=TIME_ZONE

If the request is successful, the command prompt displays the operation and dataset details:

Updated dataset [DATASET_ID].
name: projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID
timeZone: TIME_ZONE

Creating and managing DICOM, HL7v2, and FHIR stores

To complete this quickstart, expand the relevant section:

Clean up

To avoid incurring charges to your GCP account for the resources used in this tutorial, you can clean up the resources you created on GCP.

If you created a new project for this tutorial, follow the steps in Delete the project. Otherwise, follow the steps in Delete the dataset.

Delete the project

  1. In the GCP Console, go to the Projects page.

    Go to the Projects page

  2. In the project list, select the project you want to delete and click Delete .
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

Delete the dataset

If you no longer need the dataset created in this quickstart, you can delete it. Deleting a dataset permanently deletes the dataset and any FHIR, HL7v2, or DICOM stores it contains.

To delete a dataset, run the gcloud alpha healthcare datasets delete command:

  1. Run the gcloud alpha healthcare datasets delete command.

    gcloud alpha healthcare datasets delete DATASET_ID --location=REGION
    
  2. To confirm, type Y.

If the request is successful, the command prompt displays:

Deleted dataset [DATASET_ID]

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Healthcare API