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.
from zato.hl7v2.v2_9 import MSA
msa = MSA()
msa.acknowledgment_code = 'AA'
msa.message_control_id = 'WELL-CTRL-001'How to construct and work with real-world MSA segments.
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'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'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'Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the MSA segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | acknowledgment_code | ID | Required | No | HL70008 |
| 2 | message_control_id | ST | Required | No | - |
| 4 | expected_sequence_number | NM | Optional | No | - |
| 7 | message_waiting_number | NM | Optional | No | - |
| 8 | message_waiting_priority | ID | Optional | No | HL70520 |
Get started with Zato and connect your systems in minutes.