//Gets all OBX segments as an Array
var obxSegments = message.getAllNodes('OBX');
//Loops through each OBX segment individually
for (var i = 0; i < obxSegments.length; i++) {
//Gets the individual OBX segment and stores in a variable and;
//converts it to an HL7 object.
var obxSeg = qie.parseHL7String(obxSegments[i]);
//Because the obxSeg has been converted to an HL7 object all;
// of the functions in the code wizard now work on the new object.
// in this case obxSeg.getNode works the same as message.getNode.
var obx5 = obxSeg.getNode('OBX-5');
//Checks to see if OBX-5 is blank using stringUtils which
// is "Type" aware (ie. string, number) and Null safe.
if (StringUtils.isBlank(obx5)) {
//If OBX is Null of empty then this line of code will execute.
message.setNode('OBX-5', 'someValue', (i+1));
}
}