Event Model

Event Model

This page describes the types of event messages that are published to destinations (topic/queue) on the message broker for the eHealth Infrastructure

The eHealth Infrastructure publishes numerous events as part of the business processes carried out on the Platform.

This page describes the types of event messages published to destinations (topic/queue) on the message broker for the eHealth Infrastructure. Each message consists of a JSON body and, additionally, some message properties.

Content

Structure of event messages


The JSON body contains the event details, while the message properties enable the use of message selectors when consuming messages from a destination.

For each message type is documented:

  • naming of destination (topic/queue)

  • JSON schema for the message body

  • Table of message selector properties

EHealthReferenceEvent

Messages of the EHealthReferenceEvent message type are issued when a resource element containing references is updated. Separate messages are issued for references added and references removed

Destination
topic: Topic is named: [FHIR profile of the resource].[name of resource element]

Message content

Properties
eventType: The type of event
messageType: The name of the message type
messageVersion: The version of the message type, eg, “1.0”
resourceElement: The reference resource element that has changed
resourceReference: The reference (absolute URL) of the resource for which the event message is issued
messageClass: The Java class path of the event message. For internal use (serialising/deserialising from/to Java objects)
patientReference: The reference (absolute URL) to the patient resource, if the resource, for which the event message is issued, is related to a patient
resourceProfile: The FHIR profile of the resource for which the event message is issued

{ "type" : "object", "id" : "urn:jsonschema:com:systematic:ehealth:event:event:EHealthReferenceEvent", "properties" : { "messageType" : { "type" : "string", "description" : "EHealthReferenceEvent" }, "messageVersion" : { "type" : "string", "description" : "1.0" }, "eventType" : { "type" : "string", "description" : "{ enum : [ reference_added, reference_removed ] }" }, "resourceReference" : { "type" : "string", "description" : "The reference (absolute URL) of the resource for which the event message is issued" }, "resourceVersion" : { "type" : "string", "description" : "The version of the resource after change" }, "resourceElement" : { "type" : "string", "description" : "The reference resource element that has changed" }, "references" : { "type" : "array", "description" : "The resource element references (absolute URLs) that were added or removed", "items" : { "type" : "string" } } } }


EHealthSimpleEvent

Messages of the EHealthSimpleEvent message type are issued when a resource is created, updated or deleted.

Destination
topic: Topic is named: [FHIR profile of the resource]

Message content

Properties
eventType: The type of event
messageType: The name of the message type
messageVersion: The version of the message type, eg, “1.0”
resourceReference: The reference (absolute URL) of the resource for which the event message is issued
messageClass: The Java class path of the event message. For internal use (serialising/deserialising from/to Java objects)
patientReference: The reference (absolute URL) to the patient resource, if the resource, for which the event message is issued, is related to a patient
resourceProfile: The FHIR profile of the resource for which the event message is issued

 

{ "type" : "object", "id" : "urn:jsonschema:com:systematic:ehealth:event:event:EHealthSimpleEvent", "properties" : { "messageType" : { "type" : "string", "description" : "EHealthSimpleEvent" }, "messageVersion" : { "type" : "string", "description" : "1.0" }, "eventType" : { "type" : "string", "description" : "{ enum : [ created, updated, deleted ] }" }, "resourceReference" : { "type" : "string", "description" : "The reference (absolute URL) of the resource for which the event message is issued" }, "resourceVersion" : { "type" : "string", "description" : "The version of the resource (version after: created, updated, version before: deleted)" } } }

 

Example

Simple Events are published at a CRUD resource level. This means that they can be generated as a side effect of a business event. In the example below, a ServiceRequest has been created as a side effect of applying a CarePlan to a Patient’s EpisodeOfCare.

{ "messageType": "EHealthSimpleEvent", "messageVersion": "1.0", "eventType": "created", "resourceReference": "http://careplan.inttest.ehealth.sundhed.dk/fhir/ServiceRequest/68", "resourceVersion": "1" } Message properties: { date = Fri, 27 Sep 2019 09:37:59 GMT server = istio-envoy expires = Thu, 01 Jan 1970 00:00:00 GMT x-envoy-upstream-service-time = 1 messageversion = 1.0 transfer-encoding = chunked messagetype = EHealthSimpleEvent x-frame-options = SAMEORIGIN destination = topic://ehealth-servicerequest patientreference = http://patient.inttest.ehealth.sundhed.dk/fhir/Patient/10907 resourcereference = http://careplan.inttest.ehealth.sundhed.dk/fhir/ServiceRequest/68 pragma = no-cache resourceprofile = ehealth-servicerequest content-type = text/plain; charset=ISO-8859-1 eventtype = created id = ID:careplan-6b7f84d69d-sdpkp-39827-1569566074696-1:2:66:3:1 cache-control = no-cache, no-store, must-revalidate messageclass = com.systematic.ehealth.event.event.EHealthSimpleEvent }

 

EHealthApplicationEvent

Messages of the EHealthApplicationEvent message type are issued to trigger push notifications to a patient.

Destination
topic: ehealth-application-event

Message content

Properties

eventType: The type of event

messageType: The name of the message type

messageVersion: The version of the message type, eg, “1.0”

ehealth.system: The coexistence tag identifying the telemedicine solution

userReference: The reference to the patient resource who receives the notification

resourceReference: List of labeled resource references related to this notification

payload: The notification message text to be displayed to the user

{ "type" : "object", "id" : "urn:jsonschema:com:systematic:ehealth:event:event:EHealthApplicationEvent", "properties" : { "messageType" : { "type" : "string", "description" : "EHealthApplicationEvent" }, "messageVersion" : { "type" : "string", "description" : "1.0" }, "eventType" : { "type" : "string", "description" : "{ enum : [ AppointmentReminder, VideoAppointmentReminder, ReminderSubmitMeasurement, NewEHealthMessage, MissingMeasurement ] }" }, "ehealth.system" : { "type" : "string", "description" : "The coexistence tag identifying the telemedicine solution" }, "userReference" : { "type" : "string", "description" : "The reference (absolute URL) to the patient resource who receives the notification" }, "resourceReference" : { "type" : "array", "description" : "Non-empty array of references to related resources. Each entry has a `label` (resource type) and `reference`", "items" : { "type" : "object", "properties" : { "label" : { "type" : "string" }, "reference" : { "type" : "string" } } } }, "payload" : { "type" : "string", "description" : "The notification message text" } } }

Example

In the example below, a ReminderSubmitMeasurement notification is triggered for a patient with an upcoming ServiceRequest submission deadline.

{ "messageType": "EHealthApplicationEvent", "messageVersion": "1.0", "eventType": "ReminderSubmitMeasurement", "ehealth.system": "xa", "userReference": "https://patient.local.ehealth.sundhed.dk/fhir/Patient/64148", "resourceReference": [ { "label": "ServiceRequest", "reference": "https://careplan.local.ehealth.sundhed.dk/fhir/ServiceRequest/2103" } ], "payload": "Du har en opgave. Se den i Telma." }Message properties: { date = Thu, 09 Jul 2026 10:03:38 GMT server = istio-envoy expires = Thu, 01 Jan 1970 00:00:00 GMT x-envoy-upstream-service-time = 1 messageversion = 1.0 transfer-encoding = chunked messagetype = EHealthApplicationEvent x-frame-options = SAMEORIGIN x-b3-sampled = 1 destination = topic://ehealth-application-event pragma = no-cache ehealth.system = xa x-b3-spanid = ac0912309d183801 x-b3-traceid = 9b3d09ceafca5308d886af74cb9cf43e payload = Du har en opgave. Se den i Telma. traceparent = 00-9b3d09ceafca5308d886af74cb9cf43e-ac0912309d183801-01 userreference = https://patient.local.ehealth.sundhed.dk/fhir/Patient/64148 content-type = text/plain; charset=ISO-8859-1 eventtype = ReminderSubmitMeasurement id = ID:careplan-8548c6f4d9-fphfj-38619-1783065295972-1:3:812:1:1 cache-control = no-cache, no-store, must-revalidate messageclass = com.systematic.ehealth.event.event.EHealthApplicationEvent }