1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
421 views
by brandon-w-8204 (34.1k points)
retagged 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();
}

by brandon-w-8204 (34.1k points)
edited by terrie-g-7436
...