Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Full message out to database using ODBC

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

  • Full message out to database using ODBC

    I am trying to take the full XML message generated by Mirth and put it into a memo field in a table.
    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('sun.jdbc.odbc.JdbcOdbcDriver','jdbc:odbc:IHEData','doug','doug');
    var datastuff = $(message.encodedData);
    var expression = "EXECUTE PROCEDURE UpdateTable('PATIENT','datastuff');";
    var result = dbConn.executeUpdate(expression);
    sends the text "datastuff" to the table (this was a test of the connection).
    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('sun.jdbc.odbc.JdbcOdbcDriver','jdbc:odbc:IHEData','doug','doug');
    var datastuff = $(message.encodedData);
    var expression = "EXECUTE PROCEDURE UpdateTable('PATIENT','"+datastuff+"')";
    var result = dbConn.executeUpdate(expression);
    Sends a null for the datastuff amount, as does
    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('sun.jdbc.odbc.JdbcOdbcDriver','jdbc:odbc:IHEData','doug','doug');
    var datastuff = $(message.encodedData).toString();
    var expression = "EXECUTE PROCEDURE UpdateTable('PATIENT','"+datastuff.toString()+"')";
    var result = dbConn.executeUpdate(expression);
    Similar results with an SQL Insert. Any ideas?

  • #2
    Re:Full message out to database using ODBC

    Tried this and I got the message in XML format.

    Code:
    var msgInXMLFormat = msg;
    logger.info('msgInXMLFormat is:' + msgInXMLFormat);
    Hope it helps!

    Comment

    Working...
    X