From the Service account list, select
New service account.
In the Service account name field, enter a name.
From the Role list, select
Project > Owner.
Click Create. A JSON file that contains your key
downloads to your computer.
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your service account key.
This variable only applies to your current shell session, so if you open
a new session, set the variable again.
Example: Linux or macOS
Replace [PATH] with the path of the JSON file that
contains your service account key.
Tip: Need a command prompt? You can use the
Google Cloud
Shell. The Google Cloud Shell is a command line environment that
already includes the Google Cloud SDK, so you
don't need to install it.
(The Google Cloud SDK also comes preinstalled on Google Compute Engine
Virtual Machines.)
Create a dataset
Datasets are the basic containers that hold healthcare data in Google Cloud.
curl
To create a dataset, make a POST request, providing the name of the
dataset and an access token. The following sample shows a POST request
using curl.
When setting the LOCATION variable, use
us-central1, us-west2, europe-west2,
europe-west4, europe-west6, northamerica-northeast1,
southamerica-east1, asia-east2, asia-northeast1,
asia-southeast1, australia-southeast1, or us.
If the request is successful, the server returns the response in JSON format. The response contains an identifier for a
long-running operation.
Long-running operations are returned when method calls might take a substantial
amount of time to complete.
If the request is successful, the server returns a response with the status of the operation in JSON format. You can tell
that the operation finished when the response contains "done": true.
To create a dataset, make a POST request, providing the name of the dataset
and an access token. The following sample shows a POST request
using Windows PowerShell.
When setting the LOCATION variable, use
us-central1, us-west2, europe-west2,
europe-west4, europe-west6, northamerica-northeast1,
southamerica-east1, asia-east2, asia-northeast1,
asia-southeast1, australia-southeast1, or us.
If the request is successful, the server returns the response in JSON format. The response contains an identifier for a
long-running operation.
Long-running operations are returned when method calls might take a substantial
amount of time to complete.
If the request is successful, the server returns a response with the status of
the operation in JSON format. You can tell
that the operation finished when the response contains "done": true.
You can view details about the dataset and verify that it was created.
curl
To get details about a dataset, make a GET request and provide the name of
the dataset and an access token. The following sample shows a GET
request using curl.
To get details about a dataset, make a GET request and provide the name of
the dataset and an access token. The following sample shows a GET
request using curl.
To create a DICOM store, make a POST request. Provide the following information in
the request:
The name of the parent dataset
A name for the DICOM store
An access token
The DICOM store name must be unique in the DICOM
store's parent dataset. The name can be any Unicode string of 1 to 256 characters consisting of
numbers, letters, underscores, dashes, and periods.
You can optionally configure an existing Pub/Sub topic to which the
Cloud Healthcare API sends notifications of DICOM store changes.
When specifying a Pub/Sub topic, enter the qualified URI to the topic, as shown in the
following sample:
projects/PROJECT_ID/topics/PUBSUB_TOPIC
The following sample shows a POST request using curl.
To create a DICOM store, make a POST request. Provide the following information in
the request:
the name of the parent dataset
the name of the DICOM store
An access token
The DICOM store name must be unique in the DICOM
store's parent dataset. The name can be any Unicode string of 1 to 256 characters consisting of
numbers, letters, underscores, dashes, and periods.
You can optionally configure an existing Pub/Sub topic to which the
Cloud Healthcare API sends notifications of DICOM store changes.
When specifying a Pub/Sub topic, enter the qualified URI to the topic, as shown in the
following sample:
projects/PROJECT_ID/topics/PUBSUB_TOPIC
The following sample shows a POST request using Windows PowerShell.
To create a FHIR store, make a POST request. Provide the following information in
the request:
The name of the parent dataset
A name for the FHIR store
The FHIR version of the FHIR store: DSTU2, STU3, or R4
An access token
The FHIR store name must be unique in the FHIR
store's parent dataset. The name can be any Unicode string of 1 to 256 characters consisting of
numbers, letters, underscores, dashes, and periods.
You can optionally configure an existing Pub/Sub topic to which the
Cloud Healthcare API sends notifications of FHIR store changes.
When specifying a Pub/Sub topic, enter the qualified URI to the topic, as shown in the
following sample:
projects/PROJECT_ID/topics/PUBSUB_TOPIC
The following sample shows a POST request using curl.
To create a FHIR store, make a POST request. Provide the following information in
the request:
The name of the parent dataset
A name for the FHIR store
The FHIR version of the FHIR store: DSTU2, STU3, or R4
An access token
The FHIR store name must be unique in the FHIR
store's parent dataset. The name can be any Unicode string of 1 to 256 characters consisting of
numbers, letters, underscores, dashes, and periods.
You can optionally configure an existing Pub/Sub topic to which the
Cloud Healthcare API sends notifications of FHIR store changes.
When specifying a Pub/Sub topic, enter the qualified URI to the topic, as shown in the
following sample:
projects/PROJECT_ID/topics/PUBSUB_TOPIC
The following sample shows a POST request using Windows PowerShell.
To create an HL7v2 store, make a POST request. Provide the following information in
the request:
The name of the parent dataset
A name for the HL7v2 store
An access token
The HL7v2 store name must be unique in the HL7v2
store's parent dataset. The name can be any Unicode string of 1 to 256 characters consisting of
numbers, letters, underscores, dashes, and periods.
You can optionally configure one ore more existing Pub/Sub topics
and a filter for the topic to which the
Cloud Healthcare API sends notifications of HL7v2 store changes.
When specifying a Pub/Sub topic, enter the qualified URI to the topic, as shown in the
following sample:
projects/PROJECT_ID/topics/PUBSUB_TOPIC
The following sample shows a POST request using curl.
To create an HL7v2 store, make a POST request. Provide the following information in
the request:
The name of the parent dataset
A name for the HL7v2 store
An access token
The HL7v2 store name must be unique in the HL7v2
store's parent dataset. The name can be any Unicode string of 1 to 256 characters consisting of
numbers, letters, underscores, dashes, and periods.
You can optionally configure one or more existing Pub/Sub topics and
a filter for the topic to which the
Cloud Healthcare API sends notifications of HL7v2 store changes.
When specifying a Pub/Sub topic, enter the qualified URI to the topic, as shown in the
following sample:
projects/PROJECT_ID/topics/PUBSUB_TOPIC
The following sample shows a POST request using Windows PowerShell.
The following samples show how to update the Pub/Sub topic, filter, and labels for the
HL7v2 store.
curl
To edit an HL7v2 store, make a PATCH request. Provide the following
information in the request:
The name of the parent dataset
The name of the HL7v2 store
The metadata to update. In this sample, the qualified URI to the Pub/Sub topic, the
topic filter, and
the labels to update as a comma-delimited list of key-value pairs.
An update mask
An access token
The following sample shows a PATCH request using curl.
To edit an HL7v2 store, make a PATCH request. Provide the following
information in the request:
The name of the parent dataset
The name of the HL7v2 store
The metadata to update. In this example, the qualified URI to the Pub/Sub topic, the
topic filter, and
the labels to update as a comma-delimited list of key-value pairs.
An update mask
An access token
The following sample shows a PATCH request using Windows PowerShell.
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
In the Cloud Console, go to the Manage resources page.
In the project list, select the project that you
want to delete, and then click Delete.
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.
curl
To delete a dataset, make a DELETE request, providing the name
of the dataset and an access token. The following sample shows
a DELETE request using curl.
If the request is successful, the server returns
the response in JSON format:
{}
PowerShell
To delete a dataset, make a DELETE request, providing the name
of the dataset and an access token. The following sample shows
a DELETE request using Windows PowerShell.