No announcement yet.

X12 loops

  • Filter
  • Time
  • Show
Clear All
new posts

  • X12 loops


    I would like to know does mirth has any support to understand the loops ? how does it understand LOOP 2000,2100,2100 loops ?

    I searched in to this forum,internet and could not find anything on it, so my understanding is that we need to write custom logic to understand this loops.

    But, if any body has example / link , please provide it.

    Thanks for all your help,

  • #2
    The X12 parser does not yet handle loops, but that doesn't prevent you from handling them manually in JavaScript. That's on our roadmap to improve in future versions.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

    - How do I foo?
    - You just bar.


    • #3
      Hi NaRupley!

      Do you know if this loop request is in the roadmap somewhere? Jira or something? Any clue if/when it will be implemented?



      • #4
        @vsortiz, I still have to do them by hand... sucks, but I know it works!

        -= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
        -= [email protected]
        -= Mirth Connect (Advanced)-certified
        -= Gold member of
        -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at


        • #5
          for me the most important part of X12...

          is to reset the count after you do all your modifications. this is ALWAYS at the bottom of my X12 work:

          var segcount = 0;
          var count = 0;
          for each (seg in msg.children()) {
          	if ( == "ST") { // FROM ST
          		count = 1;
          	if (count == 1) {
          	if ( == "SE") { // THROUGH SE.
          		count = 0;
          msg['SE']['SE.01']['SE.01.1'] = segcount;
          // save your changes
          hl7_xml = msg;
          Now, I've only been working with EDI 270/271 for a few locations, but I'll be digging into the other stuff later... fun stuff financial and insurance lookups... yippee.


          • #6
            EDI X12 - sample 270/835/837/999 channels (v3.6)

            Hello Vivian and Rashi,

            I recently had requirements for a number of x12 channels in the healthcare integration space and I too had some difficulty but as Nick and Jack indicated it is easily possible using javascript in Mirth.

            If you've exhausted all resources, please reach out to me and I'll dig them up and post them for you.