Sidebar

Can I remove LinkLogic errors in a preProcess script?

0 votes
286 views
asked May 19, 2017 by brandon-w-8204 (33,270 points)
retagged Feb 8, 2019 by amanda-w-3695
I want QIE to pick up LL errors in an HL7 channel and it errors that '/-/ segment is invalid'. Can I utilitze the pre-process script to strip out the LL error?

1 Answer

0 votes

Here is the pre-process script to remove LL errors:

var preMessageString = new java.lang.String(bytesIn, 'UTF-8');
qie.debug('preMessageString: ' + preMessageString);
var llError = StringUtils.substringBetween(preMessageString, '/-/', '\\-\\');
qie.debug('llError: '+ llError);
preMessageString = StringUtils.replace(preMessageString, '/-/' + llError + '\\-\\\r', '');
qie.debug('afterProcessing: ' + preMessageString);
try {
   qie.parseHL7String(preMessageString);
   bytesOut = preMessageString.getBytes();
} catch (err) {
   qie.debug('error with parsing hl7 string: ' + err);
}
if (bytesOut === null) {  //When null, the message is discarded and no further processing is done
   //todo: when bytesOut = null, set responseBytes to acknowledge the receipt of discarded messages as needed
   responseBytes = new java.lang.String('Replace with valid acknowledgement').getBytes();
}

answered May 19, 2017 by brandon-w-8204 (33,270 points)
edited May 22, 2017 by terrie-g-7436
...