1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
600 views
by ramaswamy-s-6353 (440 points)
Do you a code snippet for combining multiple OBXs into single OBX by seperating the OBX 5 values using ~ or some other character?

1 Answer

+1 vote

Here is a sample code to combine OBX-5 and remove extra OBX segments

var obx5Values = source.getAllNodes('OBX-5');
var newObx5Value = '';
for (var i = 0; i < obx5Values.length; i++) {
   if (i !== 0) {
      newObx5Value += ' ~ ';
   }
   newObx5Value += obx5Values[i];
}
 
message.removeAllNodes('OBX');
message.setNode('OBX-5', newObx5Value);
by brandon-w-8204 (34.1k points)
...