From: Chris S. <chr...@ya...> - 2005-09-09 18:34:19
|
I am new to HL7 and HAPI, but was wondering if there is any special handling for the HL7 null value ("") in HAPI. I am using HAPI 0.4.3 and HL7 2.4. From the Health Level Seven Final Standard Version 2.4 chapter 2.7 we have, HL7 does not care how systems actually store data within an application. When fields are transmitted, they are sent as character strings. Except where noted, HL7 data fields may take on the null value. Sending the null value, which is transmitted as two double quote marks (), is different from omitting an optional data field. The difference appears when the contents of a message will be used to update a record in a database rather than create a new one. If no value is sent, (i.e., it is omitted) the old value should remain unchanged. If the null value is sent, the old value should be changed to null. I am assuming that in Java the HL7 null value would be defined as: public static final String HL7_NULL = "\"\""; Is this correct? When constructing a message from a Java object should the message value be set to the HL7_NULL string where ever the Java field is null? Likewise when applying an update should the HL7 message value be tested for this HL7_NULL string and then set the corresponding Java field to null? If the message value is null then leave the Java field as is and do not set it? Thanks Chris __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |