Mirth connect error in channel deployment

1.1k Views Asked by At

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

2

There are 2 best solutions below

0
On BEST ANSWER

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);
0
On

Mirth is complaining about the use of the undefined $title variable in your Javascript. It looks like you're trying to open a JDBC connection to a postgres database and perform some INSERTs, but you're referencing data (e.g. $title) that's not part of Mirth's channel map.