---
type: "resource"
title: "MessageHeader"
resource: "MessageHeader"
---
# MessageHeader
## Introduction
## Scope and Usage
The MessageHeader resource is defined in order to support [Messaging using FHIR resources](messaging). The principal usage of the MessageHeader resource is when messages are exchanged. However, as a resource that can be used with the RESTful framework, the MessageHeader resource has the normal resource end-point (\[base-url\]/MessageHeader), which is used to manage a set of static messages resources. This could be used to make an archive of past messages available. **Creating or updating Message resources in this fashion does not represent the actual occurrence of any event, nor can it trigger any logic associated with the actual event.** It is just for managing a set of message resources.
## Notes
## Notes:
- There is no persistent identifier on MessageHeader that identifies the specific triggering event for the message - any such identity must be determined from the payload of the message.
- The actual content of the focus resource is specified for each message event (see [the list on the messaging page](messaging#events)). Any resources referenced in the focus element are always included in the bundle
- If _MessageHeader.source.endpoint_ and _MessageHeader.destination.endpoint_, are literal URLs, then they SHOULD identify the addresses to which messages can be delivered. If they are logical URIs (i.e. non-dereferenceable), message delivery intermediaries must know how to deliver the message to the destination application.
- The time of the event will be found in the focus resource. The time of the message will be found in [Bundle.timestamp](bundle-definitions#Bundle.timestamp)
- The sender and receiver are not the actual technical systems - these are the human or organizations that make use of the technical systems
- A receiver is not obligated to reject messages which do not explicitly identify it as receiver (e.g. a tracker will get messages that are destined for some other system)
- The value set MessageEvent is populated by the authors of the resources declaring the events
## StructureDefinition
### Elements (Simplified)
- **[MessageHeader](/messageheader-definitions#MessageHeader)** [0..*]: - A resource that describes a message that is exchanged between systems
- **[MessageHeader.event[x]](/messageheader-definitions#MessageHeader.event%5Bx%5D)** [1..1]: [Coding](/Coding), [uri](/uri), [canonical](/canonical) example:[message-events](/valueset-message-events) The real world event that triggered this messsage
- **[MessageHeader.destination](/messageheader-definitions#MessageHeader.destination)** [0..*]: [BackboneElement](/BackboneElement) Message destination application(s)
- **[MessageHeader.destination.endpoint[x]](/messageheader-definitions#MessageHeader.destination.endpoint%5Bx%5D)** [0..1]: [url](/url), Reference([Endpoint](/Endpoint)) Actual destination address or Endpoint resource
- **[MessageHeader.destination.name](/messageheader-definitions#MessageHeader.destination.name)** [0..1]: [string](/string) Name of system
- **[MessageHeader.destination.receiver](/messageheader-definitions#MessageHeader.destination.receiver)** [0..1]: [Reference(Device](/Reference(Device), [Organization](/Organization), [Patient](/Patient), [Practitioner](/Practitioner), [PractitionerRole](/PractitionerRole), [RelatedPerson)](/RelatedPerson)) Intended "real-world" recipient for the data
- **[MessageHeader.source](/messageheader-definitions#MessageHeader.source)** [1..1]: [BackboneElement](/BackboneElement) Message source application
- **[MessageHeader.source.endpoint[x]](/messageheader-definitions#MessageHeader.source.endpoint%5Bx%5D)** [0..1]: [url](/url), Reference([Endpoint](/Endpoint)) Actual source address or Endpoint resource
- **[MessageHeader.source.name](/messageheader-definitions#MessageHeader.source.name)** [0..1]: [string](/string) Name of system
- **[MessageHeader.source.software](/messageheader-definitions#MessageHeader.source.software)** [0..1]: [string](/string) Name of software running the system
- **[MessageHeader.source.version](/messageheader-definitions#MessageHeader.source.version)** [0..1]: [string](/string) Version of software running
- **[MessageHeader.source.contact](/messageheader-definitions#MessageHeader.source.contact)** [0..1]: [ContactPoint](/ContactPoint) Human contact for problems
- **[MessageHeader.source.sender](/messageheader-definitions#MessageHeader.source.sender)** [0..1]: [Reference(Device](/Reference(Device), [Organization](/Organization), [Patient](/Patient), [Practitioner](/Practitioner), [PractitionerRole)](/PractitionerRole)) Real world sender of the message
- **[MessageHeader.reason](/messageheader-definitions#MessageHeader.reason)** [0..1]: [CodeableConcept](/CodeableConcept) example:[message-reason-encounter](/valueset-message-reason-encounter) Cause of event
- **[MessageHeader.response](/messageheader-definitions#MessageHeader.response)** [0..1]: [BackboneElement](/BackboneElement) If this is a reply to prior message
- **[MessageHeader.response.identifier](/messageheader-definitions#MessageHeader.response.identifier)** [1..1]: [Identifier](/Identifier) Bundle.identifier of original message
- **[MessageHeader.response.code](/messageheader-definitions#MessageHeader.response.code)** [1..1]: [code](/code) required:[response-code](/valueset-response-code) ok | transient-error | fatal-error
- **[MessageHeader.response.details](/messageheader-definitions#MessageHeader.response.details)** [0..1]: Reference([OperationOutcome](/OperationOutcome)) Specific list of hints/warnings/errors
- **[MessageHeader.focus](/messageheader-definitions#MessageHeader.focus)** [0..*]: Reference([Resource](/Resource)) The actual content of the message
- **[MessageHeader.definition](/messageheader-definitions#MessageHeader.definition)** [0..1]: [canonical](/canonical) Link to the definition for this message
## Mappings
- [MessageHeader Mappings](/messageheader-mappings) — 39 mapping entries
## Implementation Guide
### implementationguide-MessageHeader-core.xml
```xml
```
## Operations
- [process-message](/messageheader-operation-process-message) — Process Message — This operation accepts a message, processes it according to the definition of the event in the message header, and returns one or more response messages.
[Full Operations](/messageheader-operations)
## Resource Packs
### list-MessageHeader-packs.xml
```xml
-
```
## Search Parameters
- [code](/messageheader-search#code) — **token** — ok | transient-error | fatal-error — `MessageHeader.response.code`
- [destination](/messageheader-search#destination) — **string** — Name of system — `MessageHeader.destination.name`
- [event](/messageheader-search#event) — **token** — Code for the event this message represents or link to event definition — `MessageHeader.event.ofType(Coding) | MessageHeader.event.ofType(canonical)`
- [focus](/messageheader-search#focus) — **reference** — The actual content of the message — `MessageHeader.focus`
- [receiver](/messageheader-search#receiver) — **reference** — Intended "real-world" recipient for the data — `MessageHeader.destination.receiver`
- [response-id](/messageheader-search#response-id) — **token** — Id of original message — `MessageHeader.response.identifier`
- [sender](/messageheader-search#sender) — **reference** — Real world sender of the message — `MessageHeader.source.sender`
- [source](/messageheader-search#source) — **string** — Name of system — `MessageHeader.source.name`
[Full Search Parameters](/messageheader-search)
## Examples
- [10bb101f-a121-4264-a920-67be9cb82c74](/messageheader-example-10bb101f-a121-4264-a920-67be9cb82c74) — message-request-link — A request to link two patients
- [1cbdfb97-5859-48a4-8301-d54eab818d68](/messageheader-example-1cbdfb97-5859-48a4-8301-d54eab818d68) — messageheader-example — A typical message header
- [3a0707d3-549e-4467-b8b8-5a2ab3800efe](/messageheader-example-3a0707d3-549e-4467-b8b8-5a2ab3800efe) — message-response-link — A response to a request to link two patients
- [messageheader-example](/messageheader-example-messageheader-example) — messageheader-example
- [messageheader-examples-header](/messageheader-example-messageheader-examples-header) — messageheader-examples-header
[Full Examples](/messageheader-examples)
## Mapping Exceptions
### messageheader-event-mapping-exceptions.xml
### Divergent Elements
- **Event.code** → **MessageHeader.event[x]**
- missingTypes | reason=Unknown | pattern=CodeableConcept
- extraTypes | reason=Unknown
- shortUnmatched | reason=Unknown | pattern=What service was done | resource=The real world event that triggered this messsage
- definitionUnmatched | reason=Unknown | pattern=A code that identifies the specific service or action that was or is being performed. | resource=Code that identifies the event this message represents and connects it with its definition. Events are defined by codes, or by URIs that identify events, or by reference to EventDefinition or SubscriptionTopic resources that define the event directly. This element is intentionally unbound, and the selection of appropriate event codes is delegated to implementations and implementation guides. For codes, a good set of example codes is found in [the V2 event codes](https://terminology.hl7.org/ValueSet-v2-0003.html).
- **Event.reason** → **MessageHeader.reason**
- missingTypes | reason=Unknown | pattern=CodeableReference(Condition, Observation, DiagnosticReport, DocumentReference)
- extraTypes | reason=Unknown
- shortUnmatched | reason=Unknown | pattern=Why was message header performed? | resource=Cause of event
- definitionUnmatched | reason=Unknown | pattern=Describes why the message header occurred in coded or textual form or Indicates another resource whose existence justifies this message header. | resource=Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.
- commentsUnmatched | reason=Unknown | pattern=Textual reasons can be captured using reasonCode.text.
### Unmapped Elements
- **Event.partOf** — Unknown
- **Event.reported** — Unknown
- **Event.relevantHistory** — Unknown
- **Event.location** — Unknown
- **Event.status** — Unknown
- **Event.subject** — Unknown
- **Event.statusReason** — Unknown
- **Event.performer.actor** — Unknown
- **Event.performer.function** — Unknown
- **Event.note** — Unknown
- **Event.category** — Unknown
- **Event.encounter** — Unknown
- **Event.recorded** — Unknown
- **Event.occurrence** — Unknown
- **Event.product** — Unknown
- **Event.performer** — Unknown
- **Event.identifier** — Unknown
- **Event.basedOn** — Unknown
- **Event.researchStudy** — Unknown
### messageheader-fivews-mapping-exceptions.xml
### Unmapped Elements
- **FiveWs.recorded** — Unknown
- **FiveWs.author** — Unknown
- **FiveWs.cause** — Unknown
- **FiveWs.version** — Unknown
- **FiveWs.witness** — Unknown
- **FiveWs.class** — Unknown
- **FiveWs.where** — Unknown
- **FiveWs.context** — Unknown
- **FiveWs.init** — Unknown
- **FiveWs.identifier** — Unknown
- **FiveWs.source** — source
- **FiveWs.who** — sender
- **FiveWs.grade** — Unknown
- **FiveWs.status** — Unknown
- **FiveWs.planned** — Unknown
- **FiveWs.done** — Unknown