1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
439 views
by douglas-l-4571 (190 points)
var gt1Segments = message.getAllNodes('GT1');

//Loops through each GT1 segment individually
for (var i = 0; i < gt1Segments.length; i++) {
   var gt1Seg = qie.parseHL7String(gt1Segments[i]);
   var gt16 = gt1Seg.getNode('GT1-6');
   if (StringUtils.contains('gt16'), '(000)') {
      message.setNode('GT1-6',  '', (i+1));
   }
}

1 Answer

0 votes
The error is in the first parameter of the StingUtils.contains.

The frist parameter should be the varialble of gt16 instead of a string.

var gt1Segments = message.getAllNodes('GT1');

//Loops through each GT1 segment individually
for (var i = 0; i < gt1Segments.length; i++) {
   var gt1Seg = qie.parseHL7String(gt1Segments[i]);
   var gt16 = gt1Seg.getNode('GT1-6');
   if (StringUtils.contains(gt16, '(000)')) {
      message.setNode('GT1-6',  '', (i+1));
   }
}
by gary-t-8719 (15.1k points)
...