web stats
Can't Process message of version error - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 12-30-2010, 07:37 AM
sayle_m sayle_m is offline
What's HL7?
Join Date: Dec 2010
Posts: 1
sayle_m is on a distinguished road
Default Can't Process message of version error

I am creating a custom ACK for a client which is created in a transformer in a channel writer that passes it back to the channel.

When I send a message I get the following error:
DETAILS:        Wrapped com.mirth.connect.model.converters.SerializerException: ca.uhn.hl7v2.HL7Exception: Can't process message of version '<MSH.12><MSH.12.1>2.1</MSH.12.1></MSH.12>' - version not recognized (com.mirth.connect.server.MirthJavascriptTransformerException) (org.mule.umo.transformer.TransformerException)
        at com.mirth.connect.server.mule.transformers.JavaScriptTransformer.transform(JavaScriptTransformer.java:317)
        at org.mule.transformers.AbstractEventAwareTransformer.doTransform(AbstractEventAwareTransformer.java:48)
        at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:197)
        at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:251)
        at com.mirth.connect.server.controllers.DefaultMessageObjectController.getMessageObjectFromEvent(DefaultMessageObjectController.java:746)
        at com.mirth.connect.connectors.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:257)
        at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:164)
        ... 23 more
Caused by: org.mule.umo.transformer.TransformerException:
CHANNEL:        Envision Test
41: tmp['MSH']['MSH.11'] = msg['MSH']['MSH.11'].toString();
42: tmp['MSH']['MSH.12'] = msg['MSH']['MSH.12'].toString();
43: tmp['MSA']['MSA.1']['MSA.1.1'] = "AA";
44: tmp['MSA']['MSA.2']['MSA.2.1'] = msg['MSH']['MSH.10']['MSH.10.1'].toString();
46: var ResponseForINHS = SerializerFactory.getHL7Serializer(true,false,true).fromXML(tmp);
47: logger.info('Response for INHS:' + ResponseForINHS);
48: responseMap.put('ACK', ResponseFactory.getSuccessResponse(ResponseForINHS));
50: }
Here is the code from the transformer:
function PadZeros(num, count)
	var numZeropad = num + '';
	while(numZeropad.length < count)
		numZeropad = "0" + numZeropad;

	return numZeropad;

var today = new Date();
var dateString = today.getFullYear() + PadZeros(today.getMonth()+1, 2) + PadZeros(today.getDate(), 2) + PadZeros(today.getHours()+1, 2) + PadZeros(today.getMinutes()+1, 2);

// Create the ACK message
tmp['MSH']['MSH.1'] = msg['MSH']['MSH.1'].toString();
tmp['MSH']['MSH.2'] = msg['MSH']['MSH.2'].toString();
tmp['MSH']['MSH.3']['MSH.3.1'] = "CLIENT_NAME";
tmp['MSH']['MSH.4'] = msg['MSH']['MSH.4'].toString();
tmp['MSH']['MSH.5']['MSH.5.1'] = "OE";
tmp['MSH']['MSH.6'] = msg['MSH']['MSH.6'].toString();
tmp['MSH']['MSH.7']['MSH.7.1'] = dateString;
tmp['MSH']['MSH.9']['MSH.9.1'] = "ACK";
tmp['MSH']['MSH.10']['MSH.10.1'] = dateString;
tmp['MSH']['MSH.11'] = msg['MSH']['MSH.11'].toString();
tmp['MSH']['MSH.12'] = msg['MSH']['MSH.12'].toString();
tmp['MSA']['MSA.1']['MSA.1.1'] = "AA";
tmp['MSA']['MSA.2']['MSA.2.1'] = msg['MSH']['MSH.10']['MSH.10.1'].toString();

var Response = SerializerFactory.getHL7Serializer(true,false,true).fromXML(tmp);
//logger.info('Response :' + Response);
responseMap.put('ACK', ResponseFactory.getSuccessResponse(Response));
It parses 2.1 messages just fine with the default ACK so I am not sure of the problem here.

Can anybody help?

Last edited by sayle_m; 12-30-2010 at 08:15 AM. Reason: Took out client's name from code.
Reply With Quote
Old 01-03-2011, 11:45 AM
jacobb jacobb is offline
Mirth Employee
Join Date: Aug 2006
Location: Irvine, CA
Posts: 1,218
jacobb is an unknown quantity at this point

Is there a reason you are using the strict parser? Try it with the first parameter of the getHL7Serializer call as false.
Jacob Brauer
Director, Software Development
NextGen Healthcare

Reply With Quote

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

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