Announcement

Collapse
No announcement yet.

HL7 -> transform based on db query -> HL7

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

  • HL7 -> transform based on db query -> HL7

    I have an HL7 messaging coming in.
    I want to take the inbound OBR.2 record and query a database. If the database has a matching OBR.2 record then it adds to the out bound message obx.5. If there isn't a match then an outbound message never happens.

    I'm not great at javascript but below is kind of what I have started and it is giving me a " The content of elements must consist of well-formed character data or markup." error.

    Any help would be much appreciated.

    var Accession_Num = msg['OBR']['OBR.2']['OBR.2.1'].toString();
    var dbConn =
    DatabaseConnectionFactory.createDatabaseConnection ('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sql server://10.0.0.55:1433/raypax','MIRTH','MIRTH');
    var result;
    result = dbConn.executeCachedQuery("select REPORT_TEXT from PACS_T_REPORT_TEXT where EXAM_KEY= Accession_Num");
    result.first();
    var report_text = result.getString("REPORT_TEXT");

    tmp['OBX']['OBX.5']['OBX.5.1']= report_text

  • #2
    var report_text = result.getString("REPORT_TEXT");

    tmp['OBX']['OBX.5']['OBX.5.1']= report_text

    you probably need to encode or escape that in some way or another. (i do not know hl7 well enough to say how)

    Check the reference tab in the transformer to see if any functions there sound applicable. Try putting a log statement in between there and see if it has any funny characters. I'm guessing if report_text has a |,^,&,", etc in there it probably wont go right in the hl7 output.

    Comment


    • #3
      scrapped

      Well, I can't seem to delete this post so I will kind of give my current position. I scrapped trying to configure it this way. I was making it too difficult.

      Comment

      Working...
      X