web stats
X12 loops - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 01-08-2015, 06:11 AM
ryagnik ryagnik is offline
What's HL7?
Join Date: Nov 2014
Posts: 1
ryagnik is on a distinguished road
Default 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,
Reply With Quote
Old 01-08-2015, 08:15 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
Join Date: Oct 2010
Posts: 7,125
narupley is on a distinguished road

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.
Reply With Quote
Old 10-31-2019, 11:16 AM
vsortiz vsortiz is offline
Mirth Newb
Join Date: Oct 2012
Location: USA
Posts: 8
vsortiz is on a distinguished road

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?

Reply With Quote
Old 10-31-2019, 11:31 AM
jackwhaines jackwhaines is offline
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 250
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines

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

-= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines
Reply With Quote
Old 11-05-2019, 10:49 AM
jack.downes jack.downes is offline
OBX.2 Kenobi
Join Date: Apr 2014
Posts: 67
jack.downes is on a distinguished road
Default 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 (seg.name().toString() == "ST") { // FROM ST
		count = 1;
	if (count == 1) {
	if (seg.name().toString() == "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.
Reply With Quote
Old 11-12-2019, 05:30 AM
RayWalker RayWalker is offline
What's HL7?
Join Date: Aug 2019
Posts: 2
RayWalker is on a distinguished road
Default 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.

Reply With Quote

x12 loops

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 01:55 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation