Filtering out NO-OP messages can be done with the following two steps.
Step 1. On the source node set the ACK response to "From Mapping or Destination Node" Then add the following script to the "Preprocess Received Byte" script window.
bytesOut = bytesIn;
var message = new java.lang.String(bytesIn);
if (StringUtils.equalsIgnoreCase(message, 'no-op')) {
var messageResult = new java.lang.String('MSH|^~\\&|NO-OP');
bytesOut = messageResult.getBytes('UTF-8');
}
Step 2. Add the following script as the first mapping on the channel. This script will delete the invalid NO-OP messages or send an ACK message back for the valid messages.
//Remove invalid NO-OP Messages else send ACK for valid messages
if (StringUtils.equalsIgnoreCase(source.getNode('MSH-3'), 'no-op')) {
qie.warn('NO-OP message discarded');
qie.postMessageResponse("no-op");
message.discard();
} else {
//send ACK for valid messages
var responseMsg = qie.parseHL7String('MSH|^~\\&|');
responseMsg.setNode('MSH-3', source.getNode('MSH-5'));
responseMsg.setNode('MSH-4', source.getNode('MSH-6'));
responseMsg.setNode('MSH-5', source.getNode('MSH-3'));
responseMsg.setNode('MSH-6', source.getNode('MSH-4'));
responseMsg.setNode('MSH-7', qie.formatDate('yyyyMMddhhmmss'));
responseMsg.setNode('MSH-8', source.getNode('MSH-8'));
responseMsg.setNode('MSH-9', 'ACK');
responseMsg.setNode('MSH-10', qie.formatDate('yyyyMMddhhmmssSSS'));
responseMsg.setNode('MSH-11', source.getNode('MSH-11'));
responseMsg.setNode('MSH-12', source.getNode('MSH-12'));
responseMsg.setNode('MSA-1', 'AA');
responseMsg.setNode('MSA-2', source.getNode('MSH-10'));
qie.postMessageResponse(responseMsg);
}
Step 1 Screen Shot:

Step 2 Screen Shot:
