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

'msg' not defined

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

  • 'msg' not defined

    Hi,

    I created a transformer step to process multiple NK1
    segments based on the example for multiple OBX's.
    I am getting an exception for the 'msg' object saying
    it is not defined.

    So, where does 'msg' come from and where should it be defined?

    Cheers,
    Y



    Code:
    var driver = "org.postgresql.Driver"; 
    var address = "jdbc:«»postgresql://localhost:5432/XXXXXXXX"; 
    var username = "XXXXXXXX"; 
    var password = "XXXXXXXX"; 
    
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection(driver,address,username,password); 
    for (var i = 0; i < msg['NK1'].length(); i++)
    {
        var params = new java.util.ArrayList();
        params.add($('relation_clinic'));
        params.add($('relation_name'));
        params.add($('relation_relationship'));
        params.add($('relation_employer'));
        params.add($('relation_postal_code'));
        params.add($('relation_province'));
        params.add($('relation_address'));
        params.add($('relation_city'));
        params.add($('relation_home_phone'));
        params.add($('relation_work_phone'));
        params.add($('relation_work_ext'));
    
        var expression = "INSERT IGNORE INTO relations(patient_id,clinic,name,relationship,employer,postal_code,province,address,city,home_phone,work_phone,work_ext,comment,created_at,updated_at) VALUES ((SELECT currval('patients_id_seq')),?,?,?,?,?,?,?,?,?,?,?,'',now(),now())";
    
        dbConn.executeUpdate(expression,params);
    
        dbConn.close();
    }
Working...
X