SFTP server to a shared directory.

Hi All,

I need to transfer the sub-directories and their contents from a SFTP server to a shared directory while maintaining the structure.

I can do it without maintaining the structure.

Best Regards.

Michel.

P.-S. : files are HL7 messages.

 

  • 0
  • 0
  • 152
  • 3
  • 1

Answers

Hello Michel,

You might want to keep an eye out for some new content that the Learning Services are planning on publishing soon.

Building Custom Business Services Course

This course will be updated for IRIS for Health and includes an FTP example that will include the Attributes property. If you check out the current offering, you'll see that it consumes a file called Appointments.txt from ftp.intersystems.com. See exercise in 3.5 (creation) and 4.3 (implementation). The video uses the File adapter, but the exercise uses FTP.
 

Hope this helps!

Comments

Do these files require any transformation or are they just being copied/moved to the target filesystem? Do they need to be removed from the sftp server once transferred?

Ensemble's stock file transfer business service classes don't persist the directory recursed into as a property of the message object, so COS coding and a custom business service would be required, and likely a custom adapter as well. Assuming the complete file path is populated in the message's Source property, a custom File business operation would be needed to create the target path and file using the same name as the source.

The free WinSCP utility has a scripting interface that will perform a recursive transfer and deletion and could be scheduled to run under the Windows scheduler; if the intent is to simply move the files without transformation, this would likely be much faster to implement.

These files require transformation. They are HL7 messages and need segment changes according to the directories.
I don’t see any property that will also give a directory name: Attributes ("filename") is not the solution, unfortunately

>>> They should be deleted from the sftp server once transferred?
It’s already been done.

Any COS example will be very helpful.

The solution is for a "EnsLib.HL7.Service.FTPService" service :

Method OnProcessInput(request As %Stream.Object, Output response As %RegisteredObject) As %Status
request.Attributes("FTPDir")