Events message structure

In this article, you'll learn about the Events message structure, required and non-required elements, and you'll be provided with samples of Events message payloads.

Important

Events currently supports only the following operations:

  • FhirResourceCreated - The event emitted after a FHIR resource gets created successfully.

  • FhirResourceUpdated - The event emitted after a FHIR resource gets updated successfully.

  • FhirResourceDeleted - The event emitted after a FHIR resource gets soft deleted successfully.

  • DicomImageCreated - The event emitted after a DICOM image gets created successfully.

  • DicomImageDeleted - The event emitted after a DICOM image gets deleted successfully.

For more information about the FHIR service delete types, see FHIR REST API capabilities for Azure Health Data Services FHIR service

FHIR events message structure

Name Type Required Description
topic string Yes The topic is the Azure Resource ID of your Azure Health Data Services workspace.
subject string Yes The Uniform Resource Identifier (URI) of the FHIR resource that was changed. Customer can access the resource with the subject with https:// scheme. Customer should use the dataVersion or data.resourceVersionId to visit specific data version regarding this event.
eventType string(enum) Yes The type of change on the FHIR resource.
eventTime string(datetime) Yes The UTC time when the FHIR resource change committed.
id string Yes Unique identifier for the event.
data object Yes FHIR resource change event details.
data.resourceType string(enum) Yes The FHIR Resource Type.
data.resourceFhirAccount string Yes The service name of FHIR account in the Azure Health Data Services workspace.
data.resourceFhirId string Yes The resource ID of the FHIR account. Note that this ID is randomly generated by the FHIR service of the Azure Health Data Services when a customer creates the Resource. Customer can also use customized ID in FHIR resource creation; however the ID should not include or infer any PHI/PII information. It should be a system metadata, not specific to any personal data content.
data.resourceVersionId string(number) Yes The data version of the FHIR resource.
dataVersion string No Same as “data.resourceVersionId”.
metadataVersion string No The schema version of the event metadata. This is defined by Azure Event Grid and should be constant most of the time.

FHIR events message samples

FhirResourceCreated event

{
  "id": "e4c7f556-d72c-e7f7-1069-1e82ac76ab41",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}",
  "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e0a1f743-1a70-451f-830e-e96477163902",
  "data": {
    "resourceType": "Patient",
    "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com",
    "resourceFhirId": "e0a1f743-1a70-451f-830e-e96477163902",
    "resourceVersionId": 1
  },
  "eventType": "Microsoft.HealthcareApis.FhirResourceCreated",
  "dataVersion": "1",
  "metadataVersion": "1",
  "eventTime": "2021-09-08T01:14:04.5613214Z"
}

FhirResourceUpdated event

{
  "id": "634bd421-8467-f23c-b8cb-f6a31e41c32a",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}",
  "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e0a1f743-1a70-451f-830e-e96477163902",
  "data": {
    "resourceType": "Patient",
    "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com",
    "resourceFhirId": "e0a1f743-1a70-451f-830e-e96477163902",
    "resourceVersionId": 2
  },
  "eventType": "Microsoft.HealthcareApis.FhirResourceUpdated",
  "dataVersion": "2",
  "metadataVersion": "1",
  "eventTime": "2021-09-08T01:29:12.0618739Z"
}

FhirResourceDeleted event

{
  "id": "ef289b93-3159-b833-3a44-dc6b86ed1a8a",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}",
  "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e0a1f743-1a70-451f-830e-e96477163902",
  "data": {
    "resourceType": "Patient",
    "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com",
    "resourceFhirId": "e0a1f743-1a70-451f-830e-e96477163902",
    "resourceVersionId": 3
  },
  "eventType": "Microsoft.HealthcareApis.FhirResourceDeleted",
  "dataVersion": "3",
  "metadataVersion": "1",
  "eventTime": "2021-09-08T01:31:58.5175837Z"
}

DICOM events message structure

Name Type Required Description
topic string Yes The topic is the Azure Resource ID of your Azure Health Data Services workspace.
subject string Yes The Uniform Resource Identifier (URI) of the DICOM image that was changed. Customer can access the image with the subject with https:// scheme. Customer should use the dataVersion or data.resourceVersionId to visit specific data version regarding this event.
eventType string(enum) Yes The type of change on the DICOM image.
eventTime string(datetime) Yes The UTC time when the DICOM image change was committed.
id string Yes Unique identifier for the event.
data object Yes DICOM image change event details.
data.imageStudyInstanceUid string Yes The image's Study Instance UID.
data.imageSeriesInstanceUid string Yes The image's Series Instance UID.
data.imageSopInstanceUid string Yes The image's SOP Instance UID.
data.serviceHostName string Yes The hostname of the dicom service where the change occurred.
data.sequenceNumber int Yes The sequence number of the change in the DICOM service. Every image creation and deletion will have a unique sequence within the service. This number correlates to the sequence number of the DICOM service's Change Feed. Querying the DICOM Service Change Feed with this sequence number will give you the change that created this event.
dataVersion string No The data version of the DICOM image.
metadataVersion string No The schema version of the event metadata. This is defined by Azure Event Grid and should be constant most of the time.

DICOM events message samples

DicomImageCreated

{
  "id": "d621839d-958b-4142-a638-bb966b4f7dfd",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}",
  "subject": "{dicom-account}.dicom.azurehealthcareapis.com/v1/studies/1.2.3.4.3/series/1.2.3.4.3.9423673/instances/1.3.6.1.4.1.45096.2.296485376.2210.1633373143.864442",
  "data": {
    "imageStudyInstanceUid": "1.2.3.4.3",
    "imageSeriesInstanceUid": "1.2.3.4.3.9423673",
    "imageSopInstanceUid": "1.3.6.1.4.1.45096.2.296485376.2210.1633373143.864442",
    "serviceHostName": "{dicom-account}.dicom.azurehealthcareapis.com",
    "sequenceNumber": 1
  },
  "eventType": "Microsoft.HealthcareApis.DicomImageCreated",
  "dataVersion": "1",
  "metadataVersion": "1",
  "eventTime": "2022-09-15T01:14:04.5613214Z"
}

DicomImageDeleted

{
  "id": "eac1c1a0-ffa8-4b28-97cc-1d8b9a0a6021",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}",
  "subject": "{dicom-account}.dicom.azurehealthcareapis.com/v1/studies/1.2.3.4.3/series/1.2.3.4.3.9423673/instances/1.3.6.1.4.1.45096.2.296485376.2210.1633373143.864442",
  "data": {
    "imageStudyInstanceUid": "1.2.3.4.3",
    "imageSeriesInstanceUid": "1.2.3.4.3.9423673",
    "imageSopInstanceUid": "1.3.6.1.4.1.45096.2.296485376.2210.1633373143.864442",
    "serviceHostName": "{dicom-account}.dicom.azurehealthcareapis.com",
    "sequenceNumber": 2
  },
  "eventType": "Microsoft.HealthcareApis.DicomImageDeleted",
  "dataVersion": "1",
  "metadataVersion": "1",
  "eventTime": "2022-09-15T01:16:07.5692209Z"
}

Next steps

For more information about deploying Events, see

FHIR® is a registered trademark of Health Level Seven International, registered in the U.S. Trademark Office and is used with their permission.