web stats
Excel Import After downloading file - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2014, 07:31 AM
rpatel rpatel is offline
Mirth Newb
 
Join Date: Jun 2014
Posts: 17
rpatel is on a distinguished road
Default Excel Import After downloading file

I am building a channel, that basically gets an excel file from an SFTP server and imports this file into sql server.

So here is what I have done so far:
Source: Get Excel File from sftp server.
Destination: Write Excel File to a Local Directory.

This all works perfectly, now I need to execute a stored procedure to import the excel file into SQL. How can I do this?

The stored procedure will delete the file after it has imported the file as well.

I wanted to see if I can use the Postprocessor to do this, basically after the file has been written in the destination directory, I want to run a stored procedure and pass a variable with the filename into it. I am not sure how to do this though?

If anyone else any better ideas, let me know.

The excel file is an export of patient information that we will be getting from clients.

Thanks.
Reply With Quote
  #2  
Old 07-23-2014, 07:33 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

You don't necessarily have to use a postprocessor to do that. Instead, you can just use a subsequent Database Writer destination.
__________________
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 07-23-2014, 08:54 AM
rpatel rpatel is offline
Mirth Newb
 
Join Date: Jun 2014
Posts: 17
rpatel is on a distinguished road
Default

So if I run the Database writer right after the first destination, will it run at the same time as the first destination or after the first destination? The reason I am asking is when I run the database writer, I don't want the file to not be there.
Reply With Quote
  #4  
Old 07-23-2014, 09:08 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

Quote:
Originally Posted by rpatel View Post
So if I run the Database writer right after the first destination, will it run at the same time as the first destination or after the first destination? The reason I am asking is when I run the database writer, I don't want the file to not be there.
If the first destination is not queuing and is in the same chain (i.e. Wait for previous destination is checked) then yes, the second destination will only execute after the first finishes. You can also place a filter on your second destination and check the status of the previous destination, and only allow the message to be sent if the previous status is SENT (otherwise filter it).
__________________
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
  #5  
Old 07-23-2014, 09:31 AM
rpatel rpatel is offline
Mirth Newb
 
Join Date: Jun 2014
Posts: 17
rpatel is on a distinguished road
Default

I didn't see that, that worked, thank you!!!
Reply With Quote
Reply

Tags
excel, postprocessor, sql server

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 07:17 PM.


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