web stats
How to create loops cause web service sender to be executed a number of times ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-16-2014, 07:19 PM
tranvikiet tranvikiet is offline
What's HL7?
 
Join Date: Dec 2013
Posts: 3
tranvikiet is on a distinguished road
Angry How to create loops cause web service sender to be executed a number of times ?

I am trying to create a channel that can communicate with a lab.
1. For each of results received I have to send a ACK message back to lab. I know Web Service Sender can help me to connect with lab service. However, I do not know how to create loops cause web service sender to be executed a number of times ? (There are many results returned from lab).

2. I also want to receive results automatically in specific point of times (twice a week). Can I do this with mirth ?

Please help me

Last edited by tranvikiet; 03-16-2014 at 08:41 PM.
Reply With Quote
  #2  
Old 03-17-2014, 05:54 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

If you want to automatically invoke a Web Service Sender at certain times, the easiest way is by using a JavaScript Reader. You can return some dummy message from there, and then the destination will be executed. We also have an open issue for adding a polling Web Service Reader connector as well: MIRTH-517

Regarding executing the destination multiple times, if you know in advance how many times you need to invoke the web service (or a maximum amount of times), you could create multiple destinations, and use filters to determine whether or not to send the message. If it should be fully dynamic, the easiest way is to break it up into two channels. The downstream channel actually invokes the web service, and the upstream channel manually routes messages to the downstream channel with router.routeMessage. Of course you technically could do it all in one channel if you manually invoked the service in JavaScript, but that is most likely not worth the effort.
__________________
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-18-2014, 12:40 AM
tranvikiet tranvikiet is offline
What's HL7?
 
Join Date: Dec 2013
Posts: 3
tranvikiet is on a distinguished road
Default

Great!
Thanks narupley, I'll try.
Reply With Quote
Reply

Tags
channel, loop, transformer, webservice sender

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:50 AM.


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