DRAFT - The specification is currently in development and subject to significant change. It is not ready for limited roll-out or production level use.

CA:eReC Messaging

FHIR Messaging Overview

The Pan-Canadian eReferral-eConsult Messaging Interoperability Specification, enables a bi-directional exchange of information about referral requests, appointments, referral related tasks and communications between two trusted systems using FHIR messaging, and is the basis of integrations that connect systems participating in eReferral-eConsult related exchanges to one another.

In FHIR messaging, a message is sent from a source application to a destination application when an event happens. A message is a Bundle resource of type message, that conforms to specific rules.

For details, see HL7 FHIR Messaging documentation.

FHIR Messaging Overview

A popular way to transfer messages is using HTTP based $process-message FHIR operation, that includes RESTful interactions. For details, see $process-message operation definition.


CA:eReC Messaging Architectures

CA:eReC Messaging is meant to provide implementable technical specifications in support of real-world architectures for eReferral/eConsult message flows.

eReferral/eConsult data exchange architectures are of two main types:

  • Point-to-point – where eReferral/eConsult messages are exchanged directly between the two main participants – eReC Source and eReC Target Point-to-point Architecture

  • Central Intake – where eReferral/eConsult messages are first sent to a single intake point that directs the eReferral/eConsult requests from the eReC Source to one or multiple eReC Target destinations. The Central Intake dispatches the messages received from the original eReC Source using mechanisms for message Routing, Splitting and Chaining. For more information on Central Intake please see CA:eReC Central Intake. Central-Intake Architecture


CA:eReC Technical Actor Description

There are two types of actors that are defined in this IG to participate in CA:eReC Messaging:

  • External facing – these actors are participating in data exchanges with external systems (sending or receiving) and require explicit specifications for integration points to allow for interoperability.

  • Internal facing – these actors are internal to a particular system (e.g., Central Intake) and no explicit specifications for integration points are required for interoperability. However, there are internal capabilities that are required, as these have a direct impact on interoperability. Typically, the internal actors are grouped with external actors, that carry out the actual data exchange, after the internal actor finished their internal processing. Note that internal facing actors may potentially use or communicate with other external services that are not exposed or visible in the context defined in this implementation guide.

CA:eReC Messaging defines the following actors:

Actor Description
eReC Sender The eReC Sender is the actor that produces and sends FHIR Messages to the eReC Receiver, in support of the activities related to requesting eReferral/eConsult services. It also receives and responds where appropriate to the FHIR Messages sent by the eReC Receiver.
eReC Receiver The eReC Receiver is the actor that receives and responds where appropriate to the FHIR Messages sent by the eReC Sender. It also produces and sends FHIR Messages to the eReC Sender, in support of the activities related to processing eReferral/eConsult requests and performing the requested services.
eReC Dispatcher1 The eReC Dispatcher is the actor that supports Central Intake architectures of eReferral/eConsult exchanges. The eReC Dispatcher performs triaging and transferring of the eReC Messages, using Routing and Splitting methods.

As part of triaging, eReC Dispatcher may have additional capabilities, such as processing the eReferral/eConsult request, as well as deciding and passing it on to the most appropriate destination (eReC Receiver). Processing includes analysis of referral request needs, urgency, downstream service wait times, location and may include consideration for patient preference for location, waiting period and health care provider.

The eReC Dispatcher is an internal facing actor, it does not directly participate in the exchange of FHIR messages with external systems.

1 Note: Real world systems MAY receive and send referrals using other modalities in addition to FHIR messaging (e.g. HL7 v2, fax, etc.) The eReC Dispatcher MAY have the ability to transform referrals between different modalities.


CA:eReC Actor Mappings

Real-world Systems, when they are participating in use cases, act as actors that assume distinct roles, where the same real-world system can perform one role or multiple roles. The chart below shows examples on how Use Case Actors can map to real-world Healthcare Systems (e.g. EMR/HIS), and to the Technical Actors that are performing specific transactions, that are referenced in this specification. Please refer to Participants for definitions of use case actors.

Note: The mapping below illustrates examples for basic eReferral/eConsult scenarios where messages are exchanged directly between the participants, without a Central Intake.

Actor Mappings


CA:eReC Actors and Transactions

The following diagrams illustrate the actors and transactions in scope for the CA:eReC Messaging Interoperability Specification.

CA:eReC Messaging Exchange Details

The actors and transactions details below are generally applicable to any type of eReC message exchanges, that includes both Point-to-Point and Central Intake architectures (external facing). The actors that are specific to Central Intake are not included.

CAeReC Messaging Exchange

CA:eReC Messaging Exchange with Central Intake

The diagram below illustrates the message exchanges applicable to CA:eReC messaging, with focus on the actors and transactions that participate in Central Intake. For more information on Central Intake, please see CA:eReC Central Intake.

CAeReC Messaging Exchange_CI

Note to Reviewers: Please review the mandatory grouping of the eReC Dispatcher actor with eReC Receiver and eReC Sender actors.

The rationale for grouping the actors in this design is to have a high-level of modularity, where the different pieces of Central Intake could potentially be put together in different ways using the same constituent parts. Although the current IG provides only one mechanism for Central Intake to receive or send referrals (CA:eReC Messaging) that mandates the grouping, keeping the eReC Dispatcher, eReC Sender and eReC Receiver as separate entities technically allows more flexibility to discuss different interactions with other actors later if needed.

We have received feedback to consider eReC Dispatcher as a single first class actor combining transactions of an eReC Sender and eReC Receiver, in addition to route and split transactions which will be discussed by the working group.

CA:eReC Messaging Compliance

The table below lists the transactions for each actor directly involved in CA:eReC Messaging. To claim compliance with CA:eReC Messaging, an actor SHALL support all required transactions (labeled “R”).

Actor Transaction Event Code Direction Optionality
eReC Sender Send new service request [eReCm-1] add-service-request Outgoing R
Notify new service request [eReCm-2] notify-add-service-request Outgoing O
Notify new service request [eReCm-2] notify-add-service-request Incoming O
Notify update service request [eReCm-3] notify-update-service-request Outgoing O
Notify data correction [eReCm-4] notify-data-correction Incoming O
Revoke service request [eReCm-5] revoke-service-request Outgoing R
Notify new request processing [eReCm-6] notify-add-process-request Incoming R
Notify update request processing [eReCm-7] notify-update-process-request Incoming R
Notify new appointment [eReCm-8] notify-add-appointment Incoming O
Send communication from requester [eReCm-9] send-communication-from-requester Outgoing O
Send communication from performer [eReCm-10] send-communication-from-provider Incoming O
eReC Receiver Send new service request [eReCm-1] add-service-request Incoming R
Notify update service request [eReCm-3] notify-update-service-request Incoming O
Notify data correction [eReCm-4] notify-data-correction Outgoing O
Revoke service request [eReCm-5] revoke-service-request Incoming R
Notify new request processing [eReCm-6] notify-add-process-request Outgoing R
Notify update request processing [eReCm-7] notify-update-process-request Outgoing R
Notify new appointment [eReCm-8] notify-add-appointment Outgoing O
Send communication from requester [eReCm-9] send-communication-from-requester Incoming O
Send communication from performer [eReCm-10] send-communication-from-provider Outgoing O
eReC Dispatcher 1 Route message N/A Internal R
Split message N/A Internal R

1 The transactions defined for the eReC Dispatcher Actor are internal to the Central Intake system, however they have a direct impact on interoperability. To exchange messages with external systems, the internal actor (eReC Dispatcher) is grouped with external actors (eReC Sender and eReC Receiver).


CA:eReC Actor Options

The table below lists the options that may be selected for each actor. Dependencies between options when applicable are specified in notes.

If no option is specified, the default capabilities are required for that actor. Otherwise, the capabilities for the specific option are required.

Actor Option Name
eReC Sender None (default)
Central Intake
eReC Receiver None (default)
Central Intake
eReC Dispatcher Central Intake (default)

CA:eReC Actor Groupings

An actor from this profile (Column 1) SHALL implement all the required transactions and/or content modules in this profile in addition to all of the transactions required for the grouped actor (Column 2).

eReC Messaging Actor Actor to be grouped with
eReC Sender (Central Intake option) eReC Receiver (Central Intake option)
eReC Sender (Central Intake option) eReC Dispatcher
eReC Receiver (Central Intake option) eReC Sender (Central Intake option)
eReC Receiver (Central Intake option) eReC Dispatcher

CA:eReC Transaction Detail

This section describes the transactions that are exchanged between the CA:eReC actors.

Note: The resources in focus illustrated are not exhaustive – in the tables below the most common focus is shown for each transaction.

For eReferral the Task.code is 'process-request' and for eConsult, it is 'process-request-consult'.

eReC Sender

The table below lists the outgoing transactions for the eReC Sender actor, along with the message details.

Transaction ID Transaction Name Optionality Event Code Focus Message Type Response (Event Code) Response (Focus)
eReCm-1 Send new service request R add-service-request ServiceRequest (CA:eReC) consequence notify-add-process-request Task (CA:eReC) ('process-request') with a status
eReCm-2 Notify new service request O notify-add-service-request ServiceRequest (CA:eReC) notification
eReCm-3 Notify update service request O notify-update-service-request ServiceRequest (CA:eReC) notification
eReCm-5 Revoke service request R revoke-service-request ServiceRequest (CA:eReC) consequence notify-update-process-request Task (CA:eReC) ('process-request') with status 'cancelled'
eReCm-9 Send communication from requester O send-communication-from-requester Communication (CA:eReC) consequence send-communication-from-provider Communication (CA:eReC) or Task (CA:eReC)

Trigger Event Mappings to Event Codes

The table below illustrates the most common real-life trigger events that are translating into the specific event codes within the FHIR message. This list is not exhaustive and there could be additional trigger events that are not represented here.

Trigger Event Event Code Focus
Submit request for eReferral or eConsult add-service-request ServiceRequest (CA:eReC)
Create new service request notify-add-service-request ServiceRequest (CA:eReC)
Update service request information or status notify-update-service-request ServiceRequest (CA:eReC)
Terminate service request revoke-service-request ServiceRequest (CA:eReC)
Request clarification or additional info from the Performer send-communication-from-requester Communication (CA:eReC) (category=rfi)
Respond with additional information requested by the Performer send-communication-from-requester Communication (CA:eReC) or ServiceRequest (CA:eReC)
Send ad-hoc communication send-communication-from-requester Communication (CA:eReC) (category=general)

eReC Receiver

The table below lists the outgoing transactions for the eReC Receiver actor, along with the message details.

Transaction ID Transaction Name Optionality Event Code Focus Message Type Response (Event Code) Response (Focus)
eReCm-4 1 Notify data correction O notify-data-correction ServiceRequest (CA:eReC) notification notify-update-service-request ServiceRequest (CA:eReC)
eReCm-6 Notify new request processing R notify-add-process-request Task (CA:eReC) (process-request) notification
eReCm-7 Notify update request processing R notify-update-process-request Task (CA:eReC) (process-request) notification
eReCm-8 Notify new appointment O notify-add-appointment Appointment (CA:eReC) notification
eReCm-10 Send communication from performer O send-communication-from-provider Communication (CA:eReC) consequence send-communication-from-requester Communication (CA:eReC) or ServiceRequest (CA:eReC)

1 Transaction is not applicable for eConsult.

Trigger Event Mappings to Event Codes

The table below illustrates the most common real-life trigger events that are translating into the specific event codes within the FHIR message. This list is not exhaustive and there could be additional trigger events that are not represented here.

Trigger Event Event Code Focus
Perform correction of information received from Requester notify-data-correction ServiceRequest (CA:eReC)
Initiate processing the request notify-add-process-request Task (CA:eReC) (process-request)
Update info or status as work is performed notify-update-process-request Task (CA:eReC) (process-request)
Update appointment if information or status changes notify-update-process-request Task (CA:eReC) (process-request)
Complete the work related to the eReferral or eConsult notify-update-process-request Task (CA:eReC) (process-request)
Respond with additional information asked by the Requester notify-update-process-request Task (CA:eReC) (process-request)
Terminate the eReferral or eConsult notify-update-process-request Task (CA:eReC) (process-request)
Create appointment in response to an eReferral request notify-add-appointment Appointment (CA:eReC)
Request clarification or additional info needed to perform the request send-communication-from-provider Communication (CA:eReC) (category=rfi)
Send ad-hoc communication send-communication-from-provider Communication (CA:eReC) (category=general)

eReC Dispatcher

Actor Transaction Direction Optionality
eReC Dispatcher 1 Route Message Internal R
Split Message Internal R

1 The transactions defined for the eReC Dispatcher Actor are internal to the Central Intake system, however they have a direct impact on interoperability. To exchange messages with external systems, the internal actor (eReC Dispatcher) is grouped with external actors (eReC Sender and eReC Receiver).


Constructing Messages

Transmission of information between two systems using FHIR messaging involves the exchange of a message payload that consists of several parts:

  • A Message Bundle: A Bundle Resource ("type" : "message") is used to package together a collection of FHIR Resource instances that will be sent from one system to another. The Bundle SHALL have an entry for each of the FHIR Resources required to convey information about the business event, starting with the MessageHeader which SHALL always be first.

  • A Message Header: A MessageHeader Resource with eventCoding identifying the trigger event and other message related metadata including an id, source.endpoint, destination.endpoint is used to convey the purpose of the message and to support message routing.

  • The Focus of the Message: MessageHeader.focus SHALL point to the ServiceRequest, Task, Appointment or Communication Resource that is being acted upon.

  • Other referenced entities and supporting information: The MessageHeader and Focus SHALL reference other resources to convey information about the Patient who is the subject of the referral request (ServiceRequest.subject), the PractitionerRole of the requester (ServiceRequest.requester, MessageHeader.author), supporting information (ServiceRequest.supportingInfo), etc.

  • Identifiers & Timestamps: Bundles and MessageHeaders SHALL have appropriate Identifiers & Timestamps as defined in the FHIR messaging requirements. Each Bundle.entry element SHALL have a unique fullUrl and resource so systems that receive messages can resolve references within the bundle.

The Event (MessageHeader.event) and Focus of the Message (MessageHeader.focus) determines the content and structure of the Bundle of information (FHIR Resources) exchanged between the eReC Source and the eReC Target.

Example: ServiceRequest Message Bundle

As illustrated below, a message event that focuses on a ServiceRequest will include a Bundle of resoruces that, minimally, SHALL include:

  • a MessageHeader
  • the ServiceRequest referenced in MessageHeader.focus
  • the Patient who is the subject of the ServiceRequest (ServiceRequest.subject)
  • PractitionerRole(s) referenced in MessageHeader.author, ServiceRequest.requester, the requested ServiceRequest.performer where, each SHALL reference an Organization, Location and/or Practitioner
  • references to other ServiceRequest.supportingInfo where needed (see below)

Illustration: ServiceRequest Message Bundle

ServiceRequest bundle

Specifications:

Message Bundles corresponding to different Focus resource are specified on the following pages:

  • Message Bundle: ServiceRequest
  • Message Bundle: Task
  • Message Bundle: Appointment
  • Message Bundle: Communication

Notes:

  • To enable conformance testing against the requirements of this IG, the requirements summarized above are formally specified as contraints within FHIR Profiles published in this IG. Implementers are strongly encouraged to become familiar with these formal specifications and to rely on them as the source of truth.

  • Messages with multiple resources in MessageHeader.focus will have additional requirements that are not represented in the requirements above.


State Machines

The information flows defined above are used to transmit information about ServiceRequests, Appointments and related Communications between systems as well as to convey information about the status of a ServiceRequest. Within FHIR Messages, staus is conveyed using a combination of the event code in MessageHeader.event and the .status element(s) of the Task ('process-request') or ServiceRequest in MessageHeader.focus.

The person who initiated the Referral request (i.e. the Requester) is owner of the ServiceRequest and the system where a request was created, the eReC Source, SHALL be considered the source of truth for the content of the request.

Once a ServiceRequest has been created and sent to the eReC Target, the eReC Target that receives the request (and its users) SHALL be responsible for processing the request. Therefore, the eReC Target SHALL be considered the source of truth for all information about actions performed in response to the Request and the status of the request. The eReC Target SHOULD use the 'process-request' Task resource (and associated messages) to convey status information back to the eReC Source and Requester.

State-Machine

Requester State Machine

A ServiceRequest will pass through several states over its lifecycle. State changes within an eReC Source MAY be the result of actions taken directly by users of the eReC Source or a response to messages received from an eReC Target.

The following table outlines the expected use of FHIR messaging and message elements to convey state changes within the eReC Source to the eReC Target:

Business Event Message EventCode ServiceRequest.status Expectation of eReC Target
A ServiceRequest is created by the eReC Source and sent to the eReC Target add-service-request Active The eReC Target SHOULD respond with notify-add-process-request once
(a) the message has been accepted and
(b) the 'process-request' Task has been created;
The eReC Target SHOULD also send nofications to the eReC Source to communicate updates to status as the request is processed.
A ServiceRequest that has been sent to eReC Target is terminated/revoked in the eReC Source revoke-service-request Terminated/Revoked, Entered-in-error The eReC Target SHALL delete the Task and any associated PHI upon receipt of the message.
A ServiceRequest's status is changed within the eReC Source notify-update-servicerequest Active, On-hold, Completed, Unknown The eReC Target SHOULD update any stored ServiceRequest information corresponding to the change.
Communication related to the ServiceRequest sent by eReC Target send-communication-from-provider N/A The eReC Target can send a question, request information, or general communication related to a ServiceRequest.
Performer State Machine

The 'process-request' Task is used to track the state of a ServiceRequest on the eReC Target. State changes MAY result from actions taken within the eReC Target or based on messages the system receives from an eReC Source.

The following table illustrates the relationship between changes in the status of the 'process-request' Task and the messages exchanged between the eReC Source and eReC Target. It is expected that systems participating in integrations will have internal states that vary from below, therefore implementers SHALL anticipate the need to discuss workflow and state transitions with integration partners at the time of implementation and to map their internal states to the status codes used to exchange information between the eReC Source and eReC Target.

Business Event Message EventCode Task.status Expectation of eReC Source
A ServiceRequest is received and 'process-request' Task is created on the eReC Target notify-add-process-request Requested, Received, Accepted, Ready, In-progress The eReC Source MAY update the status of the ServiceRequest.status based on the information received
The status of a 'process request' Task is changed notify-update-process-request Requested, Received, Accepted, Ready, In-progress, On-hold, Completed, Rejected, Cancelled, Failed The eReC Source MAY update the status of the ServiceRequest based on the information received
The requester needs some additional information and sends it using 'send-communication-from-requester' regarding the ServiceRequest send-communication-from-requester Information Requested, Request Updated, Requested Information Updated eReC Source MAY send a question, request clarification, or for general communication related to a ServiceRequest
ServiceRequest needs a correction notify-data-correction Request Updated, Requested Information Updated eReC Target MAY notify systems that it has corrected information in a ServiceRequest or related resource
eReC Target to notify systems that an appointment has been created in response to a ServiceRequest notify-add-appointment Request Updated, Requested Information Updated eReC Target MAY notify systems that an appointment has been created in response to a ServiceRequest

Furthermore to the above, the Task.businessStatus is a reflection of the internal business state of a task within an eReC Target. The Task.businessStatus MAY vary between eReC Target systems depending on internal workflow. An example of the relationship between the Task.businessStatus, Task.status, and ServiceRequest.status is depicted in the eConsult example below. Note: The below workflow event is only an example workflow step to demonstrate the relationship between various statuses.

Workflow Event Business Event Message EventCode Task.business Status Task.Status Expectation of eReC Source
Consult provided by specialist. The status of a 'process request' Task is changed notify-update-process-request Completed1 Completed1 The eReC Source MAY update the status of the ServiceRequest based on the information received

1 The status selected to depict the workflow event are not meant to be prescriptive. The code selection for Task.status and Task.businessStatus are up to the discretion of the participating systems.


Referral Outcome Information

Different referral requests and pathways will have different outcomes. As with other business flows, implementers SHALL anticipate the need to discuss expected outcomes of different ServiceRequests and any information to be shared when a ServiceRequest reaches a terminal state (i.e.: completed, cancelled, failed, or rejected).

Irrespective of the performer or requester a referral or consult request is completed when BOTH the sender and receiver mark it as completed.

Below are approaches in use:

Request completed by Performer

In the typical case where a ServiceRequest is accepted by and eReC Target and then completed by its users, an update to the 'process-request' Task SHOULD be used to share information with the requester about the ServiceRequest outcome, where:

  • the MessageHeader.event SHALL be 'notify-update-process-request'
  • the MessageHeader.focus SHALL be a reference to Task resources, where:
    • Task.code is 'process-request'
    • Task.status is 'completed'
  • Task.output MAY reference one or more resources createdbasedOn the current ServiceRequest (e.g.: a Communication containing a plan of care)
Request completed by Requester

In some cases, the requester of a referral or consult may be required to confirm that the request has been completed.

Note : The task.code is used to differentiate between the eReferral compared to an eConsult request. For eConsult, task.code is 'process-request-consult' and for eReferral the task.code is 'process-request'

In case of an eConsult the workflow will be as follows:

Business Event Message EventCode Target System Details
Specialist provides response notify-update-process-request eReC Source Task.code is "process-request-consult"
Task.status is "completed"
Task.output.valueReference() references the service plan or response (Communication) Communication.payload.contentString contains the specialist's consult response
Requester confirms that request has been completed notify-update-servicerequest eReC Target ServiceRequest.status is completed
ServiceRequest.supportingInfo references QuestionnaireResponse
QuestionnaireResponse.questionnaire references Questionnaire
QuestionnaireResponse contains responses from the requester to performance questions related to billing and service utilization
Requester cancels request revoke-service-request eReC Target ServiceRequest.status is terminated
Requester redirects request revoke-service-request followed by add-service-request eReC Target ServiceRequest.status is terminated followed by ServiceRequest.status is active
Performer responds to consult request suggesting eReferral notify-update-process-request eReC Source Task.code is "process-request-consult"
Task.status is "completed"
Task.output.valueReference() references the service plan or response (Communication)
Communication.payload.contentString contains the specialist's consult response
.extension:PatientNeedsToBeSeen - PatientNeedsToBeSeen is set to true

Referral Forms and Supporting Information

This iGuide defines baseline messaging requirements for eReferral but not the forms or clinical data that must be sent with a ServiceRequest. Therefore, implementers SHALL anticipate the need to discuss and mutually agree on the approach that will be used to support different requests and referral pathways. This includes any forms that may be used to inititate the referral and the format of any required supporting information that must be attached.

This iGuide and the FHIR profiles within it provide a few different options for attaching supporting information to a ServiceRequest, including:

  • Converting the information collected within a form into human-readable text and including it in the ServiceRequest.note.text element;
  • Using one of several different FHIR resources that can be referenced in ServiceRequest.supportingInfo and then included in the message payload as a Bundle.entry:
    • QuestionnaireResponse to provide structured form data as a list of questions and responses. QuestionnaireResponse.text narrative field should be used to provide unstructured data such a copy-paste or summary of the Questionnaire response, or
    • DocumentReference to provide a binary attachment that's available to retrieve from a server using a url (recommended) or as base64 encoded data included in the resource.

Where there is a requirement to exchange structured clinical information supported by other FHIR resources implementers MAY engage and collaborate with the eReferral Interoperability Working Group to profile specific FHIR resources with the expectation of contributing them to a future version of this iGuide.