web stats
Creating repeat segment - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2015, 05:08 AM
jarlrmai jarlrmai is offline
Mirth Newb
 
Join Date: Jul 2015
Posts: 23
jarlrmai is on a distinguished road
Default Creating repeat segment

I have this code

Code:
logger.info("No PV1.17 copy PV1.9");

tmp['PV1']['PV1.17'] = msg['PV1']['PV1.9']; //duplicate-strip

var newPV17 = new XML('<PV1.17/>');				
newPV17['PV1.17.1'] = globalMap.get('consultantcodeMap').get(msg['PV1']['PV1.9']['PV1.9.1'].toString().substr(0,8));
newPV17['PV1.17.9'] = "TCPAS";
tmp['PV1'][0]['PV1.17'][1] += newPV17;
My expectation is that it should clone PV1.9 over the top of PV1.17 then add a second PV1.17 segment with the 2 fields from the array lookup and the string but it just seems to add the XML at the end of the PV1 segment to PV1.60 which isnt even in the template.

Any ideas?

Last edited by jarlrmai; 08-11-2015 at 06:25 AM.
Reply With Quote
  #2  
Old 08-12-2015, 02:01 AM
jarlrmai jarlrmai is offline
Mirth Newb
 
Join Date: Jul 2015
Posts: 23
jarlrmai is on a distinguished road
Default

Okay I figured out a bit more

tmp['PV1']['PV1.17'] = msg['PV1']['PV1.9']; //duplicate-strip

This just replaces the section so 9 just ends up in the XML. but in the same position that 17 was.

What I need to do is take each field in PV1.19 and make it into a PV1.17 section

What's happening at the moment is:

Code:
   <PV1.13/>
        <PV1.14/>
        <PV1.15/>
        <PV1.16/>
        <PV1.9>
            <PV1.9.1>C9999998.110</PV1.9.1>
            <PV1.9.2>Orthopaedic</PV1.9.2>
            <PV1.9.3>A</PV1.9.3>
            <PV1.9.4>""</PV1.9.4>
            <PV1.9.5/>
            <PV1.9.6>Unknown</PV1.9.6>
            <PV1.9.7/>
            <PV1.9.8/>
            <PV1.9.9/>
            <PV1.9.10/>
            <PV1.9.11/>
            <PV1.9.12/>
            <PV1.9.13>Consultant</PV1.9.13>
        </PV1.9>
        <PV1.18/>
Reply With Quote
Reply

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 07:26 AM.


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