Reference·AL1 Segment·AL1-2
HL7 v2 Reference

HL7 v2 AL1-2 Field Guide: Allergen Type Code Values and Common Mistakes

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

AL1-2 decides which bucket an allergy falls into before anyone even looks at what the allergy actually is. Get this field wrong in test data and you end up validating only the drug-allergy code path while food, environmental, and latex allergies quietly go untested.

Quick answer

AL1-2 is a coded field that classifies the type of allergy being reported: drug, food, environmental, latex, animal, plant, or miscellaneous. Systems often use this code to route the allergy toward different alerting or display logic, which makes it worth testing across every value, not just the common ones.

Valid code values

DA
Drug allergy — the most commonly seen value in test fixtures; also the most over-represented one
FA
Food allergy — frequently under-tested despite being extremely common in real populations
EA
Environmental allergy — pollen, dust, and similar triggers
LA
Latex allergy — high clinical importance in procedural and surgical settings
AA
Animal allergy — less common in feeds but still valid
PA
Plant allergy — rarely exercised in test suites; good candidate for edge-case coverage
MA / MC
Miscellaneous allergy / contraindication — catch-all values that some systems overuse, which is itself worth flagging in review

Example

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

AL1-2 carries "DA", classifying this as a drug allergy.

Where this trips people up

Test suites built from a handful of hand-copied sample messages almost always skew toward "DA" because that is the example everyone remembers. If your synthetic data never includes FA, EA, LA, AA, or PA, you will not find out until production that your allergy-display component only styles drug allergies correctly, or that your alerting rules silently ignore food allergies because nobody ever fed one through the pipeline. It is also worth testing an unrecognized or unmapped code value, since some interfaces fail closed and others fail open when they hit a type code they do not recognize.

HL7 v2 AL1 Segment Guide: Fields, Format, and Testing Gotchas
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Regression Testing for EHR Upgrades: A Complete Guide
Cover every allergen type, not just the common one
Synthibase varies AL1-2 across drug, food, environmental, latex, and other allergy types automatically, so your test coverage matches real-world diversity instead of copy-pasted samples.
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.