Understanding HL7 v2 RXA-21: Action Code in Practice
RXA-21 tells the receiving system what to do with the record, not just what happened clinically. Get delete handling wrong here and a corrected message can leave a duplicate dose sitting in someone's immunization history.
RXA-21 is the Action Code, indicating whether the receiving system should add, update, or delete the administration record described by the segment. It is most often seen in immunization registry feeds where a prior submission needs to be corrected or retracted.
Valid code values
Example
RXA-21 holds A, marking this synthetic administration as a new record to add.
Where this trips people up
Delete and update handling is the part of RXA-21 that almost never gets tested, because it requires simulating a prior message that the new one is supposed to reconcile against — most generators only ever produce standalone "A" segments. A receiving system that doesn't correctly match a "D" action back to the original record by its identifying fields will either silently ignore the delete or, worse, remove the wrong administration entirely, and neither failure shows up until a registry audit flags a mismatch.