Search code examples
mirthhl7-v2adaptormirth-connect

Mirth connect error in channel deployment


I am getting below error in deployment, If anyone having full example of mirth connect please provide including details of filter, transformer, response for both source and destination and Script.

Here are the screen-shots of channel

enter image description here

Channel summary

Channel Source

Source Transformer

Channel Destination


Solution

  • When you're working in a JavaScript context like that, here is the correct syntax to reference a map variable:

    $('varName')
    

    So you can replace the $varName instances in your code with $('varName') and it should work.

    However, you should also consider changing your code to use prepared statements. That prevents SQL injection and other unintended problems (what happens if one of those variables contains a quotation mark?). The DatabaseConnection class has another version of executeUpdate that takes a list of parameters. So try something like this:

    var params = Lists.list($('title')).append($('category')).append($('sumitted_date')).append($('assigner')).append($('assignee')).append($('due_date'));
    var result = dbConn.executeUpdate("INSERT INTO patient (title, category, sumitted_date, assigner, assignee, due_date) VALUES (?, ?, ?, ?, ?, ?)", params);