eHealth Infrastructure (v2020.7)

StructureDefinition: ehealth-message

Introduction

An ehealth-message defines written communication and comes in four flavours depending on the “category” of the message:

  • Message: For sending messages from Patients, CareTeams (Practitioners), and Devices to Patients or CareTeams. Messages may not be sent between Patients or between Practitioners. When sending a message to a CareTeam, it is possible to narrow the recipient to be of a certain role. This is done by setting the “restriction-category” extension to a specific role value. When sent (by setting status “completed”), a message may no longer be updated by the sender. A recipient may update the “received” time and the “administrative-status” (eg. “read”) on a message.
  • Notification: For sending notification from Practitioners to Patients. These are usually text-based, and may have a temporal validity attached (see “period” extension) to indicate at which point a notification is no longer valid. When sent, a notification may no longer be updated by the sender.
  • Advise: Advise is much like notifications. They may also have a validity period, but they can be seen as reminders caused by a planned event, eg. a measurement or online meeting which is to take place.
  • Note: For personal notes (written by a Patient or Practitioner), which may be shared with a CareTeam. A personal note must be created with sender=recipient. In case a personal note wants to be shared with a CareTeam, the CareTeam must be referred by the recipientCareTeam extension, and the receiver deleted (both can take place in the same PATCH operation). A personal note may be updated by the sender, but not by the recipient.

An ehealth-message may refer related resources (eg. Device, CarePlan, Appointment etc) using the “topic” field, no matter which category it is. Different instances of ehealth-message may be logically organized into “threads” by assigning the same thread-id in the provided extension. Similarly, they may be organized in a group (eg. group messages) by assigning the same group-id in that extension. The message subject may be provided in the title extension, and an optional priority may be provided in the ehealth-priority extension.

Remarks about status and administrative-status

The ehealth-message profile contains two status fields:

  • status: Makes it possible for the message sender to create a draft message by specifying status “preparation”, and to cancel the message by setting status “aborted”. When the message is ready to be sent, specify status “completed”. Then the platform will handle any necessary forwarding. As long as the status is “preparation”, the message may be updated as desired, but not after the status is set to “completed”.
  • administrative-status (extension): Makes it possible for the message recipient to indicate the state of a message. A message may hold an administrative status that defines the last action the recipient took on the message in question. At first, the message has administrative-status “activate”. The recipient may mark the message as read by setting administrative-status “read”. If the recipient considers the message a sort of “task”, the message may also be updated with administrative-status “complete” when the task is done, or “reactivate” if the task was not complete anyway.

Search parameters

The following custom search parameters may be used when searching for ehealth-message instances:

  • administrativeStatus: Specify the desired administrative status using system and code (eg. “http://ehealth.sundhed.dk/cs/administrative-status” and “read”)
  • careTeamRecipient: Specify an absolute reference to the CareTeam which must be message recipient
  • careTeamSender: Specify an absolute reference to the CareTeam which must be message sender
  • communicationCategory: Specify the desired category using system and code (eg. “http://ehealth.sundhed.dk/message-category/” and “message”)
  • period: Use a date-type search to filter messages that must conform to temporal constraints (eg. notifications that are only valid until a specific point in time)
  • threadId: Specify the logical “thread id” used to correlate messages
  • restrictionCategory: Specify the desired restriction category using system and code (eg. “http://ehealth.sundhed.dk/cs/restriction-category” and “measurement-monitoring”)

Scope and Usage

In the eHealth Infrastructure the ehealth-message resource is used in conjunction with the following resources:

  • Patient
    • As sender or recipient of a message
  • Practitioner
    • As sender/recipient of a message (only when category is “note”)
  • Device
    • As sender of an ehealth-message (as a result of automatic processing/triage)
  • CareTeam
    • As sender or recipient using the extensions senderCareTeam/recipientCareTeam, respectively

General rules

The following rules apply for the ehealth-message profile:

  • If medium.code is eboks or nemsms, the recipient must be of type Patient
  • Only one of sender or extension senderCareTeam may be filled in
  • Only one of recipient or extension recipientCareTeam may be filled in
  • Medium ‘nemsms’ may only be used if the Patient allows reception of NemSMS (has telecom with value ‘NemSMS’). In that case, a NemSMS message will be sent to the Patient.

NemSMS Notifications

The Patient service will forward ehealth-messages to the public danish NemSMS service given the following conditions:

  • message.medium.code is ‘nemsms’ (defined in http://ehealth.sundhed.dk/cs/message-medium)
  • message.status is ‘completed’

The message is forwarded asynchronously. To track the progress of the NemSMS, the notDone flag and notDoneReason code is used:

Initially, when the ehealth-message is created message.notDone is true and message.notDoneReason is ‘in-progress’ (defined in http://hl7.org/fhir/event-status)

If the NemSMS dispatch is successful, message.notDone will be set to false.

If the NemSMS dispatch fails, message.notDone is true and message.notDoneReason is either ‘system-error’ or ‘recipient-unavailable’ (defined in http://hl7.org/fhir/communication-not-done-reason)

  • message.note.text can contain further information about the reason for dispatch failure

Automatic NemSMS Notifications

The Patient service will generate NemSMS ehealth-messages, notifying the recipient that they have received a message, given the following conditions:

  • message.medium.code is not ‘nemsms’
  • message.status is ‘completed’
  • message.category is ‘message’ (defined in http://ehealth.sundhed.dk/cs/message-category)
  • message.recipient is a Patient reference
  • patient.telecom contains ContactPoint ‘NemSMS’

The Patient service will generate NemSMS ehealth-messages, notifying patients that they have an appointment or video appointment scheduled for de following day, given the following conditions:

  • appointment.start is current day + 1 day
  • appointment.participant contains one Patient reference
  • patient.telecom contains ContactPoint ‘NemSMS’

Update rules

An ehealth-message may not have its category changed, eg. from ‘note’ to ‘message’.

When status is “preparation”, message contents may be updated, but not after status has been set to “completed”.

An ehealth-message may be PATCH updated on paths complying with the regular expressions below.

Path Description
/implicitRules.* For category ‘note’ or status ‘preparation’
/category.* For category ‘note’ or status ‘preparation’
/contained.* For category ‘note’ or status ‘preparation’
/recipient.* For category ‘note’ or status ‘preparation’
/definition.* For category ‘note’ or status ‘preparation’
/basedOn.* For category ‘note’ or status ‘preparation’
/partOf.* For category ‘note’ or status ‘preparation’
/topic.* For category ‘note’ or status ‘preparation’
/notDone.* For category ‘note’ or status ‘preparation’
/notDoneReason.* For category ‘note’ or status ‘preparation’
/context.* For category ‘note’ or status ‘preparation’
/received.* For all values of category
/reasonCode.* For category ‘note’ or status ‘preparation’
/reasonReference.* For category ‘note’ or status ‘preparation’
/payload.* For category ‘note’ or status ‘preparation’
/note.* For category ‘note’ or status ‘preparation’
/status.* For category ‘note’ or status ‘preparation’
/extension.* For category ‘note’ or status ‘preparation’

Formal Views of Profile Content

The official URL for this profile is:

http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-message

This is the profile for general messaging in the eHealth platform. It covers four different message types: messages, notifications, advice, and notes. This is specified using the message category (value set "Message category"). When needed, message medium NemSMS may also be specified (value set "Message medium").

Message-related state, such as whether a message has been read etc, is handled through the use of the administrative-status extension.

This profile builds on Communication.

This profile was published on Tue Oct 27 14:11:48 UTC 2020 as a draft by ehealth.sundhed.dk.

Description of Profiles, Differentials, Snapshots, and how the XML and JSON presentations work.

 

Terminology Bindings

PathConformanceValueSet
Communication.languageextensibleCommon Languages
Max Binding: All Languages
Communication.extension:restrictionCategory.value[x]:valueCodeableConceptrequiredRestrictionCategory
Communication.extension:restrictionCategory.value[x]:valueCodeableConcept.codingrequiredRestrictionCategory
Communication.extension:priority.value[x]:valueCoderequiredPriority
Communication.statusrequiredEventStatus
Communication.notDoneReasonrequiredCommunicationNotDoneReason
Communication.categoryexampleCommunicationCategory
Communication.category:DkTmCategoryexampleCommunicationCategory
Communication.category:DkTmCategory.codingrequiredMessageCategory
Communication.category:DkTmCategory.coding.coderequiredMessageCategory
Communication.mediumexamplev3 Code System ParticipationMode
Communication.medium:DkTmMediumexampleMessageMedium
Communication.medium:DkTmMedium.coding.coderequiredMessageMedium
Communication.reasonCodeexampleSNOMED CT Clinical Findings
Communication.reasonCode.codingrequiredeHealth Message Reason Code

Constraints

IdPathDetailsRequirements
dom-2CommunicationIf the resource is contained in another resource, it SHALL NOT contain nested Resources
: contained.contained.empty()
dom-1CommunicationIf the resource is contained in another resource, it SHALL NOT contain any narrative
: contained.text.empty()
dom-4CommunicationIf a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
: contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-3CommunicationIf the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource
: contained.where(('#'+id in %resource.descendants().reference).not()).empty()
com-1CommunicationNot Done Reason can only be specified if NotDone is "true"
: notDone or notDoneReason.exists().not()
nemsms-1CommunicationIf communication resource is a NemSMS payload cannot exceed 160
: medium.coding.where(code = 'nemsms').exists() implies payload.contentString.length() <= 160
note-invariantCommunicationCategory note invariant
: category.coding.code = 'note' implies (sender.reference = recipient.reference) or (recipient.reference.exists().not() and extension.where(url = 'http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-communication-recipientCareTeam').valueReference.exists())
notification-invariantCommunicationCategory notification invariant
: category.coding.code = 'notification' implies recipient.reference.contains('Patient/') and ( sender.reference.contains('Practitioner/') or extension.where(url = 'http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-communication-senderCareTeam').valueReference.exists())
message-invariantCommunicationCategory message invariant
: category.coding.code = 'message' implies (recipient.reference.contains('Patient/') and ( sender.reference.contains('Device/') or contained.ofType(Device).where('#' + id = %resource.sender.reference).empty().not() or extension.where(url = 'http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-communication-senderCareTeam').valueReference.exists())) or (( extension.where(url = 'http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-communication-recipientCareTeam').valueReference.exists()) and (sender.reference.contains('Patient/') or sender.reference.contains('Device/'))) or (extension.where(url = 'http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-communication-recipientCareTeam').valueReference.exists() and extension.where(url = 'http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-communication-senderCareTeam').valueReference.exists() )
ele-1Communication.extension:recipientCareTeamAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:recipientCareTeamMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:senderCareTeamAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:senderCareTeamMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:restrictionCategoryAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:restrictionCategoryMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:threadIdAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:threadIdMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:periodAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:periodMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:administrativeStatusAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:administrativeStatusMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:titleAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:titleMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:priorityAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:priorityMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:groupIdAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:groupIdMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.extension:onBehalfOfAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
ext-1Communication.extension:onBehalfOfMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Communication.payloadAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
.