HL7 102 — Data type error
Code 102 means a field contained a value of the wrong data type — for example text where a number or a properly formatted date/timestamp was expected.
When you see 102 (Error Condition Code)
Raised when a field's content does not match its defined HL7 data type, such as a malformed date (DTM/TS), a non-numeric value in a numeric (NM) field, or a bad component structure.
Common causes
- A date/time field is not in HL7 format (YYYYMMDD or YYYYMMDDHHMMSS) — e.g. MM/DD/YYYY was sent.
- A numeric (NM) field contains letters, units, or stray characters.
- A coded element (CE/CWE) has its components in the wrong order or count.
- A free-text value contains unescaped HL7 delimiters.
How to fix it
- 1Identify the field from ERR-7/ERR-8 and confirm its expected HL7 data type in the segment reference.
- 2Reformat dates to YYYYMMDD[HHMMSS], strip units/letters from numeric fields, and escape delimiter characters (\F\, \S\, etc.).
- 3Add a transformation step to normalize the data type before the message leaves the sending interface.
Example ACK message
A representative acknowledgment carrying ERR-3 = 102. Open it in the HL7 Viewer to inspect every field.
1MSH||^~\&|RECEIVER|HOSP|SENDER|HOSP|20260310143420||ACK^A01^ACK|ACK00012|P|2.5.1 2MSA||AE|MSG00001|Data type error 3ERR||||102^Data type error^HL70357|E|||PID.7 (DOB) '03/15/1985' is not a valid HL7 date
Related codes
Frequently asked questions
What does HL7 error code 102 mean?
Code 102 (Data type error) means a field value does not match its expected HL7 data type — most commonly a date not in YYYYMMDD format or non-numeric text in a numeric field. Reformat the value to the correct type and resend.
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 →