web stats
Transformer Exception - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 09-18-2019, 01:35 PM
mevnl mevnl is offline
Mirth Newb
Join Date: Jun 2019
Posts: 6
mevnl is on a distinguished road
Default Transformer Exception

We are encountering an exception with a channel that takes in a JSON file and converts it to HL7. The source has no transformers and the destination contains the transformers that convert JSON to HL7. I am sharing the error stack below, any insight would be greatly appreciated

Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransforme rException:
CHANNEL: Test Channel
CONNECTOR: sourceConnector
148: }
149: }
150: function doScript() {
151: msg = new XML(connectorMessage.getTransformedData());
152: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; }
153: tmp = JSON.parse(template);
154: function doFilter() { phase[0] = 'filter'; return true; }function doTransform() { phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);
157: var mapping;
DETAILS: SyntaxError: Unexpected token: M
at d509fbfc-6bcf-4709-a0e7-a39c500d4751:153 (doScript)
at d509fbfc-6bcf-4709-a0e7-a39c500d4751:190
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:154)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:119)
at com.mirth.connect.server.util.javascript.JavaScrip tTask.call(JavaScriptTask.java:113)
at java.util.concurrent.FutureTask.run(FutureTask.jav a:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Reply With Quote
Old 09-19-2019, 04:59 AM
cory_cole cory_cole is offline
Mirth Guru
Join Date: Mar 2012
Posts: 1,282
cory_cole is on a distinguished road

It looks like there is an invalid character in the JSON message itself.
Reply With Quote
Old 09-19-2019, 09:55 AM
agermano agermano is offline
Mirth Guru
Join Date: Apr 2017
Location: Indiana, USA
Posts: 964
agermano is on a distinguished road

To clarify, it looks like your transformer's outbound template, and not the inbound message is what contains the invalid json.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 05:49 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation