To search for messages that have a HL7 that does not end in a "|" do the following.
1. Click on the messages tab, Click the ellipsis, Click on advanced

2. Click on advanced, Click on Insert

3. Click on Customize script

4. Use one of the scripts below.
Script:
var messageLines = StringUtils.splitByWholeSeparator(source.getNode('/'), '\r');
var i = messageLines.length -1;
if (StringUtils.isNotBlank(messageLines[i])) {
i = i--;
}
if (StringUtils.endsWith(messageLines[i], '|')) {
return false;
} else {
return true;
}