You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransformerException:
CHANNEL: HTTP_HWSAFE_DOCUMENT_TO_HL7_ORU_AHC
CONNECTOR: sourceConnector
SCRIPT SOURCE:
SOURCE CODE:
1649: }
1650: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')');
1651: }
1652: }
1653: function doScript() {
1654: msg = JSON.parse(connectorMessage.getTransformedData());
1655: tmp = new XML(template);
1656: function filterRule1() {
1657: if(connectorMessage.getRawData().toString().length() > 0 ) {
1658: return true;
LINE NUMBER: 1654
DETAILS: SyntaxError: Empty JSON string
at e31fd331-0a80-41b3-9971-afd75e1760c3_JavaScript_Filter_Transformer_0:1654 (doScript)
at e31fd331-0a80-41b3-9971-afd75e1760c3_JavaScript_Filter_Transformer_0:1752
at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.doCall(JavaScriptFilterTransformer.java:235)
at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.doCall(JavaScriptFilterTransformer.java:187)
at com.mirth.connect.server.util.javascript.JavaScriptTask.call(JavaScriptTask.java:114)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)
The error message indicates that there is an empty JSON string on line 1654 of the code. This error is preventing the transformer from being evaluated properly. It seems that the transformer is part of a channel called HTTP_HWSAFE_DOCUMENT_TO_HL7_ORU_AHC, and the error is occurring in the source connector. The error message also includes a stack trace that shows the sequence of events leading up to the error.
Transformer Code we Using
var messageType = "";
var messageEvent = "";
var objJson = JSON.parse(messageObject.getRawData());
channelMap.put('messageDateTime', DateUtil.getCurrentDate("yyyyMMddHHmmss"));
channelMap.put('accessionId', msg['accessionId']);
channelMap.put('patientName', msg['patientName']);
channelMap.put('patientId', msg['patientId']);
channelMap.put('patientAccNum', msg['patientAccountNumber']);
if (msg['OrganizationID'] !== "") {
if (msg['OrganizationID'] === "Athens Medical Center") {
messageType = "ORU";
messageEvent = "R01";
channelMap.put('messageEventType', messageType + "^" + messageEvent);
}
}
channelMap.put('date', DateUtil.getCurrentDate('yyyyMMdd'));
channelMap.put('fileName', msg['patientId'] + "_" + msg['patientName'] + ".json");
ERROR OUTPUT
Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransformerException:
CHANNEL: HTTP_HWSAFE_DOCUMENT_TO_HL7_ORU_AHC
CONNECTOR: sourceConnector
SCRIPT SOURCE:
SOURCE CODE:
1649: }
1650: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')');
1651: }
1652: }
1653: function doScript() {
1654: msg = JSON.parse(connectorMessage.getTransformedData());
1655: tmp = new XML(template);
1656: function filterRule1() {
1657: if(connectorMessage.getRawData().toString().length() > 0 ) {
1658: return true;
LINE NUMBER: 1654
DETAILS: SyntaxError: Empty JSON string
at e31fd331-0a80-41b3-9971-afd75e1760c3_JavaScript_Filter_Transformer_0:1654 (doScript)
at e31fd331-0a80-41b3-9971-afd75e1760c3_JavaScript_Filter_Transformer_0:1752
at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.doCall(JavaScriptFilterTransformer.java:235)
at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.doCall(JavaScriptFilterTransformer.java:187)
at com.mirth.connect.server.util.javascript.JavaScriptTask.call(JavaScriptTask.java:114)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)
The error message indicates that there is an empty JSON string on line 1654 of the code. This error is preventing the transformer from being evaluated properly. It seems that the transformer is part of a channel called HTTP_HWSAFE_DOCUMENT_TO_HL7_ORU_AHC, and the error is occurring in the source connector. The error message also includes a stack trace that shows the sequence of events leading up to the error.
Transformer Code we Using
Filter logic I'm Applying to resolve this Error
But Still getting the Same error
can anyone help me to resolve that error or explain me how to do that.
The text was updated successfully, but these errors were encountered: