web stats
Creating an order from a result message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2017, 06:07 PM
fchang888 fchang888 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 19
fchang888 is on a distinguished road
Default Creating an order from a result message

Hi,

I have a requirement to create an order message from a result message
and then send the result message.

The 2nd part of this is that the vendor may potentially want to delay sending the result message by almost 1 full day.

Do I need to use a database to store the message and use a time comparison
to send the result message?

I can create the order message from the result but just wondering
where should I store the result message? in a file or DB?

Thanks in advance.
Reply With Quote
  #2  
Old 01-31-2017, 01:31 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

So you are getting a result message which is ORU without an Order like an unsolicited result?

Where do you want to send the result?

Bit confused with the question. You might want to add some clarifications.
Reply With Quote
  #3  
Old 01-31-2017, 09:36 AM
fchang888 fchang888 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 19
fchang888 is on a distinguished road
Default

Quote:
Originally Posted by siddharth View Post
So you are getting a result message which is ORU without an Order like an unsolicited result?

Where do you want to send the result?

Bit confused with the question. You might want to add some clarifications.
Siddharth,

I want to send the result to the same destination.

So an unsolicited result comes in as ORU. The vendor wants
and order ORM created and sent first before the result. This
will be to an outbound TCP/IP connection.

There is a possibility that they also want me to hold the result
for a specified length of time before sending the result right away.

I hope that is more clear.

Thanks,
Fee
Reply With Quote
  #4  
Old 01-31-2017, 12:32 PM
cbarlow cbarlow is offline
OBX.2 Kenobi
 
Join Date: Sep 2015
Location: Missouri
Posts: 52
cbarlow is on a distinguished road
Default

The way I have done this in the past was with 2 channels.
1. The inbound channel that listens for the Result. It has 2 destinations. Both destinations are a channel writer to a second channel. First destination has code to translate the ORU to an ORM. Second destination sends the ORU.
2. The outbound channel that receives the HL7 from the inbound channel.
Reply With Quote
  #5  
Old 01-31-2017, 12:34 PM
cbarlow cbarlow is offline
OBX.2 Kenobi
 
Join Date: Sep 2015
Location: Missouri
Posts: 52
cbarlow is on a distinguished road
Default

Make sure the ORU Destination in the inbound channel has the "Wait for previous destination" checked.
Reply With Quote
  #6  
Old 02-01-2017, 12:56 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

To add to what cbarlow has proposed -

You get an ORU in one channel, you process and ORM in destination 1, Add a JS Writer in Destination 2 with a time delay of 1 minute (java.lang.Thread.Sleep(60000)), and create a Third Destination with TCP/IP Sender to send the ORU. Make D2, and D3 'Wait for Previous Destination'.

As for your hold off case, Ask the vendor to send a Flag somewhere in the message, that says hold the result. Assuming the period of Holding the result could be from 1 hour to 1 day, all the results having that Flag could be written to separate files on a File storage, organised by Date-Time, call it D4 maybe.

You can create a different channel to send those On Hold messages, through the channel 1 above.
Reply With Quote
  #7  
Old 02-01-2017, 06:27 AM
fchang888 fchang888 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 19
fchang888 is on a distinguished road
Default

Quote:
Originally Posted by siddharth View Post
To add to what cbarlow has proposed -

You get an ORU in one channel, you process and ORM in destination 1, Add a JS Writer in Destination 2 with a time delay of 1 minute (java.lang.Thread.Sleep(60000)), and create a Third Destination with TCP/IP Sender to send the ORU. Make D2, and D3 'Wait for Previous Destination'.

As for your hold off case, Ask the vendor to send a Flag somewhere in the message, that says hold the result. Assuming the period of Holding the result could be from 1 hour to 1 day, all the results having that Flag could be written to separate files on a File storage, organised by Date-Time, call it D4 maybe.

You can create a different channel to send those On Hold messages, through the channel 1 above.
Thanks for the suggestion, cbarlow and siddarth! I am trying the 2 channels first with the Wait for Previous Destination. I'll let you know how it works.
Reply With Quote
  #8  
Old 02-04-2017, 01:44 AM
amble amble is offline
OBX.2 Kenobi
 
Join Date: Nov 2015
Posts: 91
amble is on a distinguished road
Default

Quote:
The 2nd part of this is that the vendor may potentially want to delay sending the result message by almost 1 full day.
How are they going to let you know which to process immediately and not?

I'd write a filter to apply a rule to only 'unsolicited results' (assuming identified by PID ID etc.), write them into a database which has a timestamp and also a flag column set to A for archive for example.

If you want to build an order message from them, set the flag to Q for queue. Then have a database reader that reads in any rows with a value of 'Q', update them to 'P' for processed so you know which ones have been through the engine.

But again, the key thing for me is how are you going to update this database and what criteria determines it? You might have to used a stored procedure or batch job
Reply With Quote
Reply

Tags
creating order, delay, from result

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 01:26 AM.


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