Announcement

Collapse
No announcement yet.

Adding carriage returns with delimeted file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    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!

    Comment

    Working...
    X