web stats
Mapping issue - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2013, 09:30 AM
Anirudh Anirudh is offline
OBX.3 Kenobi
 
Join Date: Sep 2012
Posts: 135
Anirudh is on a distinguished road
Default Mapping issue

Hi All,

I am mapping XML to X12 by using a sample XML and X12 in message template. Can some one please help me out in understanding the below error. What exactly I am missing. Thanks in advance.


ERROR-301: Transformer conversion error
ERROR MESSAGE: Error adapting message
java.lang.NullPointerException
at com.mirth.connect.model.converters.EDISerializer.g etMetadataFromDocument(EDISerializer.java:133)
at com.mirth.connect.model.converters.EDISerializer.g etMetadata(EDISerializer.java:127)
at com.mirth.connect.model.converters.EDISerializer.g etMetadataFromXML(EDISerializer.java:172)
at com.mirth.connect.server.mule.adaptors.Adaptor.pop ulateMetadataFromXML(Adaptor.java:93)
at com.mirth.connect.server.mule.adaptors.X12Adaptor. populateMessage(X12Adaptor.java:28)
at com.mirth.connect.server.mule.adaptors.Adaptor.con vertMessage(Adaptor.java:79)
at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.transform(JavaScriptTransformer.jav a:279)
at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
at com.mirth.connect.server.controllers.DefaultMessag eObjectController.getMessageObjectFromEvent(Defaul tMessageObjectController.java:780)
at com.mirth.connect.connectors.vm.VMMessageDispatche r.doSend(VMMessageDispatcher.java:257)
at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:164)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:54)
at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:176)
at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:143)
at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:487)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:266)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:225)
at com.mirth.connect.connectors.vm.VMMessageReceiver. getMessages(VMMessageReceiver.java:223)
at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:108)
at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:97)
at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1061)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :575)
at java.lang.Thread.run(Thread.java:722)
Reply With Quote
  #2  
Old 03-29-2013, 09:57 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Can you post the channel and the inbound message you're testing with (sans any PHI)?
__________________
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
  #3  
Old 03-29-2013, 10:07 AM
Anirudh Anirudh is offline
OBX.3 Kenobi
 
Join Date: Sep 2012
Posts: 135
Anirudh is on a distinguished road
Default

I was able to resolve the issue. The reason its happening is due to HEX Character that I have used. When I remove it's working fine. I was just about to post a question. My vendor recommends using Hex 1F. I need to map an ISA-11 segment defaulted to this value. As per the specification the provided, Char is (us), Decimal is 31 and Oct is 0037 and Hex is 0x1f. Can you please suggest idea in how to implement this. Thanks a lot Nick.
Reply With Quote
  #4  
Old 03-29-2013, 10:18 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by Anirudh View Post
I was able to resolve the issue. The reason its happening is due to HEX Character that I have used. When I remove it's working fine. I was just about to post a question. My vendor recommends using Hex 1F. I need to map an ISA-11 segment defaulted to this value. As per the specification the provided, Char is (us), Decimal is 31 and Oct is 0037 and Hex is 0x1f. Can you please suggest idea in how to implement this. Thanks a lot Nick.
Since <0x1F> isn't a valid XML character, you'll have to do it by using a placeholder and replacing it at the last second:

Destination Transformer:
Code:
msg['ISA']['ISA.11']['ISA.11.1'] = '\\X1F\\';
$co('US','\x1F');
Destination Template
Code:
${message.encodedData.replaceAll('\\X1F\\',${US})}
__________________
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
  #5  
Old 03-29-2013, 10:21 AM
Anirudh Anirudh is offline
OBX.3 Kenobi
 
Join Date: Sep 2012
Posts: 135
Anirudh is on a distinguished road
Default

Excellent..Thanks a lot Nick will try this one out...
Reply With Quote
  #6  
Old 03-29-2013, 10:24 AM
Anirudh Anirudh is offline
OBX.3 Kenobi
 
Join Date: Sep 2012
Posts: 135
Anirudh is on a distinguished road
Default

Hi Nick,

I am getting the previous issue. I am using tmp not msg as I am converting xml to X12.Where msg would be XML and tmp is X12... I do see the value \X1F\ in encoded message but I also see the below error. Am I doing something wrong..


ERROR-301: Transformer conversion error
ERROR MESSAGE: Error adapting message
java.lang.NullPointerException
at com.mirth.connect.model.converters.EDISerializer.g etMetadataFromDocument(EDISerializer.java:133)
at com.mirth.connect.model.converters.EDISerializer.g etMetadata(EDISerializer.java:127)
at com.mirth.connect.model.converters.EDISerializer.g etMetadataFromXML(EDISerializer.java:172)
at com.mirth.connect.server.mule.adaptors.Adaptor.pop ulateMetadataFromXML(Adaptor.java:93)
at com.mirth.connect.server.mule.adaptors.X12Adaptor. populateMessage(X12Adaptor.java:28)
at com.mirth.connect.server.mule.adaptors.Adaptor.con vertMessage(Adaptor.java:79)
at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.transform(JavaScriptTransformer.jav a:279)
at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
at com.mirth.connect.server.controllers.DefaultMessag eObjectController.getMessageObjectFromEvent(Defaul tMessageObjectController.java:780)
at com.mirth.connect.connectors.vm.VMMessageDispatche r.doSend(VMMessageDispatcher.java:257)
at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:164)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:54)
at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:176)
at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:143)
at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:487)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:266)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:225)
at com.mirth.connect.connectors.vm.VMMessageReceiver. getMessages(VMMessageReceiver.java:223)
at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:108)
at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:97)
at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1061)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :575)
at java.lang.Thread.run(Thread.java:722)
Reply With Quote
  #7  
Old 03-29-2013, 10:53 AM
Anirudh Anirudh is offline
OBX.3 Kenobi
 
Join Date: Sep 2012
Posts: 135
Anirudh is on a distinguished road
Unhappy

Quote:
Originally Posted by narupley View Post
Since <0x1F> isn't a valid XML character, you'll have to do it by using a placeholder and replacing it at the last second:

Destination Transformer:
Code:
msg['ISA']['ISA.11']['ISA.11.1'] = '\\X1F\\';
$co('US','\x1F');
Destination Template
Code:
${message.encodedData.replaceAll('\\X1F\\',${US})}
Any suggestions Nick
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 11:10 AM.


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