diff --git a/input/pagecontent/changelog.md b/input/pagecontent/changelog.md index 1e00581e..0edb157f 100644 --- a/input/pagecontent/changelog.md +++ b/input/pagecontent/changelog.md @@ -1,6 +1,6 @@ This is the log of changes made to the eHealth Implementation Guide. -## Release 2026.3. +## Release 2026.3. todo: change to semver format before release ### General changes - Updated ehealth-media to allow patient and relatedPerson references in it's operator field. ### Custom operations @@ -11,6 +11,8 @@ This is the log of changes made to the eHealth Implementation Guide. ### ConceptMaps ### Resource/profile changes - Updated ehealth-media to allow patient and relatedPerson references in it's operator field. +### Event messages +- Tightened the `EHealthApplicationEvent` JSON schema (CCR0303 AC-7): the schema is now declared as JSON Schema draft-07; `eventType` and `resourceReference` are top-level required; `resourceReference` requires `minItems: 1` with each entry requiring both `label` and `reference`; and per-`eventType` `if`/`then`/`contains` rules assert the obligatory `resourceReference.label`. **Note for vendors:** producers must now emit both `label` and `reference` on every `resourceReference` entry and include the `eventType`-specific obligatory label. ## 9.0.1 (2026-05-05) ### ValueSets diff --git a/input/pagecontent/event-messages.md b/input/pagecontent/event-messages.md index dcd056fa..2b7d26e2 100644 --- a/input/pagecontent/event-messages.md +++ b/input/pagecontent/event-messages.md @@ -133,8 +133,10 @@ topic: `ehealth-application-event` ``` { + "$schema" : "http://json-schema.org/draft-07/schema#", "type" : "object", "id" : "urn:jsonschema:dk:sundhed:ehealth:event:models:EHealthApplicationEvent", + "required" : [ "eventType", "resourceReference" ], "properties" : { "messageType" : { "type" : "string", @@ -162,9 +164,11 @@ topic: `ehealth-application-event` }, "resourceReference" : { "type" : "array", - "description" : "References to related resources", + "minItems" : 1, + "description" : "References to related resources. At least one entry is required; the obligatory label per eventType is listed in the Event Types table below.", "items" : { "type" : "object", + "required" : [ "label", "reference" ], "properties" : { "label" : { "type" : "string", @@ -177,7 +181,19 @@ topic: `ehealth-application-event` } } } - } + }, + "allOf" : [ + { "if" : { "required" : [ "eventType" ], "properties" : { "eventType" : { "const" : "AppointmentReminder" } } }, + "then" : { "properties" : { "resourceReference" : { "contains" : { "properties" : { "label" : { "const" : "Appointment" } } } } } } }, + { "if" : { "required" : [ "eventType" ], "properties" : { "eventType" : { "const" : "VideoAppointmentReminder" } } }, + "then" : { "properties" : { "resourceReference" : { "contains" : { "properties" : { "label" : { "const" : "Appointment" } } } } } } }, + { "if" : { "required" : [ "eventType" ], "properties" : { "eventType" : { "const" : "ReminderSubmitMeasurement" } } }, + "then" : { "properties" : { "resourceReference" : { "contains" : { "properties" : { "label" : { "const" : "ServiceRequest" } } } } } } }, + { "if" : { "required" : [ "eventType" ], "properties" : { "eventType" : { "const" : "MissingMeasurement" } } }, + "then" : { "properties" : { "resourceReference" : { "contains" : { "properties" : { "label" : { "const" : "ServiceRequest" } } } } } } }, + { "if" : { "required" : [ "eventType" ], "properties" : { "eventType" : { "const" : "NewEHealthMessage" } } }, + "then" : { "properties" : { "resourceReference" : { "contains" : { "properties" : { "label" : { "const" : "EhealthMessage" } } } } } } } + ] } ``` ##### Properties @@ -187,11 +203,13 @@ topic: `ehealth-application-event` - `messageVersion`: The version of the message type, eg. "1.0" - `payload`: Notification text content from the CommunicationRequest - `userReference`: The reference (absolute URL) of the Patient resource representing the citizen -- `resourceReference`: Array of references to related resources, each with a `label` (resource type) and `reference` (absolute URL) +- `resourceReference`: Non-empty array of references to related resources. Each entry has a `label` (resource type) and `reference` (absolute URL). The obligatory entries per `eventType` are listed in the Event Types table. ##### Event Types -| eventType | Description | resourceReference label | Source | +Each `eventType` guarantees at least one `resourceReference` entry with the indicated `label`. This is enforced by the JSON schema's `allOf` / `if`-`then` / `contains` block above. + +| eventType | Description | Obligatory resourceReference label | Source | |---|---|---|---| | AppointmentReminder | Appointment reminder | Appointment | fut-appointment-notification-job | | VideoAppointmentReminder | Video appointment reminder | Appointment | fut-appointment-notification-job |