HL7 204 — Unknown key identifier
Code 204 means a key the receiver looked up — such as a patient identifier, visit number, or order number — was not found in the receiving system.
When you see 204 (Error Condition Code)
Raised for update/result/order messages that reference an existing record the receiver cannot locate, such as an ORU result for a patient or order that was never registered downstream.
Common causes
- An ADT update (A08) or result (ORU) arrives before the original admit/registration (A01/A04) created the record.
- Patient identifier (PID-3) or visit number (PV1-19) mismatch between systems.
- Out-of-order delivery — the create message is queued behind the update.
- Identifier assigning-authority mismatch so the same patient looks like two different keys.
How to fix it
- 1Confirm the referenced record exists in the receiver and that the identifier and its assigning authority match exactly.
- 2Check message sequencing — ensure create messages (A01/A04, new orders) are processed before updates/results that depend on them.
- 3Add identifier cross-referencing (EMPI/MRN mapping) if the two systems use different patient identifiers.
Example ACK message
A representative acknowledgment carrying ERR-3 = 204. Open it in the HL7 Viewer to inspect every field.
1MSH||^~\&|RECEIVER|HOSP|SENDER|HOSP|20260310143520||ACK^R01^ACK|ACK00024|P|2.5.1 2MSA||AE|MSG00001|Unknown key identifier 3ERR||||204^Unknown key identifier^HL70357|E|||PID.3 MRN '123456' not found
Related codes
Code 205 means the receiver rejected a create because a record with the same key already exists — for example admitting a patient or creating an order that is already on file.
Code 103 means a coded field contained a value that is not in the table the receiver uses for that field — for example an unrecognized gender, marital status, or facility code.
Frequently asked questions
What causes HL7 error code 204?
Code 204 (Unknown key identifier) means the receiver could not find a referenced record — typically a patient MRN or visit number. It often happens when an update or result arrives before the create message, or when identifiers/assigning authorities mismatch between systems.
Debug your ACK in the viewer
Paste the ACK (or original message) and get instant segment parsing, MSA/ERR decoding, and validation. Free, client-side, no signup.
Open HL7 Message Viewer →All HL7 error & ACK codes
Browse every acknowledgment code (Table 0008) and error condition code (Table 0357) with causes, fixes, and examples.
HL7 Error Code Reference →