This page is part of the FHIR Specification (v0.01: Historical Archive Draft). The current version which supercedes this version is 4.0.1. For a full list of available versions, see the Directory of published versions

# Message

A message that contains FHIR resources.

The relative url is /messages

## Content

    <Message xmlns="http://www.hl7.org/fhir">
      <id> mand id Master Resource Id = Message Id</id>
      <threadId> opt id Id of thread of conversation</threadId>
      <instant> mand instant Instant the message was sent</instant>
      <event> mand code Code for the event his message represents</event>
      <response> opt  <!-- If this is a response -->
       <id> mand id Id of original message</id>
       <code> mand code Type of response to the message</code>
       <duplicate> mand boolean if this is not the first response</duplicate>
      </response>
      <source> mand (Device) Message Source Application</source>
      <destination> mand (Device) Message Destination Application</destination>
      <enterer> opt (Person|Device) The source of the data entry</enterer>
      <author> opt (Person|Device) The source of the decision</author>
      <responsible> opt (Person|Organization) final responsibility for event</responsible>
      <effective> opt Interval(dateTime) time of effect</effective>
      <reason> opt CodeableConcept Cause of event</reason>
      <data> cond (Any) The actual content of the message</data>
      <extensions> opt See Extensions   See Extensions </extensions>
      <text> mand Narrative Text summary of message, for human interpretation</text>
    </Message>

Schema for Message and an example (or formatted for browser)

Terminology Bindings

- Message.event is bound to the concept domain MessageEvent which has the allowed values defined for Event List in the messaging framework
- Message.response.code is bound to the concept domain ResponseCode: "The kind of response to a message". Possible values:

  ok | The message was accepted and processed without error
  error | Some internal unexpected error occured - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required
  rejection | The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative must describe what the issue is
  rules | The message was rejected because of some event-specific business rules, and it may be possible to modify the request and re-submit (as a different request). The response data must clarify what the change would be, as described by the event definition
  undeliverable | A middleware agent was unable to deliver the message to it's supposed destination

- Message.reason is bound to the concept domain EventReason: "The reason for an event occurring"

Notes:

- The Message resource is a special case; it is only defined for the messaging framework, and is not encountered in other contexts
- The Message resource is always found in an aggregation. The resource references source, destination, enterer, author, and responsible may all be included in the aggregation or left out on the basis that the recipient (and any intermediaries) are able to locate/resolve the resources independently. The former would be suitable for loosely coupled systems, and the latter for tightly coupled systems. The messaging conformance statement for an application must describe what aggregation occurs or is required here
- The actual content of the data is specified per message event. The data resource is always aggregated

## Formal Definitions

The formal definitions for the elements above. Also available as an XML file

Message
Definition | A message that contains FHIR resources
Control | Mandatory, 1..1
Requirements | Many implementations are not prepared to use REST, and need a message based infrastructure
Message.id
Definition | Unique Id for this message
Control | Mandatory, 1..1
Type | id
Must Understand | true
Requirements | Each message needs a unique identifier so other messages and underlying infrastructure can reference it
Comments | must be unique within a channel, but should be globally unique. UUIDs are recommended
Message.threadId
Definition | Id of the thread - a series of messages that pertain to the same logical sequence, and are all identified by the same thread identifier
Control | Optional, 0..1
Type | id
Message.instant
Definition | Instant the message was sent
Control | Mandatory, 1..1
Type | instant
Must Understand | true
Message.event
Definition | Code that identifies the event this message represents, and connects it with the event definition in the FHIR specification
Control | Mandatory, 1..1
Type | code from MessageEvent
Must Understand | true
Message.response
Definition | Information about the the message that this message is a response to - if it is a response
Control | Optional, 0..1
Must Understand | true
Message.response.id
Definition | The id of the message that this a response to
Control | Mandatory, 1..1
Type | id
Must Understand | true
Comments | this message must have the same threadId as the original message (including missing if the original message threadId was missing)
Message.response.code
Definition | Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not
Control | Mandatory, 1..1
Type | code from ResponseCode
Must Understand | true
Comments | This is a generic response to the request message. Specific data for the response will be found in Message.data
Message.response.duplicate
Definition | True if this is not the first response, because the request message has been received more than once
Control | Mandatory, 1..1
Type | boolean
Must Understand | true
Comments | The request shouldn't be received more than once if reliable message delivery applies, but mostly it doesn't
Message.source
Definition | The source application from which this message originated
Control | Mandatory, 1..1
Type | Resource(Device)
Message.destination
Definition | The destination application which the message is intended for
Control | Mandatory, 1..1
Type | Resource(Device)
Message.enterer
Definition | The person or device that performd the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions
Control | Optional, 0..1
Type | Resource(Person|Device)
Requirements | Need to know for audit/traceback requirements
Comments | Usually only for the request, but can be used in a response
Message.author
Definition | The logical author of the message - the person or device that decided it should happen. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions
Control | Optional, 0..1
Type | Resource(Person|Device)
Requirements | Need to know for audit/traceback requirements
Comments | Usually only for the request, but can be used in a response
Message.responsible
Definition | The person or organization that accepts overall responsbility for the contents of the message. The implication is that the message event happened under the policies of the responsible party
Control | Optional, 0..1
Type | Resource(Person|Organization)
Requirements | Need to know for audit/traceback requirements
Comments | Usually only for the request, but can be used in a response
Message.effective
Definition | The effective time - the real world time of the even that the message represents. Usually this is just a starting time, but some message events also have an end time (do x for period y)
Control | Optional, 0..1
Type | Interval(dateTime)
Requirements | Need to know for understanding the content of the message
Comments | Usually only for the request, but can be used in a response
To Do | Grahame thinks this is not 80/20. Also, that it reall should be domain modeled, not tucked away here
Message.reason
Definition | The cause of the event - a reason for why this message is being sent
Control | Optional, 0..1
Type | CodeableConcept from EventReason
Requirements | Need to be able to track why resources are being changed and report in the audit log / history of the resource
RIM Mapping | ControlAct.reasonCode
Message.data
Definition | The actual data of the message - a reference to the focus class of the message.
Control | Conditional, 0..1: Mandatory unless the message is a response, in which case the element is optional
Type | Resource(Any)
Must Understand | true
Requirements | Every message event is about actual data, a single resource, that is identified in the definition of the event, and perhaps some or all linked resources
Comments | The data is defined where the transaction type is defined. The transaction data is always aggregated with the transaction resource
Message.extensions
Definition | See Extensions
Control | Optional, 0..1
Message.text
Definition |
Control | Mandatory, 1..1
Type | Narrative

This is an old version of FHIR retained for archive purposes. Do not use for anything else
Implementers are welcome to experiment with the content defined here, but should note that the contents are subject to change without prior notice.
© HL7.org 2011 - 2012. FHIR v0.01 generated on Mon, May 14, 2012 09:48+1000.