Using the attached sample message, with this JS in a destination transformer step:
....is resulting in this in the log:
0 instance of OBX.5.1 = 279
1 instance of OBX.5.1 = 265
2 instance of OBX.5.1 = 41
3 instance of OBX.5.1 = Test cancelled because triglycerides >250 mg/dL
4 instance of OBX.5.1 = 15
5 instance of OBX.5.1 = undefined
The fourth instance of OBX.5.1 should be null, but we seem to be skipping to the next instance instead, leaving an "undefined" for the last instance. Any ideas what's causing this and how to fix it?
sample_ORU_R01.txt (877 bytes)
Code:
var obxi = 0; while (msg['OBX']['OBX.1']['OBX.1.1'][obxi] != null) { logger.info(obxi + ' instance of OBX.5.1 = ' + msg['OBX']['OBX.5']['OBX.5.1'][obxi]); obxi++; }
0 instance of OBX.5.1 = 279
1 instance of OBX.5.1 = 265
2 instance of OBX.5.1 = 41
3 instance of OBX.5.1 = Test cancelled because triglycerides >250 mg/dL
4 instance of OBX.5.1 = 15
5 instance of OBX.5.1 = undefined
The fourth instance of OBX.5.1 should be null, but we seem to be skipping to the next instance instead, leaving an "undefined" for the last instance. Any ideas what's causing this and how to fix it?
sample_ORU_R01.txt (877 bytes)
Comment