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

JavaScript msg reference problem

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

  • JavaScript msg reference problem

    I have a channel defined with Database Writer destination. I am using JavaScript in the destination connector. It works fine when I create Destination Mappings from my HL7 source file. The following code snip successfully writes to my database:
    Code:
    lSQL = "insert into HL7MSH (MessageId, SendingApplication) ";
    lSQL += "values (" + mID + ", " 
    lSQL += "'" + $('msh_SendingApplication') + "') ";
    var result = dbConn.executeUpdate(lSQL);
    Now I need to implement code for repeating segments. All examples I've seen for doing this on the forum seem to reference the message segments directly:
    Code:
    lSQL = "insert into HL7MSH (MessageId, SendingApplication) ";
    lSQL += "values (" + mID + ", " 
    lSQL += "'" + msg['MSH']['MSH.3']['MSH.3.1'].toString() + "') ";
    var result = dbConn.executeUpdate(lSQL);
    But when I attempt to do this I get the error ReferenceError: "msg" is not defined. Why am I not able to reference the source message in my JavaScript?
Working...
X