Null, Empty and Invalid Values
Contents
Null (also referred to as Present But Null), Empty and Invalid values are important concepts in the HL7 world. They are defined as follows:
- Null – A null value is sent to a receiving application when the sender wants to inform the receiver that it has no data for a specific field, subfield, or sub-subfield. Null is expressed using two double quotes. For example:
|""|
- Empty – An empty value is sent to a receiving application when the sender wants to inform the receiver that there is no explicit data for a specific field, subfield, or sub-subfield. Empty is expressed using no value. For example:
||
- Invalid – An invalid value is when incorrect data is inserted in a field, subfield, or sub-subfield. For example, when “XYZ” is inserted in a Date Time field:
|XYZ|
The following table summarizes the results of using null, empty and invalid values with the 5.0 parser engine:
Data Type | Data Type | Result of Insert | Result of Update |
---|---|---|---|
String | <Empty> | Not Inserted | Not Updated |
String | “” | NULL | NULL |
String | <Not Empty> | <Data> | <Data> |
Integer | <Empty> or <Invalid> | Not Inserted | Not Updated |
Integer | “” | NULL | NULL |
Integer | <Not Empty> | <Data> | <Data> |
Double | <Empty> or <Invalid> | Not Inserted | Not Updated |
Double | “” | NULL | NULL |
Double | <Not Empty> | <Data> | <Data> |
Date Time | <Empty> or <Invalid> | Not Inserted | Not Updated |
Date Time | “” | NULL | NULL |
Date Time | <Not Empty> | <Data> | <Data |
Note: If a key field is NULL or Present But Null and one or more columns are empty, an error will occur.
Continue: Reading the Standard