Schedule a demo
Segment

Message acknowledgment

Appears as the first functional segment in an acknowledgment (ACK) message, carrying the acknowledgment code (accept, error, or reject) and the message control identifier of the original message being acknowledged. It enables the sending system to correlate the ACK to the original message and determine whether the message was successfully received and processed. It is fundamental to HL7's reliable messaging protocol.

5fields
2required
v2.9HL7 version
msa.py
from zato.hl7v2.v2_9 import MSA

msa = MSA()
msa.acknowledgment_code = 'AA'
msa.message_control_id = 'WELL-CTRL-001'

Build MSA segments in Python

How to construct and work with real-world MSA segments.

1

Wellness order accepted

AA acknowledgment tying back to the original wellness screening message control id

from zato.hl7v2.v2_9 import MSA

msa = MSA()
msa.acknowledgment_code = 'AA'
msa.message_control_id = 'SCREEN-ORD-2024-04'
2

Fitness registration commit accept

CA commit-accept with expected sequence and waiting queue hints for a class enrollment feed

from zato.hl7v2.v2_9 import MSA

msa = MSA()
msa.acknowledgment_code = 'CA'
msa.message_control_id = 'FIT-REG-778'
msa.expected_sequence_number = '12'
msa.message_waiting_number = '4'
msa.message_waiting_priority = 'N'
3

Nutrition intake acknowledged

AA response for a preventive nutrition intake message with sequence number populated

from zato.hl7v2.v2_9 import MSA

msa = MSA()
msa.acknowledgment_code = 'AA'
msa.message_control_id = 'NUTRI-INT-501'
msa.expected_sequence_number = '3'

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

message_control_id in MSA repeats the message_control_id from the original MSH so the receiver can match acknowledgments to outbound wellness or screening messages.

AA accepts the overall message. CA indicates commit-accept semantics when the interface promises durable storage for fitness or nutrition payloads. Partners define which applies to each channel.

Assign the HL70008 table value as a short string, together with the peer control id:

from zato.hl7v2.v2_9 import MSA

msa = MSA()
msa.acknowledgment_code = 'AA'
msa.message_control_id = 'PEER-MSG-001'

expected_sequence_number supports ordered file or batch replays. message_waiting_number and message_waiting_priority describe queue depth when the responder still holds follow-up work for wellness pipelines.

HL7 reserved those slots in older guidance; modern interfaces often leave them blank while using fields 1, 2, 4, 7, and 8 for active data.

Zato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.

Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.

Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.

Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.

MSA field reference

Complete list of fields in the MSA segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
1acknowledgment_codeIDRequiredNoHL70008
2message_control_idSTRequiredNo-
4expected_sequence_numberNMOptionalNo-
7message_waiting_numberNMOptionalNo-
8message_waiting_priorityIDOptionalNoHL70520

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python