Announcement

Collapse
No announcement yet.

Preprocessor to Batch File error

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

  • Preprocessor to Batch File error

    I'm using a preprocessor script to take a nonHL7 file (containing multiple messages) and put it into an HL7 format (that I want to be multiple HL7 messages). I can get the HL7 message created and the data in the slots I need, but I cannot get Mirth to process the file I created as a batch file...it wants to put everything into a single file.

    I have Process Batch Files at Yes.
    I have Source Filter and Transformer Convert LF to CR enabled.

    I've tried all different combinations of 0D and 0A hex characters but it still puts everything in a single file.

    Here's my preprocessor script. Any ideas?
    Thanks,
    Matt

    var spmsg = message.split(" MR#");
    for( var i = 0; i<spmsg.length; i++ )
    {
    var spmsg2 = spmsg[i].split("\n");
    spmsg[i] ="\x0D\x0A"+
    "MSH|^~\\&|||||||ORU^R01||P|2.3|||||||"+"\x0D" +
    "PID||1|2||||||||||||||||||||||||||||"+"\x0D"+
    "ORC|1|||||||||||||||||||"+"\x0D"+
    "OBR|1|||||||||||||||||||||||||||||||||||||||||||" +"\x0D"+
    "OBX|1|||||||||||||||||"+"\x0D"+
    "NTE|||"+spmsg2[0];
    }
    return spmsg.join("")+'\x0D';
Working...
X