From File

The From File component processes files from a specified local source directory, and pushes the contents to the queue. Files are then moved to a processed directory (default) or deleted.

All functionality described is highly customizable from within the component Translator. Existing features can be modified and new features can be added to meet your specifications.

Running the Component

The below steps assume the correct user permissions are in place to read/write/move files.

Using image-20240730-154700.png, import the From File component

image-20240812-155748.png

Fields marked with an asterisk* are required:

Field

Description

Default Value

Field

Description

Default Value

SourceDirectory *

The directory to retrieve files.

files_in/

MoveProcessedFiles *

Specifies whether to move files to ProcessedDirectory. If set to false, processed files will be deleted.

true

ProcessedDirectory

The directory to move processed files.

files_out/

FileType *

Comma separated file extensions to read. Use * to read all files

txt,hl7

MinimumFileAge *

Time (in seconds) to wait after last modified date before processing.

0

IgnoreSegments *

Specifies whether to remove identified segments when processing file.

Default segments to ignore include: FHS, BHS, FTS, BTS. This can be modified in config.lua in the Translator.

false

PollTime *

The frequency (in seconds) the component polls the SourceDirectory.

10

InputFileEncoding *

The encoding of input files.

If left blank, encoding will be updated to the default according to OS. See Supported File Encodings.

Western (Windows-1252) for Windows

Western (ISO-8859-1) for Linux/Mac OS X.

Once the component is started, any file in the SourceDirectory matching the FileType and MinimumFileAge will be read, and its contents will be pushed to queue.

Verify that the contents are being read as expected, and adjust the configuration if necessary.

If MoveProcessedFiles is true the processed file will be moved to the ProcessedDirectory, else the file is deleted after processing.

In the config.lua file, in addition to configuring the IgnoredSegments, you can also modify the Message Delimiter used at the end of the message.

  • Can be changed to any delimiter

  • Leave blank to leave original delimiter in place, ‘\n’

Â