com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: test setup CONNECTOR: sourceConnector SCRIPT SOURCE: TRANSFORMER SOURCE CODE: 46: //createSegment('OBX', tmp, 1); 47: //tmp['OBX'][1]['OBX.1']['OBX.1.1'] = 1; 48: //tmp['OBX'][1]['OBX.2']['OBX.2.1'] = "ST"; 49: createSegment('OBX', tmp, 2); 50: tmp['OBX'][2]['OBX.1']['OBX.1.1'] = 2; 51: tmp['OBX'][2]['OBX.2']['OBX.2.1'] = "ST"; 52: LINE NUMBER: 50 DETAILS: TypeError: Cannot read property "OBX.1" from undefined at 682bcffd-73bf-405b-af83-ba83b19d86ab:50 (doTransform) at 682bcffd-73bf-405b-af83-ba83b19d86ab:126 (doScript) at 682bcffd-73bf-405b-af83-ba83b19d86ab:128

Stack Overflow | kramer65 | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    HL7 with Mirth: How to avoid Segments with double sequence numbers?

    Stack Overflow | 6 months ago | kramer65
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: test setup CONNECTOR: sourceConnector SCRIPT SOURCE: TRANSFORMER SOURCE CODE: 46: //createSegment('OBX', tmp, 1); 47: //tmp['OBX'][1]['OBX.1']['OBX.1.1'] = 1; 48: //tmp['OBX'][1]['OBX.2']['OBX.2.1'] = "ST"; 49: createSegment('OBX', tmp, 2); 50: tmp['OBX'][2]['OBX.1']['OBX.1.1'] = 2; 51: tmp['OBX'][2]['OBX.2']['OBX.2.1'] = "ST"; 52: LINE NUMBER: 50 DETAILS: TypeError: Cannot read property "OBX.1" from undefined at 682bcffd-73bf-405b-af83-ba83b19d86ab:50 (doTransform) at 682bcffd-73bf-405b-af83-ba83b19d86ab:126 (doScript) at 682bcffd-73bf-405b-af83-ba83b19d86ab:128
  2. 0

    A filter is set up in the channel's source to check message type with function messageObject.getType() available in Message Functions Reference. After it's deployed and a ADT message is sent, the following error is thrown: ERROR-300: Transformer error ERROR MESSAGE: Error evaluating filter/transformer com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: test-ADT CONNECTOR: sourceConnector SCRIPT SOURCE: SOURCE CODE: 13: function doScript() { 14: var newMessage = message; 15: msg = new XML(newMessage); 16: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; } 17: function filterRule1() { 18: if (messageObject.getType() == 'ADT-A01' || 19: messageObject.getType() == 'ADT-A02' || 20: messageObject.getType() == 'ADT-A03' || 21: messageObject.getType() == 'ADT-A04' || 22: messageObject.getType() == 'ADT-A05' || LINE NUMBER: 18 DETAILS: TypeError: Cannot find function getType in object message 1-0 (RECEIVED). at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:149) at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:110) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) It's also found that other functions availabe in the Message Funtions Reference are not supported. Because the the channels to receive data for our product all rely on the Message Functions, I set the priority to be Blocker.

    Mirth Project | 4 years ago | geping wu
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: test-ADT CONNECTOR: sourceConnector SCRIPT SOURCE: SOURCE CODE: 13: function doScript() { 14: var newMessage = message; 15: msg = new XML(newMessage); 16: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; } 17: function filterRule1() { 18: if (messageObject.getType() == 'ADT-A01' || 19: messageObject.getType() == 'ADT-A02' || 20: messageObject.getType() == 'ADT-A03' || 21: messageObject.getType() == 'ADT-A04' || 22: messageObject.getType() == 'ADT-A05' || LINE NUMBER: 18 DETAILS: TypeError: Cannot find function getType in object message 1-0 (RECEIVED).
  3. 0

    ERROR-300: Transformer error ERROR MESSAGE: Error evaluating filter/transformer com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: Channel 0 CONNECTOR: sourceConnector SCRIPT SOURCE: SOURCE CODE: 392: } 393: 394: function getXV(SegmentRoot, newSegmentPath) 395: { 396: var segment = smartCreateSegmentXML(SegmentRoot, newSegmentPath); 397: return segment.parent()[segment.name()]; 398: } 399: 400: function deleteXV(SegmentRoot, newSegmentPath) 401: { LINE NUMBER: 397 DETAILS: TypeError: name is not a function, it is xml. at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:397 (getXV) at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:687 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:676 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2177 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2164 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2823 (doTransform) at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2826 (doScript) at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2828 at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:127) at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:1) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680)

    Mirth Project | 4 years ago | Adrian Galvan
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: Channel 0 CONNECTOR: sourceConnector SCRIPT SOURCE: SOURCE CODE: 392: } 393: 394: function getXV(SegmentRoot, newSegmentPath) 395: { 396: var segment = smartCreateSegmentXML(SegmentRoot, newSegmentPath); 397: return segment.parent()[segment.name()]; 398: } 399: 400: function deleteXV(SegmentRoot, newSegmentPath) 401: { LINE NUMBER: 397 DETAILS: TypeError: name is not a function, it is xml. at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:397 (getXV) at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:687 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:676 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2177 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2164 at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2823 (doTransform) at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2826 (doScript) at 7f032f12-ffd8-44bc-b7ab-6923a4c260f5:2828
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    A filter is set up in the channel's source to check message type with function messageObject.getType() available in Message Functions Reference. After it's deployed and a ADT message is sent, the following error is thrown: ERROR-300: Transformer error ERROR MESSAGE: Error evaluating filter/transformer com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: test-ADT CONNECTOR: sourceConnector SCRIPT SOURCE: SOURCE CODE: 13: function doScript() { 14: var newMessage = message; 15: msg = new XML(newMessage); 16: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; } 17: function filterRule1() { 18: if (messageObject.getType() == 'ADT-A01' || 19: messageObject.getType() == 'ADT-A02' || 20: messageObject.getType() == 'ADT-A03' || 21: messageObject.getType() == 'ADT-A04' || 22: messageObject.getType() == 'ADT-A05' || LINE NUMBER: 18 DETAILS: TypeError: Cannot find function getType in object message 1-0 (RECEIVED). at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:149) at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:110) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) It's also found that other functions availabe in the Message Funtions Reference are not supported. Because the the channels to receive data for our product all rely on the Message Functions, I set the priority to be Blocker.

    Mirth Project | 4 years ago | geping wu
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: test-ADT CONNECTOR: sourceConnector SCRIPT SOURCE: SOURCE CODE: 13: function doScript() { 14: var newMessage = message; 15: msg = new XML(newMessage); 16: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; } 17: function filterRule1() { 18: if (messageObject.getType() == 'ADT-A01' || 19: messageObject.getType() == 'ADT-A02' || 20: messageObject.getType() == 'ADT-A03' || 21: messageObject.getType() == 'ADT-A04' || 22: messageObject.getType() == 'ADT-A05' || LINE NUMBER: 18 DETAILS: TypeError: Cannot find function getType in object message 1-0 (RECEIVED).

    2 unregistered visitors

    Root Cause Analysis

    1. com.mirth.connect.server.MirthJavascriptTransformerException

      CHANNEL: test setup CONNECTOR: sourceConnector SCRIPT SOURCE: TRANSFORMER SOURCE CODE: 46: //createSegment('OBX', tmp, 1); 47: //tmp['OBX'][1]['OBX.1']['OBX.1.1'] = 1; 48: //tmp['OBX'][1]['OBX.2']['OBX.2.1'] = "ST"; 49: createSegment('OBX', tmp, 2); 50: tmp['OBX'][2]['OBX.1']['OBX.1.1'] = 2; 51: tmp['OBX'][2]['OBX.2']['OBX.2.1'] = "ST"; 52: LINE NUMBER: 50 DETAILS: TypeError: Cannot read property "OBX.1" from undefined at 682bcffd-73bf-405b-af83-ba83b19d86ab:50 (doTransform) at 682bcffd-73bf-405b-af83-ba83b19d86ab:126 (doScript) at 682bcffd-73bf-405b-af83-ba83b19d86ab:128

      at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call()
    2. com.mirth.connect
      JavaScriptFilterTransformer$FilterTransformerTask.call
      1. com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:154)
      2. com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:119)
      2 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      4. java.lang.Thread.run(Thread.java:745)
      4 frames