Skip to content
The Path

Module 3 · Message types·9 min

Trigger events and responses

A real-world event triggers a message that expects a reply. What MSH-9 means.

In a hospital, nothing gets sent by chance. A patient arrives, a doctor places an order, a result is ready: each time, something real happens and one system has to tell the others. HL7 calls that fact a trigger event. Every message starts there.

Here is the message the Leleux Clinic patient record sends when Marie Dubois is admitted for her night at the sleep lab. Click MSH-9.

The patient record tells the sleep lab that Marie Dubois has just been admitted for the night.

ADT^A01^ADT_A01· Patient admit
||||||||||
||||||
||||||||
|||||||

A real event, a message

The standard starts from a simple idea: something happening in the real world creates a need to move data. The patient is admitted, so pharmacy, lab and billing need to know. Her polysomnography result is ready, so her record needs to receive it.

The system where the event happens takes the initiative and sends. HL7 calls this an unsolicited update: a message nobody asked for at that moment. It is by far the most common case.

MSH-9: three components, three questions

The message type lives in MSH-9. In v2.5.1 it has three components, all required:

Component Question Example HL7 table
MSH-9.1 message code Which family? ADT 0076
MSH-9.2 trigger event What happened? A01 0003
MSH-9.3 message structure What shape is the message? ADT_A01 0354

The code gives the family: ADT for patient movements, ORU for results. The event gives the precise fact: A01, an admission. The structure says which segments to expect, in which order.

The receiver reads MSH-9 before anything else. It tells the receiver how to split the rest and where to route the message.

One event, one structure, not always the same name

The third component is surprising at first. Several events share the same message shape. An admission (A01), an outpatient registration (A04), an update (A08) and a canceled discharge (A13) all use the ADT_A01 structure.

Real-world event MSH-9
The patient is admitted ADT^A01^ADT_A01
She comes for a consultation, no bed ADT^A04^ADT_A01
Her address changes ADT^A08^ADT_A01
A test order is created ORM^O01^ORM_O01
A result is available ORU^R01^ORU_R01

Remember this: the event says what happened, the structure says how it is laid out. Never infer the event from the structure.

Try it: in this message, replace A01 with A04 in MSH-9 and watch the plain-language summary change. The structure stays ADT_A01. Then spot the odd ones out: two fields now tell a different story from MSH-9. Which ones?

The same message, editable: change the event and see what moves.

ADT^A01^ADT_A01· Patient admit
||||||||||
||||||
||||||||
|||||||

Answer: EVN-1, which still says A01, and PV1-2, which is I (inpatient) when an A04 is for an outpatient (O). Change the event and you change the story: the whole message has to follow.

The message expects a reply

Sending is not enough. The sender wants to know whether the receiver got the message and processed it. So it waits for an acknowledgement, the ACK message. Here is the one the sleep lab sends back.

The sleep lab confirms to the patient record that it received and accepted the admission.

ACK^A01^ACK· Acknowledgement
||||||||||
||

Three details to spot:

  • MSH-9 is ACK^A01^ACK: an acknowledgement, replying to an A01 event.
  • MSA-1 is AA: accepted.
  • MSA-2 is MSG00042: the MSH-10 of the original message. Without that link, the sender could not tell which message was just confirmed.

HL7 v2 offers two ways to reply. In original mode, the receiver sends back a single acknowledgement (AA, AE or AR). In enhanced mode, it can first confirm that it stored the message safely, then send an application acknowledgement later. MSH-15 and MSH-16 say which mode applies: left empty, it is original mode. The codes get their own lesson in the acknowledgements chapter.

Unsolicited or query

Not every exchange starts from a real-world event. Sometimes a system needs information and asks for it. That is a query: a question message, then a response message.

An example from the patient chapter: QBP^Q22 (“find the candidates that match”) and its response RSP^K22. The sleep lab could use it to search the patient index for every Marie Dubois born in 1985.

Unsolicited update Query
Who starts? The system where the event happens The system that needs to know
Example ADT^A01, ORU^R01 QBP^Q22
Reply an ACK a response message, here RSP^K22

In day-to-day interfaces, unsolicited updates dominate. Most feeds you will meet are ADT, orders and results that go out on their own.

And in FHIR?

FHIR mostly works through web calls, without messages. When its messaging is used, though, the event sits in MessageHeader.eventCoding. The official v2-to-FHIR mapping guide sends MSH-9 exactly there.

Check your understanding

1 of 4

You receive a message with MSH-9 = ADT^A04^ADT_A01. What does the third component, ADT_A01, tell you?

+50 XPPass the quiz (3 correct answers) to complete the lesson.

Reviewed and checked on 27 September 2026