web stats
Copy pdf file from a path sent in the HL7 message directly to a folder - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2015, 01:45 PM
henriquetomaz henriquetomaz is offline
OBX.1 Kenobi
 
Join Date: Dec 2014
Posts: 45
henriquetomaz is on a distinguished road
Question Copy pdf file from a path sent in the HL7 message directly to a folder

Hello,

Currently I receive HL7 messages that contains the path of pdf files which I copy to my local storage from a shared directory. I map the path on MirthConnect and then I use it on my application (in PHP), where I perform the copy.

Now, I want to create an additional Destination which I use mapped path to copy the pdf files directly to a directory. I mean, I want to perform the copy on the MirthConnect.

Is that possible? How the direction to do that?

Thanks a lot.

Henrique Amaral-Silva
Reply With Quote
  #2  
Old 07-29-2015, 08:08 PM
flyerman flyerman is offline
OBX.2 Kenobi
 
Join Date: May 2015
Posts: 68
flyerman is on a distinguished road
Default

//To COPY file within local directory

var source = "D:\\Mirth\\INPUT";
var fileName = "TESTING2.pdf"

var directory = "D:\\Mirth\\OUTPUT"
var outFileName = "TESTING_OUT.pdf";
var destination = directory +"\\" + outFileName

importPackage(java.io);
importPackage(org.apache.commons.io);
//var file = new java.io.File(directory);
var inputFile = new File(source +"\\"+ fileName );
var outputFile = new File(destination);
FileUtils.copyFile(inputFile,outputFile);


______________

BUT I am not sure whether the code can move file to a shared directory ?

Code from glenn71 can be a reference if you want to move file within smb
https://www.mirthcorp.com/community/...ad.php?t=15391

Last edited by flyerman; 07-29-2015 at 08:12 PM.
Reply With Quote
  #3  
Old 07-30-2015, 05:37 AM
henriquetomaz henriquetomaz is offline
OBX.1 Kenobi
 
Join Date: Dec 2014
Posts: 45
henriquetomaz is on a distinguished road
Default Destination: Connector Type

Thanks flyerman, that works!

Last edited by henriquetomaz; 07-30-2015 at 10:37 AM.
Reply With Quote
Reply

Tags
copy, diretory, path, pdf

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


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