Announcement

Collapse

Mirth Connect 4.1.0 Released!

Mirth Connect 4.1.0 is now available as an appliance update and on our GitHub page. Mirth Connect 4.1.0 includes new features such as new event log messages, additional fields to the Welcome to Mirth Connect screen, new information included in alerts as well as many smaller changes, updates, and improvements. This release also contains several 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