|
| 1 | +--- |
| 2 | +title: Azure Health Data Services as Event Grid source |
| 3 | +description: Describes the properties that are provided for Azure Health Data Services events with Azure Event Grid |
| 4 | +ms.topic: conceptual |
| 5 | +ms.date: 02/03/2022 |
| 6 | +--- |
| 7 | + |
| 8 | +# Azure Health Data Services as an Event Grid source |
| 9 | + |
| 10 | +This article provides the properties and schema for Azure Health Data Services events. For an introduction to event schemas, see [Azure Event Grid event schema](event-schema.md). |
| 11 | + |
| 12 | +## Available event types |
| 13 | + |
| 14 | +### List of events for Azure Health Data Services REST APIs |
| 15 | + |
| 16 | +The following Fast Healthcare Interoperability Resources (FHIR®) resource events are triggered when calling the REST APIs. |
| 17 | + |
| 18 | + |Event name|Description| |
| 19 | + |----------|-----------| |
| 20 | + |**FhirResourceCreated** |The event emitted after a FHIR resource gets created successfully.| |
| 21 | + |**FhirResourceUpdated** |The event emitted after a FHIR resource gets updated successfully.| |
| 22 | + |**FhirResourceDeleted** |The event emitted after a FHIR resource gets soft deleted successfully.| |
| 23 | + |
| 24 | +## Example event |
| 25 | +This section contains examples of what events message data would look like for each FHIR resource event. |
| 26 | + |
| 27 | +> [!Note] |
| 28 | +> Events data looks similar to these examples with the `metadataVersion` property set to a value of `1`. |
| 29 | +> |
| 30 | +> For more information, see [Azure Event Grid event schema properties](/azure/event-grid/event-schema#event-properties). |
| 31 | +
|
| 32 | +### FhirResourceCreated event |
| 33 | + |
| 34 | +# [Event Grid event schema](#tab/event-grid-event-schema) |
| 35 | + |
| 36 | +```json |
| 37 | +{ |
| 38 | + "id": "e4c7f556-d72c-e7f7-1069-1e82ac76ab41", |
| 39 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}", |
| 40 | + "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e0a1f743-1a70-451f-830e-e96477163902", |
| 41 | + "data": { |
| 42 | + "resourceType": "Patient", |
| 43 | + "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com", |
| 44 | + "resourceFhirId": "e0a1f743-1a70-451f-830e-e96477163902", |
| 45 | + "resourceVersionId": 1 |
| 46 | + }, |
| 47 | + "eventType": "Microsoft.HealthcareApis.FhirResourceCreated", |
| 48 | + "dataVersion": "1", |
| 49 | + "metadataVersion": "1", |
| 50 | + "eventTime": "2021-09-08T01:14:04.5613214Z" |
| 51 | +} |
| 52 | +``` |
| 53 | +# [CloudEvent schema](#tab/cloud-event-schema) |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "id": "d674b9b7-7d1c-9b0a-8c48-139f3eb86c48", |
| 58 | + "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}", |
| 59 | + "specversion": "1.0", |
| 60 | + "type": "Microsoft.HealthcareApis.FhirResourceCreated", |
| 61 | + "dataschema": "#1", |
| 62 | + "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e87ef649-abe1-485c-8c09-549d85dfe30b", |
| 63 | + "time": "2022-02-03T16:48:09.6223354Z", |
| 64 | + "data": { |
| 65 | + "resourceType": "Patient", |
| 66 | + "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com", |
| 67 | + "resourceFhirId": "e87ef649-abe1-485c-8c09-549d85dfe30b", |
| 68 | + "resourceVersionId": 1 |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | +--- |
| 73 | + |
| 74 | +### FhirResourceUpdated event |
| 75 | + |
| 76 | +# [Event Grid event schema](#tab/event-grid-event-schema) |
| 77 | + |
| 78 | +```json |
| 79 | +{ |
| 80 | + "id": "634bd421-8467-f23c-b8cb-f6a31e41c32a", |
| 81 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}", |
| 82 | + "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e0a1f743-1a70-451f-830e-e96477163902", |
| 83 | + "data": { |
| 84 | + "resourceType": "Patient", |
| 85 | + "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com", |
| 86 | + "resourceFhirId": "e0a1f743-1a70-451f-830e-e96477163902", |
| 87 | + "resourceVersionId": 2 |
| 88 | + }, |
| 89 | + "eventType": "Microsoft.HealthcareApis.FhirResourceUpdated", |
| 90 | + "dataVersion": "2", |
| 91 | + "metadataVersion": "1", |
| 92 | + "eventTime": "2021-09-08T01:29:12.0618739Z" |
| 93 | +} |
| 94 | +``` |
| 95 | +# [CloudEvent schema](#tab/cloud-event-schema) |
| 96 | + |
| 97 | +```json |
| 98 | +{ |
| 99 | + "id": "5e45229e-c663-ea98-72d2-833428f48ad0", |
| 100 | + "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}", |
| 101 | + "specversion": "1.0", |
| 102 | + "type": "Microsoft.HealthcareApis.FhirResourceUpdated", |
| 103 | + "dataschema": "#2", |
| 104 | + "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e87ef649-abe1-485c-8c09-549d85dfe30b", |
| 105 | + "time": "2022-02-03T16:48:33.5147352Z", |
| 106 | + "data": { |
| 107 | + "resourceType": "Patient", |
| 108 | + "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com", |
| 109 | + "resourceFhirId": "e87ef649-abe1-485c-8c09-549d85dfe30b", |
| 110 | + "resourceVersionId": 2 |
| 111 | + } |
| 112 | +} |
| 113 | +``` |
| 114 | +--- |
| 115 | + |
| 116 | +### FhirResourceDeleted event |
| 117 | + |
| 118 | +# [Event Grid event schema](#tab/event-grid-event-schema) |
| 119 | + |
| 120 | +```json |
| 121 | +{ |
| 122 | + "id": "ef289b93-3159-b833-3a44-dc6b86ed1a8a", |
| 123 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}", |
| 124 | + "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e0a1f743-1a70-451f-830e-e96477163902", |
| 125 | + "data": { |
| 126 | + "resourceType": "Patient", |
| 127 | + "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com", |
| 128 | + "resourceFhirId": "e0a1f743-1a70-451f-830e-e96477163902", |
| 129 | + "resourceVersionId": 3 |
| 130 | + }, |
| 131 | + "eventType": "Microsoft.HealthcareApis.FhirResourceDeleted", |
| 132 | + "dataVersion": "3", |
| 133 | + "metadataVersion": "1", |
| 134 | + "eventTime": "2021-09-08T01:31:58.5175837Z" |
| 135 | +} |
| 136 | +``` |
| 137 | +# [CloudEvent schema](#tab/cloud-event-schema) |
| 138 | + |
| 139 | +```json |
| 140 | +{ |
| 141 | + "id": "14648a6e-d978-950e-ee9c-f84c70dba8d3", |
| 142 | + "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.HealthcareApis/workspaces/{workspace-name}", |
| 143 | + "specversion": "1.0", |
| 144 | + "type": "Microsoft.HealthcareApis.FhirResourceDeleted", |
| 145 | + "dataschema": "#3", |
| 146 | + "subject": "{fhir-account}.fhir.azurehealthcareapis.com/Patient/e87ef649-abe1-485c-8c09-549d85dfe30b", |
| 147 | + "time": "2022-02-03T16:48:38.7338799Z", |
| 148 | + "data": { |
| 149 | + "resourceType": "Patient", |
| 150 | + "resourceFhirAccount": "{fhir-account}.fhir.azurehealthcareapis.com", |
| 151 | + "resourceFhirId": "e87ef649-abe1-485c-8c09-549d85dfe30b", |
| 152 | + "resourceVersionId": 3 |
| 153 | + } |
| 154 | +} |
| 155 | +``` |
| 156 | +--- |
| 157 | + |
| 158 | +## Next steps |
| 159 | + |
| 160 | +* For an introduction to Azure Event Grid, see [What is Event Grid?](overview.md) |
| 161 | +* For more information about creating an Azure Event Grid subscription, see [Event Grid subscription schema](subscription-creation-schema.md). |
| 162 | + |
| 163 | +(FHIR®) is a registered trademark of [HL7](https://hl7.org/fhir/) and is used with the permission of HL7. |
0 commit comments