web stats
Help for beginner in creating mirth transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2013, 02:18 AM
curiousxavier curiousxavier is offline
What's HL7?
 
Join Date: Feb 2013
Posts: 3
curiousxavier is on a distinguished road
Question Help for beginner in creating mirth transformer

I am new to the development of Mirth channel transformer.

Can any one of you please say how to Process more the one patients Insurance details from IN1 segment.

A file contains more than one patients' records with all segments.

Please do say, how to process the segments with java script.

I came across a code like this

"for each (in1 in msg..IN1)"

What does this mean actually.

Thanks in advance.
Reply With Quote
  #2  
Old 02-04-2013, 10:19 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by curiousxavier View Post
I am new to the development of Mirth channel transformer.

Can any one of you please say how to Process more the one patients Insurance details from IN1 segment.

A file contains more than one patients' records with all segments.

Please do say, how to process the segments with java script.

I came across a code like this

"for each (in1 in msg..IN1)"

What does this mean actually.

Thanks in advance.
"for each (in1 in msg..IN1)" means that E4X is going to iterate through each descendant node of msg whose QName is "IN1" and for each iteration a local variable in1 will be assigned to the descendant node. In this way you can perform whatever logic you want across all "IN1" nodes (i.e. all IN1 segments of an HL7 v2.x message).
__________________
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
  #3  
Old 02-06-2013, 08:35 PM
curiousxavier curiousxavier is offline
What's HL7?
 
Join Date: Feb 2013
Posts: 3
curiousxavier is on a distinguished road
Smile

MSH|^~\&|Medical Manager|VISION CENTER|||20090202080229||ADT^A08|0|P|2.3.1
EVN|A08|20090202080229|||
PID|1|MM005|MM005||HANSON^FRANK^L||19420414|F|||12 358 EASTFORK RD^^RIVERCITY^AL^36541||(251)555-1222|||U|||123456789|||||||||||
PV1|1||||||||||||||||||||||||||||||||||||||||||||| 0
GT1|1||HANSON^FRANK^L||12358 EASTFORK RD^^RIVERCITY^AL^36541|(251)555-1122||19420414|F||
IN1|1|696|696|HEALTHSPRING OF ALABAMA|^PO BOX 20000^NASHVILLE^TN^37202|PO BOX 20000|(800)952-1992|AL007481F|AL007481F|||20080101||||MILLS^FRANK IE^L|S|19420414|12358 HENDERSON CAMP RD^GRAND BAY^AL^36541|||||||||||||||||77501141801|||||||||| |||7501141801
IN1|7|1117|1117|BLOCK VISION|CLAIMS DEPARTMENT^120 W FAYETTE ST, STE 700^BALTIMORE^MD^21201|120 W FAYETTE ST, STE 700|(866)819-4298|AL007481F|AL007481F|||20080101|||VS|MILLS^FRA NKIE^L|S S|19420414|12358 HENDERSON CAMP RD^GRAND BAY^AL^36541|||||||||||||||||77501141801|||||||||| |||7501141801

MSH|^~\&|Medical Manager|VISION CENTER|||20090204080229||ADT^A08|0|P|2.3.1
EVN|A08|20090204080229|||
PID|1|MM006|MM006||WILSON^SUSAN^L||19461026|F|||80 58 RIVERVIEW DR^^THEODORE^AL^36582||(251)555-9876|(251)555-1234||U|||123456789|||||||||||
PV1|1|||||||123^Sanders^Donald|||||||||||||||||||| ||||||||||||||||||251
GT1|1||WILSON^SUSAN^L||8058 RIVERVIEW DR^^THEODORE^AL^36582|(251)555-1234|(251)555-9876|19461026|F||
IN1|1|696|696|HEALTHSPRING OF ALABAMA|^PO BOX 20000^NASHVILLE^TN^37202|PO BOX 20000|(800)952-1992||||||||||S|||||||||||||||||||77444597001||||| ||||||||
IN1|2|1117|1117|BLOCK VISION|CLAIMS DEPARTMENT^120 W FAYETTE ST, STE 700^BALTIMORE^MD^21201|120 W FAYETTE ST, STE 700|(866)819-4298||||||||VS||SS|||||||||||||||||||77444597001|| |||||||||||












the above content is available in My HL7 file.

The below code loops through for each PID.
for(i=0; i<msg["PID"].length(); i++)
{

.............some logics here.........................

for each (in1 in msg..IN1)
{

if(insuranceCount != j)
{
insuranceCount = insuranceCount -1;
continue;
}
var setID = in1['IN1.1']['IN1.1.1'];
logger.info(setID.toString();
}


.............. continue other logics.....................
}


My question is simple.
Will "for each (in1 in msg..IN1)" this statement loop through ALL IN1 segments in this file.
If not , could please describe how this would be parsed or processed using the above code.


Ultimate reason for this code is to find all Insurance setID of a patient, because a patient may have more than one Insurance.
So First patient should have 2 insurance set of values, and Second patient must have 2 insurance records.

i guess the first iteration of "for(i=0; i<msg["PID"].length(); i++)" loop goes through 2 insurance records, and next iteration loops through other 2 records.

Please do help me asap, with sample source code.


(If possible , pls do mail me => francisbiit@gmail.com)

Last edited by curiousxavier; 02-06-2013 at 08:39 PM.
Reply With Quote
Reply

Tags
create transformer, mirth channel, transfomer

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 05:03 PM.


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