Reference·MSA Segment·MSA-1
HL7 v2 Reference

HL7 v2 MSA-1 (Acknowledgment Code): Format, Values, and Testing Notes

Jul 28, 2026 · 4 min read
MSA-2 →

MSA-1 is a two-character code that decides whether a sending application moves on, retries, or escalates — and it is the single most under-varied value in most ACK test fixtures.

Quick answer

MSA-1 is the Acknowledgment Code, a short coded value telling the sending system whether its message was accepted, produced an error, or was rejected outright. AA means accept, AE means error, and AR means reject, and each one is meant to drive different handling on the sending side.

Valid code values

AA
Application Accept — the message was received and processed successfully — the response most integrations expect on a normal day
AE
Application Error — the message reached the receiving application but could not be processed, often due to a data problem like an unresolved identifier
AR
Application Reject — the receiving application refused to process the message at all, typically because it failed a structural or business-rule check before processing even began

Example

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

MSA-1 (AE) marks this synthetic acknowledgment as an application error, paired with a fabricated control ID and explanatory text.

Where this trips people up

Teams building ACK test fixtures tend to hardcode AA because it's the value every downstream test was written against, so the branches that handle AE and AR — retry queues, alerting, dead-letter routing — sit untested until a real rejection shows up in production. Another common gap: treating AE and AR as interchangeable failure states when receiving systems and interface engines are often built to handle them very differently, one implying a retry might succeed and the other implying it won't without a structural fix.

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
Test every acknowledgment code, not just AA
Synthibase generates synthetic ACK messages spanning AA, AE, and AR outcomes, so your retry and escalation logic gets exercised against real failure modes before go-live.
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.