web stats
Adding carriage returns with delimeted file - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2009, 02:37 PM
lahoov lahoov is offline
Mirth Newb
 
Join Date: Sep 2009
Posts: 10
lahoov is on a distinguished road
Default Adding carriage returns with delimeted file

I'm trying to take a HL7 file and change it to a delimited file.

It works fine, but now I'm trying to create extra rows in my delimited file when I have repeating segments in my hl7 file.

Ex. Say I have multiple AL1 segments, and I want to create a row in the delimeted file for each Al1.

I have a source javascript step that does all the manipulation. Here's a snippet:
for each (ms in msg..MSH)
{
for each (al in msg..AL1)
{
tmp['row']['column1'][count2] = msg['MSH']['MSH.3']['MSH.3.1'][count].toString()
tmp['row']['column2'][count2] = msg['PID']['PID.3']['PID.3.1'][count].toString()
tmp['row']['column3'][count2] = msg['AL1']['AL1.2']['AL1.2.1'][count2].toString()
tmp['row']['column4'][count2] = "\r'

count2++;
}
count++;
}

This works fine except in my file, the \r is changed to the OA but has douple quotes around it.
So it would look like
abc|123|allergy1|"box"
abc|123|allergy2|"box"
Where box is the special character representation of the 0A.

Any ideas on how to accomplish this?
Reply With Quote
  #2  
Old 09-09-2009, 11:18 PM
lahoov lahoov is offline
Mirth Newb
 
Join Date: Sep 2009
Posts: 10
lahoov is on a distinguished road
Default

Figured it out.
I needed the following:
var temp = tmp['row'];

tmp['row'][count2] = temp;

Thanks to the forum for providing the data I needed!
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:45 AM.


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