I'm new to mirth and trying to loop over all the hl7 message headers in mirth, I know that I can loop over one header like this:
for each(var OBX in msg['OBX']) {
logger.info('message OBX obj: ' + OBX['OBX.3']['OBX.3.2'].toString());
}
but what I need is to loop over all the headers not one so I'm trying to do something like this:
for each(var header in msg) {
logger.info('message header: ' + header.toString());
}
for each(var header in msg['HL7Message']) {
logger.info('message header: ' + header.toString());
}
but this is not working and also I can't convert the hl7 to json please help and many thanks in advance.
i have found a way to loop over, the msg variable is the current instance of the inbound message
some useful links: