Written by

Sales Engineer at InterSystems Corporation
Question Marc Mundt · Jul 15, 2016

Date-based filtering for inbound file adapters

I was asked about using date-based criteria in the file spec for an inbound file adapter.
It looks like the file spec field only accepts simple wildcards (*, ?), so I'm wondering if someone knows of a clever way of doing this preferably without creating a custom adapter/service class.
An example of the use case:
An upstream system continually writes records to a file named with the current day's date. At midnight it opens a new file with the new day's date:

2016-07-14.dat
2016-07-15.dat
Shortly after midnight on July 15 we want Ensemble to pick up 2016-07-14.dat for processing, but ignore 2016-07-15.dat.
 

Comments

Eduard Lebedyuk · Jul 15, 2016

Time Stamp Specifications for Filenames - while configuring business operations and business services that transmit data to and from files, you can often specify input and output filenames in a string that includes date and time format codes, such as %Y%M%d%h%m%s_%f.txt. At runtime, the format codes within this string resolve dynamically based on the current date and time.

0
Marc Mundt  Jul 15, 2016 to Eduard Lebedyuk

It looks like this doesn't work for incoming files. I specified "%Y.txt" as the file spec for EnsLib.HL7.Service.FileService and it fails to pickup a file named "2016.txt".

It's too bad -- these time stamp strings would be perfect, but they seem to only be used when outputting files:

  • Specifying filename for files created by business operations
  • Timestamps appended when a business service archives a file

EnsLib.HL7.Service.FileService

0
Eduard Lebedyuk  Jul 15, 2016 to Marc Mundt

You can change wildcard programmatically, see this topic. Though I think the better solution would be subclassing and calculating wildcard there. 

0