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. Accede a tu Cuenta de Google.

    Si todavía no tienes una cuenta, regístrate para obtener una nueva.

  2. En GCP Console, ve a la página Administrar recursos y selecciona o crea un proyecto.

    Ir a la página Administrar recursos

  3. Comprueba que la facturación esté habilitada en tu proyecto.

    Descubre cómo puedes habilitar la facturación

  4. Habilita las Cloud Healthcare API necesarias.

    Habilita las 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 Console and then click the Activate Cloud Shell button at the top of the console window.

      Go to Google Cloud 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. 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 beta 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, us-west2, europe-west2, europe-west4, northamerica-northeast1, asia-northeast1, asia-southeast1 or us. To use the default region for the project, omit the --location option.

The following sample shows how to create a dataset.

gcloud beta 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 beta healthcare datasets describe command.

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

gcloud beta 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

Edit a dataset

To update a dataset, run the gcloud beta 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 beta 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 Google Cloud account for the resources used in this tutorial, you can clean up the resources you created on Google Cloud.

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. En la GCP Console, dirígete a la página Proyectos.

    Ir a la página Proyectos

  2. En la lista de proyectos, selecciona el proyecto que deseas borrar y haz clic en Borrar.
  3. En el cuadro de diálogo, escribe el ID del proyecto y, luego, haz clic en Cerrar para borrar el proyecto.

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 beta healthcare datasets delete command:

  1. Run the gcloud beta healthcare datasets delete command.

    gcloud beta 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

¿Te ha resultado útil esta página? Enviar comentarios:

Enviar comentarios sobre...

Cloud Healthcare API