Announcement

Collapse
No announcement yet.

Transformer Exception

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

  • Transformer Exception

    Hi,
    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
    SCRIPT SOURCE:
    SOURCE CODE:
    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]);
    155:
    156:
    157: var mapping;
    LINE NUMBER: 153
    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)

  • #2
    It looks like there is an invalid character in the JSON message itself.

    Comment


    • #3
      To clarify, it looks like your transformer's outbound template, and not the inbound message is what contains the invalid json.

      Comment

      Working...
      X