Announcement

Collapse
No announcement yet.

Error converting XML to ER7

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

  • Error converting XML to ER7

    HI, I'm damn new to Mirth. I'm facing an issue while fetching the data from the MYSQL DB and inserting into the HL7V2 message.
    I can connect to the MYSQL DB and I can print the values of the DB into the console, But I receive error"Error converting XML to ER7 & String index out of range: 0"while inserting the data into HL7V2 message.
    I used the following code.

    tmp['PID']['PID.3']['PID.3.1']=201201;
    tmp['PID']['PID.2']['PID.2.1']=msg['patient_1_pid'].toString();
    tmp['PID']['PID.5']['PID.5.1']=msg['patient_1_pname'].toString();
    tmp['PID']['PID.7']['PID.7.1']=msg['patient_1_pdob'].toString();
    logger.info("pid:"+tmp['PID']['PID.2']['PID.2.1']);
    logger.info("pname:"+tmp['PID']['PID.5']['PID.5.1']);
    logger.info("DOB:"+tmp['PID']['PID.7']['PID.7.1']);

    var current_date=DateUtil.getCurrentDate("yyyy/MM/dd/hh:mm:ss");
    tmp['OBR']['OBR.6']['OBR.6.1']=current_date;
    logger.info("OBR.6:"+current_date);
    I can display the data fetched from DB into the Console log But its not inserting into the HL7V2 message. Could you guys help me pls.

    Mirth Interface Engineer
    AWS DevOps

  • #2
    What have you put to the outbound template?

    Make sure the start of the first line is':

    MSH|^~\&||

    not

    MSH|||||||

    Comment


    • #3
      ThankYou Flyerman

      It worked. Thankyou.
      So, It means the HL7 message that we apply in the outbound is not a dummy message for the sake of simplifying the code.. ?

      Mirth Interface Engineer
      AWS DevOps

      Comment

      Working...
      X