Cloud Pub/Sub notifications

This page provides an overview of using Pub/Sub to receive notifications when clinical events occur in a Cloud Healthcare API data store. To learn how to set up and use Pub/Sub messages, see Configuring Cloud Pub/Sub notifications.

Overview

You can receive notifications using Pub/Sub when any of the following clinical events occur:

  • A DICOM instance is stored in a DICOM store
  • A FHIR resource is created, updated, or deleted in a FHIR store
  • An HL7v2 message is ingested or created in an HL7v2 store

Information about each event is added to the corresponding data store's Pub/Sub topic in the form of a message.

You can publish messages to any Pub/Sub topic in any project for which you have sufficient permissions. After the Pub/Sub topic receives the message, the message will be forwarded to any number of subscribers to the topic.

Notification format

Notifications sent to a Pub/Sub topic consist of two parts:

  • Attributes: A set of key:value pairs describing the event.
  • Data: A string that contains an identifier for the relevant FHIR resource, DICOM instance, or HL7v2 message.

DICOM instance data

When a DICOM instance is stored in a DICOM store, the following identifier is always included in the data field of the Pub/Sub message:

projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/dicomStores/DICOM_STORE_ID/dicomWeb/studies/STUDY_UID/series/SERIES_UID/instances/INSTANCE_UID

Notifications for a stored DICOM instance do not contain any attribute values.

FHIR resource data and attributes

Changes to FHIR resources always contain the following identifier in the data field of the Pub/Sub message:

projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/resources/RESOURCE_TYPE/RESOURCE_ID

The following set of key:value pairs is always included in the message's attributes field:

Attribute name Possible values Example Description
action
  • CreateResource
  • UpdateResource
  • DeleteResource
CreateResource The type of event that just occurred.
resourceType Any FHIR resource type. Patient The type of resource that was modified.

HL7v2 message data and attributes

When an HL7v2 message is created or ingested into an HL7v2 store, the following identifier is always included in the data field of the Pub/Sub message:

projects/PROJECT_ID/locations/us-central1/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID/messages/HL7V2_MESSAGE_ID

The following set of key:value pairs is always included in the Pub/Sub message's attributes field:

Attribute name Possible values Example Description
msgType Any HL7v2 message type. ADT The type of HL7v2 message that was created or ingested.

What's next

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

Send feedback about...

Cloud Healthcare API