HL7 v2 AL1 Segment Guide: Fields, Format, and Testing Gotchas
A missing or malformed AL1 segment sounds like a formatting nitpick until you remember what it represents: the difference between a clinician seeing "penicillin allergy" on screen and not seeing it at all. Test teams tend to under-invest in AL1 coverage because it looks like a short, simple segment. It is short. It is not simple to get right.
AL1 carries one allergy record per instance: a sequence number, the type of allergen, the allergen itself, how severe the reaction is, what the reaction looks like, and when it was identified. A single ADT or ORU message can carry multiple AL1 segments, one per known allergy, and most of the real-world bugs come from teams assuming there will only ever be one.
The fields that actually matter in practice
Example
A synthetic AL1 segment describing a severe penicillin (drug) allergy identified on March 14, 2025. Every value here is fabricated for testing purposes.
Where this trips people up
The single most common AL1 defect in test environments is treating it as a singleton segment. Real patients frequently have three, five, sometimes a dozen recorded allergies, and if your test data generator only ever emits one AL1 per message, you will never exercise the parsing loop, the sequence-number handling, or the UI list rendering that has to display them all. The second most common issue is allergen coding: many source systems free-text AL1-3 instead of sending a coded value, so a test suite built entirely on clean coded examples will pass in staging and then choke the first time a real feed sends "PCN" or "NKDA" as a bare string. Also worth remembering: newer HL7 v2 versions favor the IAM segment for allergy information, so if you're testing against a system on 2.6 or later, confirm which segment is actually in play before you build fixtures around AL1.