web stats
need help: Convert HL7 message from DB reader to XML message send it DB writer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2013, 11:54 AM
empee empee is offline
What's HL7?
 
Join Date: Feb 2013
Posts: 2
empee is on a distinguished road
Post need help: Convert HL7 message from DB reader to XML message send it DB writer

I am a newbee to Mirth interface development. I have been working on this and I could not figure out how to accomplish this.
Requirement:
I have HL7 ORU message in SQL server 2008 database. I would like to use following SQL statement to retrieve the data:
SELECT MessageControlID, ReceivedHL7Message from HL7Orders Where IsProcessed=0

(I need the MessageControlID to update it as processed after the messages is successfully transformed.)

Then I have to translate the ReceivedHLMessage to XML message and save it back to HL7XMLOrders table.

How can I map the ReceivedHLMessage to msg object and transform it to XML.

When I try I keep getting the following error:
Code:
 
ERROR 2013-03-02 15:34:44,723 [ae1439ed-c9d9-44fe-b107-d101352950ce_source_connector._jdbcEndpoint#-499212567.receiver.1] com.mirth.connect.connectors.jdbc.JdbcMessageReceiver: Error in channel: HL7DBconverter
org.mule.umo.transformer.TransformerException: Failed to parse result map
 at com.mirth.connect.server.mule.transformers.ResultMapToXML.doTransform(ResultMapToXML.java:93)
 at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:197)
 at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:251)
 at org.mule.routing.inbound.SelectiveConsumer.isMatch(SelectiveConsumer.java:61)
 at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:79)
 at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:487)
 at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:266)
 at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:229)
 at com.mirth.connect.connectors.jdbc.JdbcMessageReceiver.processMessage(JdbcMessageReceiver.java:180)
 at org.mule.providers.TransactedPollingMessageReceiver$1.doInTransaction(TransactedPollingMessageReceiver.java:98)
 at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:72)
 at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:104)
 at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:97)
 at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
 at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
 at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
 at java.lang.Thread.run(Unknown Source)
Any examples on how to accomplish it. Your help is really appreciated.
Thank you.
Reply With Quote
  #2  
Old 03-17-2015, 04:24 AM
kkrgr8 kkrgr8 is offline
What's HL7?
 
Join Date: Jan 2015
Posts: 5
kkrgr8 is on a distinguished road
Default

Howdy !

I am listing the steps to solve your problem

1) create a channel, source connectype -> database reader execute your query

(SELECT MessageControlID, ReceivedHL7Message from HL7Orders Where
IsProcessed=0)

2) goto source transformer and create 2 steps one type will be javascript writer and other one is mapper

3) In javascript step process hl7 message with msg['ReceivedHL7Message'].toString(); // here u can convert using this function SerializerFactory.getSerializer('HL7V2').toXML(mes sage);

4) In mapper create variable with msg['MessageControlID'].toString(); // eg varibale name messid


5) goto destination connector type -> database writer.
And paste the following query

Update HL7Orders set IsProcessed= 1 where MessageControlID= ${messid};

By these steps you can process hl7 message from DB and also update it back.

Thanks

Last edited by kkrgr8; 03-17-2015 at 04:50 AM.
Reply With Quote
Reply

Tags
database reader, databasewriter, failed to transform, hl7 to xml

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 12:42 AM.


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