Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   trouble in mapping to a variable (http://www.mirthcorp.com/community/forums/showthread.php?t=10135)

Renzo_Passolini 02-27-2014 11:35 AM

trouble in mapping to a variable
 
Hi
I have to map to the following.

@PID.3.1^71604~@PID.3.4^958~@PID.3.5^NHC

where 71604 should be my variable

I have done the following
variable numerodehistoria = msg['QRD']['QRD.8']['QRD.8.1'].toString()

so it looks like

@PID.3.1^${numerodehistoria}~@PID.3.4^958~@PID.3.5 ^NHC

but the output fails, doesn't map.

I have do a search, and I have found that I have to click on "parse subcomponents", but does not work. I think it is because it is in between "^" and "~"

How can I sort it? thanks in advance

narupley 02-27-2014 12:27 PM

If you have field repetitions (denoted by the "~"), then you should check Parse Field Repetitions, and then update your JavaScript to point to the right field (or iterate through multiple fields).

Renzo_Passolini 02-27-2014 12:46 PM

Sorry, I dont understand that:
...and then update your JavaScript to point to the right field

Does it mean I have to code it in javascript?

narupley 02-27-2014 12:52 PM

Quote:

Originally Posted by Renzo_Passolini (Post 37839)
Sorry, I dont understand that:
...and then update your JavaScript to point to the right field

Does it mean I have to code it in javascript?

No you don't have to; if you know a specific field that you want to pull data from then you can still just use a Message Builder or Mapper step. Those step types don't currently handle repeating fields automatically though.

Renzo_Passolini 02-27-2014 12:57 PM

yes, the inbound message is
QRD||R|I|1|||1^RD|167112|DEM\r

So I map it as
variable numerodehistoria = msg['QRD']['QRD.8']['QRD.8.1'].toString()

¿Am I right?

Renzo_Passolini 03-02-2014 04:02 PM

mapper doesnt run

I use message builder, tmp['QPD']['QPD.3'][0] mappig msg['QRD']['QRD.8']['QRD.8.1'].toString()

but the output is @~@PID.3.4^958~@PID.3.5^NHC, so is "eating" a repeater...


All times are GMT -8. The time now is 08:54 AM.

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