if (log.isDebugEnabled()) {
log.debug("Inside the HL7 formatter" + omElement.toString());
}
if (msgCtx.getFLOW() == MessageContext.OUT_FAULT_FLOW || msgCtx.getEnvelope().hasFault()) {
SOAPFault soapFault = msgCtx.getEnvelope().getBody().getFault();
ACK ack = new ACK();
try {
//TODO : need to complete the values of the complete hl7 message, this will not properly construct by the parser
ack.getMSH().getFieldSeparator().setValue(HL7Constants.HL7_FIELD_SEPARATOR);
ack.getMSH().getEncodingCharacters().setValue(HL7Constants.HL7_ENCODING_CHARS);
ack.getMSA().getAcknowledgmentCode().setValue(HL7Constants.HL7_ACK_CODE_AR);
ack.getERR().getErrorCodeAndLocation(0).getCodeIdentifyingError().getIdentifier()
.setValue("Backend service reject the value");
String msg = new PipeParser().encode(ack);
if (log.isDebugEnabled()) {
log.debug("Generate HL7 error : " + ack);
}