Reference·AL1 Segment·AL1-4
HL7 v2 Reference

Testing HL7 v2 AL1-4: What Allergy Severity Code Actually Needs to Handle

Jul 27, 2026 · 4 min read
← AL1-3 AL1-5 →

AL1-4 is supposed to tell a clinician how worried to be. In practice it is one of the most inconsistently populated fields in the whole segment, and testing only the fully-populated case means your team has never seen what your system does with the gaps.

Quick answer

AL1-4 is a coded field indicating how severe an allergic reaction is, typically mild, moderate, severe, or unknown. It is frequently left blank in real feeds because many source systems never capture severity in the first place, so test coverage needs to include the blank case as deliberately as the populated one.

Valid code values

SV
Severe — highest-priority value; often drives hard-stop alerting
MO
Moderate — mid-tier severity
MI
Mild — lowest severity tier, still clinically relevant
U
Unknown — explicitly unknown, distinct from the field simply being empty
(empty)
Not populated — extremely common in real feeds; not the same thing as "U" and should be tested separately

Example

Synthetic example Generated by Synthibase
AL1|1|DA|PENICILLIN^PENICILLIN^L|SV|HIVES^ANAPHYLAXIS|20250314

AL1-4 carries "SV", marking this penicillin allergy as severe.

Where this trips people up

Teams frequently collapse "blank" and "U" into the same handling, which is fine right up until someone builds a severity-based sort or alert threshold that treats a blank field as the lowest priority when it should really be treated as unknown risk. If your test data always populates AL1-4, you will never catch the UI defaulting a blank severity to "mild" instead of surfacing it as unassessed. Build fixtures that mix all four coded values with a meaningful share of genuinely empty fields, matching what production feeds actually look like.

HL7 v2 AL1 Segment Guide: Fields, Format, and Testing Gotchas
How to Write EDI Test Cases That Actually Catch Go-Live Failures
HL7 ADT Messages: A01 through A08 Explained
Test the blanks, not just the happy path
Synthibase generates AL1-4 with a realistic mix of severity codes and intentional gaps, so your severity handling gets tested the way production data actually behaves.
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.