Please, have a look the following links:

Ensemble XML Virtual Document Development Guide

Loading XML Schemas into Ensemble

Using File Adapters with Ensemble

Once you have the content of the file, you will be able to make the necessary transformations in HL7 to make the outbonding operation to out the content.

Best regards,

Francisco López

Dear all... problem solved.

I've created a new FTP server (based on IIS) and it works without problem.

The previous one was created with Filezilla server. 

Fortunately, the client has an FTP server based on IIS, so with this test we consider the integration in their preproduction environment will be fine.

Note: I've changed the "Server List Style" to "MSDOS" for this new server ;)

Thanks to all for your time.

Best regards,

Francisco López

Hi Dani,

This class uses EnsLib.FTP.InboundAdapter, according to the documentation, this is the path on the Ensemble server to save a copy of each file received from the FTP server. That is not a FTP folder.

If you want to move the file processed into a FTP folder after processed, you should get the file from this folder and put it manually.

Have a look the link Using the FTP Inbound Adapter and Settings for the FTP Inbound Adapter

Have a nice day

Francisco López

Hi Conor.

If you try to convert directly this datetime to a $HOROLOG format, you'll have problems :)

Date is a valid format, however the time needs to convert a valid format, so modify the variable to convert a valid datetime format.

set myTimeStamp="20160105125915"

set myTimeStampValid=$EXTRACT(fecha,1,4)_"-"_$EXTRACT(fecha,5,6)_"-"_$EXTRACT(fecha,7,8)_" "_$EXTRACT(fecha,9,10)_":"_$EXTRACT(fecha,11,12)_":"_$EXTRACT(fecha,13,14)

Then you have a datetime in format YYY-mm-dd HH:MM:ss

Now, you need to convert this variable to $HOROLOG format

set myTimeStampHorolog=$ZDATETIMEH(myTimeStampValid,3,1)

now, convert to UTC using your local time, if you know what is the UTC difference, apply directly.

Example: I'm in Spain, so is CET (UTC+1), however in summer (CEST) is UTC+2

If you use the method ##class(%SYSTEM.Util).LocalWithZTIMEZONEtoUTC you'll have the UTC as zone time, but your Ensemble doesn't know if it's Summer o Winter time.

if is Summer time, you need to reduce an hour your local time

set myTimeStampUTC=##class(%SYSTEM.Util).LocalWithZTIMEZONEtoUTC(myTimeStampHorolog)
;; IF SUMMER TIME, REDUCE ONE HOUR
set myTimeStampUTC=$ZDATETIMEH($SYSTEM.SQL.DATEADD("hour",-1,myTimeStampUTC),3,1)

if you want to compare both datetimes (now, I'm in CEST, so I'm in UTC+2)

write "My local time:"_$ZDATETIME(myTimeStampHorolog,3,1)
write "UTC time:"_$ZDATETIME(myTimeStampUTC,3,1)

The result is:

My local timestamp:2016-01-05 12:59:15

UTC timestamp:2016-01-05 10:59:15

Now, you have the same problem, you have a time separated by ":", so only need to revert the conversion

set myUTC=$ZDATE(myTimeStampUTC,8)_$REPLACE($ZTIME($PIECE(myTimeStampUTC,",",*),1),":","")

and compare:

write myTimeStamp

write myUTC

Check the info about theses methods:

$ZDATETIMEH

$ZDATETIME

$EXTRACT

##class(%SYSTEM.Util).LocalWithZTIMEZONEtoUTC

I hope I have solved your problem

Best regards,

Francisco Lopez

P.S. Don't forget check the answer if it's the correct answer.

P.P.S. [EDITED] According to Eduard Lebedyuk (see below), you can replace

set myTimeStampValid=$EXTRACT(fecha,1,4)_"-"_$EXTRACT(fecha,5,6)_"-"_$EXTRACT(fecha,7,8)_" "_$EXTRACT(fecha,9,10)_":"_$EXTRACT(fecha,11,12)_":"_$EXTRACT(fecha,13,14)

to

set myTimeStampValid=$SYSTEM.SQL.TOTIMESTAMP(myTimeStamp,"YYYYMMDDHHMISS")

Thanks Mr. Lebedyuk