web stats
ReferenceError: Function can not be used as the left-hand side of assignment or as a - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2017, 03:48 PM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default ReferenceError: Function can not be used as the left-hand side of assignment or as a

I am really new to Mirth, but I am trying to learn it. I did some tutorials.

I setup a channel and a source and destination, and under the source I am trying to add a transformer that is a simple message builder. I drag from the message tree the field placement I want to look in to the message segment, and then I drag the field I want it to go to in the mapper and save, redeploy all and then go drop the file into the folder I am processing source from.

I would assume this is one the simplest things I can do in the program and it still is not working. Does anyone know why I am having this problem? or know of a really good tutorial online that would teach me the basics of moving fields around in an hl7 message, and adjusting values based on mappings etc?

Thanks!

Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransforme rException:
CHANNEL: SIU Dentrix
CONNECTOR: sourceConnector
SCRIPT SOURCE: TRANSFORMER
SOURCE CODE:
52: msg = new XML(connectorMessage.getTransformedData());
53: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; }
54: function doFilter() { phase[0] = 'filter'; return true; }function doTransform() { phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);
55:
56:
57: msg['FT1']['FT1.20'].toString() = validate(msg['FT1']['FT1.21'].toString(), '', new Array());
58: if ('xml' === typeof msg) {
59: if (msg.hasSimpleContent()) {
60: msg = msg.toXMLString();
61: }
LINE NUMBER: 57
DETAILS: ReferenceError: Function can not be used as the left-hand side of assignment or as an operand of ++ or -- operator.
at 1309ccc6-21c6-4d84-a3ec-77109c969b19:57 (doTransform)
at 1309ccc6-21c6-4d84-a3ec-77109c969b19:79 (doScript)
at 1309ccc6-21c6-4d84-a3ec-77109c969b19:81
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(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)
Reply With Quote
  #2  
Old 06-27-2017, 07:12 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

In your Message Segment field, don't use ".toString()". When dragging over from the inbound message tree, you can hold the Alt key so that the toString() isn't included.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

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 06:02 AM.


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