Replies: 1 comment 2 replies
-
I don't understand your question. ECMA-4 was never adopted. And Mirth uses e4x, an extension to ECMA to support XML. And the syntax is typically: for each (mrn in msg['PID']['PID.3']) {
logger.info(mrn['PID.3.1'].toString())
} If you want to use a for, then you need to do that with a length. for (var i = 0; i < msg['PID']['PID.3'].length; i++) {
logger.info(msg['PID']['PID.3'][i]['PID.3.1'].toString())
} There are advantages to using for each, including when you delete elements. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I realized something recently, we are generally using for each statements rather that for statements for iterating hl7 messages. Why is that? for each is long deprecated from ecma 4. Isn't there a better way to iterate?
Beta Was this translation helpful? Give feedback.
All reactions