Reference·MSA Segment·MSA-2
HL7 v2 Reference

MSA-2 in HL7 v2: A Field Guide to Message Control ID

Jul 28, 2026 · 4 min read
← MSA-1 MSA-3 →

MSA-2 is the only thing tying an ACK to the message it is acknowledging — get this value wrong, or generate it independently instead of copying it from the source message, and correlation logic silently breaks.

Quick answer

MSA-2 is the Message Control ID field. It carries the exact same value that appeared in MSH-10 of the original message being acknowledged, so the sending system can match this ACK to the specific outbound message it sent, even when many messages are in flight at once.

What this field contains

Format
String, sender-defined — no fixed structure is imposed by the acknowledging system — it must simply reproduce the sender's original MSH-10 value verbatim
Source
Copied from MSH-10 — the receiving system reads the control ID off the inbound message and echoes it back rather than generating a new one
Common failure
Mismatched or regenerated IDs — if the acknowledging system generates its own ID instead of copying the original, sender-side correlation breaks even though the ACK looks superficially valid

Example

Synthetic example Generated by Synthibase
MSA|AE|SYNTHIB00045821|Patient identifier not found in master index

MSA-2 (SYNTHIB00045821) is a fabricated control ID standing in for the value that would have come from MSH-10 on the original message.

Where this trips people up

It's easy to build a test harness that generates ACK messages with a freshly minted MSA-2 value instead of pulling it from the inbound MSH-10, since both are just strings and nothing about the message structure forces them to match. That difference is invisible until a sending system tries to correlate the acknowledgment with its outbound queue and comes up empty, which usually surfaces as messages that appear to hang forever waiting on a response that technically already arrived.

HL7 v2 MSA Segment Guide: Fields, Format, and Testing Gotchas
EDI 999 vs 997: What's the Difference and Why It Matters
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Keep acknowledgments correctly correlated in test data
Synthibase threads matching control IDs from source message to acknowledgment across your synthetic message sets, so correlation logic gets a genuine test instead of a false pass.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.