Triggering different channel from script in current channel #6161
-
Hello there! For a project we are queuing certain HL7 messages (ADT / ORU / BAR) in separate channels (this is wip and not hewn into stone). On recognizing a certain ADT-A03 message belongs to a case from a list of distinct cases, I would like to trigger a script in the ORU and BAR channels respectively to "start their thing" and execute scripts within their respective channels. My colleagues running Mirth day-to-day tell me there is no easy way to do this, and looking through triggers / alert / events nothing immediate stood out to me. I can't imagine, though, there is no way to address another channel from within a script in Mirth. And no, while I am reasonably proficient with JavaScript within such boundaries, I am a project manager, but not a coder per se. Any ideas putting me on the right path would be very much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
What do you mean by start their thing? Do you mean have the channel poll? Do you mean that the channel is running all the time and when the condition is met you need some extra code to run ? Either one is possible, but you need to describe your use case a bit more. |
Beta Was this translation helpful? Give feedback.
I think @pacmano1 has described the best solution - If messages are held, then use a separate database call to store those messages. The Mirth queue is meant for short-term message storage while other messages process, it is not meant for a longer delay waiting on external processes.
What the DB allows you to do is:
SELECT * FROM holding_tank WHERE ready_to_send = true