web stats
ERROR MESSAGE: Error evaluating transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 12-18-2014, 10:08 AM
lindsay lindsay is offline
What's HL7?
Join Date: Dec 2014
Posts: 2
lindsay is on a distinguished road
Default ERROR MESSAGE: Error evaluating transformer

I'm going through the book "Unofficial Mirth Connect 3.1 Developer's Guide" and I'm at chapter 5 "Query Sender Channel".

I've created the Query Sender channel, inbound and outbound datatypes are HL7 v2.x. Source Connector Type is Channel Reader, destination Connector Type is File writer. I test write and successfully connect to my path.

When I deploy the channel and send an HL7 message it successfully writes to the file. The problem is when I use the destination transformer and add the steps that the book says to add. I get an error when I try to send a message.

I add 4 steps and they are:

Name: MSH Segment
Type: JavaScript
tmp = msg;
tmp['MSH']['MSH.7']['MSH.7.1'] = Now("yyyyMMddhhmmss"); tmp['MSH']['MSH.10']['MSH.10.1'] = UUIDGenerator.getUUID();
Name: Patient ID
Type: JavaScript
tmp['QPD']['QPD.3']['QPD.3.1'] = getPatientID();
function getPatientID() { var patientId = '';
for ( var i = 0; i <= 9; i++ ) {
patientId += Math.floor( (Math.random() * 10) );
return patientId; };
Name: Query Tag
Type: Message Builder
Message Segment: tmp['QPD']['QPD.2']['QPD.2.1']
Mapping: tmp['MSH']['MSH.10']['MSH.10.1'].substring(10)

Type: JavaScript
if ( 'ERR2' == msg['MSH']['MSH.9']['MSH.9.2'].toString().toUpperCase() ) {
if ( Math.floor((Math.random()*10)+1) > 5 ) tmp['MSH']['MSH.9']['MSH.9.1'] = 'QQQ';
if ( Math.floor((Math.random()*10)+1) > 5 )
tmp['MSH']['MSH.9']['MSH.9.2'] = 'E99'; if ( Math.floor((Math.random()*10)+1) > 5 )
tmp['MSH']['MSH.12']['MSH.12.1'] = '9.9';

From Destination Mappings I drag and drop Encoded Data into the box. I save changes and deploy channel. I try to send this sample HL7 as a message:

MSH|^~\&|ADM|Sending Organization|ALL|Receiving Organization|||QBP^E22^QBP_E22||D|2.7|||AL|AL QPD|E22^Authorization
Request^CIHI0003||^^^ISO^PHN|Everywoman^Mary^Patri ck^^^^L^|19680120|MSP^|EXT RCP|I

I get the following error even though I followed the book exactly:

Transformer error
ERROR MESSAGE: Error evaluating transformer
CHANNEL:	Query Sender
CONNECTOR:	Destination 1
26:         }
27:         eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')');
28:     }
29: }
30: function doScript() {
31: msg = new XML(connectorMessage.getTransformedData());
32: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; }
33: function doFilter() { phase[0] = 'filter'; return true; }function doTransform() { phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);
DETAILS:	TypeError: Element type "Request" must be followed by either attribute specifications, ">" or "/>".
	at 114d3ec0-02a6-4fbf-ba92-7a688f279e4c:31 (doScript)
	at 114d3ec0-02a6-4fbf-ba92-7a688f279e4c:43
	at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:134)
	at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:100)
	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:695)

Does anyone have any idea why this is happening or how to troubleshoot?
Reply With Quote
Old 12-18-2014, 10:45 AM
lindsay lindsay is offline
What's HL7?
Join Date: Dec 2014
Posts: 2
lindsay is on a distinguished road
Default Figured out my problem!!

Just in case anyone else is having the same problem I realized that the book's sample HL7 message had spaces where it shouldn't therefore the transformer couldn't parse the message properly. Below is the correct HL7 message without the spaces. (Do not include quotes)

"MSH|^~\&|ADM|Sending Organization|ALL|Receiving Organization|||QBP^E22^QBP_E22||D|2.7|||AL|ALQPD|E 22^AuthorizationRequest^CIHI0003||^^^ISO^PHN|Every woman^Mary^Patrick^^^^L^|19680120|MSP^|EXT RCP|I"
Reply With Quote
Old 03-19-2018, 11:14 PM
ParthKansara ParthKansara is offline
What's HL7?
Join Date: Feb 2018
Posts: 2
ParthKansara is on a distinguished road
Default DICOM To XML convert error

DICOMSerializer error
ERROR MESSAGE: Error converting DICOM to XML
at com.mirth.connect.plugins.datatypes.dicom.DICOMSer ializer.fromXML(DICOMSerializer.java:97)
at com.mirth.connect.donkey.server.channel.FilterTran sformerExecutor.processConnectorMessage(FilterTran sformerExecutor.java:123)
at com.mirth.connect.donkey.server.channel.Destinatio nConnector.transform(DestinationConnector.java:360 )
at com.mirth.connect.donkey.server.channel.Destinatio nChain.doCall(DestinationChain.java:114)
at com.mirth.connect.donkey.server.channel.Destinatio nChain.call(DestinationChain.java:63)
at com.mirth.connect.donkey.server.channel.Channel.pr ocess(Channel.java:1716)
at com.mirth.connect.donkey.server.channel.Channel.di spatchRawMessage(Channel.java:1191)
at com.mirth.connect.donkey.server.channel.SourceConn ector.dispatchRawMessage(SourceConnector.java:192)
at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.dispatchRawMessage(DonkeyEngineControlle r.java:1067)
at com.mirth.connect.server.api.servlets.MessageServl et$2.run(MessageServlet.java:107)
at java.lang.Thread.run(Unknown Source)

If any one solved this problem So please tell me!!!!
Reply With Quote

error, send message, transformed data, transformer error

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:25 PM.

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