Sun HL7 Message Library User's Guide

Changing HL7 Standard Encoding Characters

All HL7 Message Libraries have a predefined list of delimiters, per the definition in the HL7 Standard. If you elect to change the delimiter encoding characters in your HL7 messages, you must change the delimiter in the Message Library from the root node using the Message Library Editor to match the delimiters used in the HL7 message.

The delimiter encoding character field is a fixed-length field of four encoding characters plus the field separator. The fifth (extra) character is necessary for the segment field separator.

If you wish to validate against the encoding characters, modify the prebuilt Collaboration rules as follows:


// first unmarshal the HL7 OTD payload

// then get the encoding character field:

String encodingChars = otdHL7_GENERIC_EVT_1.getMSH().getMsh2EncodingCharacters();

if (!encodingChars.equals(“<customer_encoding_characters>”)) {

validated = false;

ErrorMessage = "Validation Failure: Receiving Facility";

log( LOG_LEVEL_ERROR, "Validate HL7 Message failed: Encoding character field" );

}