web stats
Feature Request? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2017, 01:00 PM
jack.downes jack.downes is offline
OBX.2 Kenobi
 
Join Date: Apr 2014
Posts: 62
jack.downes is on a distinguished road
Default Feature Request?

Probably someone asked for this, but I can't find it anywhere.

I'd LOVE to have a "worker" type of channel. Perhaps the idea already exists...

Right now, we have 'Readers' and 'Writers' and the work is typically performed in one of the transforms of those channels. So, there are cases where I'd like to have a File Reader attempt to open an SFTP connection - only AFTER another file has been written, and perhaps after waiting a set amount of time.

So, say I need to perform an EDI query and get a response in a bit.

Right now, my workflow is
Channel 1: accept the query via a TCP MLLP connector from EMR, open a destination to sftp, upload file.
(Channel 1 is now done, and doesn't do anything BUT this)
Channel 2: Every 5 minutes, login to that same sftp server, check an 'output' directory for a 271 response, if found, upload the response to the EMR.

This is workable, but Channel 2 is just connecting every 5 mins, rather than being told by Channel 1 that a query occured, and you should check for a response.

This is very workable as-is, and perhaps the simplicity is the elegance in it. However, I've often wished for a multiple conditional file-reader. like, wait for a certain time of day, and check a database for a certain column being set, and if both those conditions are met, do something.

This is likely a ramble without cause. Please let me know the right way to scratch this itch.

thanks,
Jack
Reply With Quote
  #2  
Old 03-31-2017, 01:51 PM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 570
kirbykn2 is on a distinguished road
Default

Could you create a second destination on channel 1 (Wait for Previous Destination), send the message two channel 2 and use that as the trigger to connect to the SFTP site?
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #3  
Old 03-31-2017, 03:25 PM
jack.downes jack.downes is offline
OBX.2 Kenobi
 
Join Date: Apr 2014
Posts: 62
jack.downes is on a distinguished road
Default

I must be missing something here. Is there a way to have a channel trigger on an inbound message to open an SFTP connection? If so, that's pretty slick! I've not seen how to do that. Typically, I see it's a Channel Reader *OR* it's a File Reader. Having it trigger on a message hitting it to read a file would be so very useful.

If this is what you are saying, and I'm searching for that right now... anyway, would you mind explaing how you are doing that?

thanks,
Jack
Reply With Quote
  #4  
Old 03-31-2017, 03:44 PM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 570
kirbykn2 is on a distinguished road
Default

I've done the same thing with database connections by putting the database connection in a transformer step. The source is a channel reader, each time a message is sent in it goes through the transformer step that triggers the db query. At that point you can add results of the query to the message, write to file, sftp web service, etc.

I haven't worked with SFTP connections in transformer steps but I assume it can be done.
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #5  
Old 03-31-2017, 04:01 PM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 570
kirbykn2 is on a distinguished road
Default

Here's a post where someone deltes a file from an ftp site, in a transformer step.

http://www.mirthproject.org/communit...tp+transformer
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #6  
Old 03-31-2017, 10:05 PM
jack.downes jack.downes is offline
OBX.2 Kenobi
 
Join Date: Apr 2014
Posts: 62
jack.downes is on a distinguished road
Default

Interesting, I'll have to spend some time looking at this. thanks for the tip. I probably should have put this ticket into support!
Reply With Quote
  #7  
Old 04-04-2017, 09:58 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 570
kirbykn2 is on a distinguished road
Default

I'm glad you posted this here instead of contacting support. I have the same flow and I am curious if this works for you.
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #8  
Old 04-05-2017, 11:05 AM
jack.downes jack.downes is offline
OBX.2 Kenobi
 
Join Date: Apr 2014
Posts: 62
jack.downes is on a distinguished road
Default

I mean the forum support.
This is somewhat deflating, I was able to greatly simplify the channels and just make everything work with no more errors. I've got another complex one coming up, will look into your method here because it most certainly involves a db lookup, splitting a batch to separate messages, recombining messages together by category, etc. it'll be a blast!
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 12:17 PM.


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