File Reader Device

File Reader Device

The File reader device is used to ingest files, while optionally extracting one or more messages from within the file. It supports reading:

  • Files containing one or more HL7v2 messages

  • Text files containing one or more messages (where files with multiple messages are framed)

  • Delimited text files

  • Fixed width field text files

  • Binary files (where the file contains a single message)

It also supports the concept of Attachments, where one or more related files can be ingested along with the primary message.

To configure the desired behavior (based on the files you’re reading), select the appropriate Reader Type and Message Output Type.

image-20250917-160257.png

Reader Types are File Reader, Delimited Reader, and Fixed Width Reader. Output message types can be HL7 Message, String, and Binary.

If you’re ingesting/working with binary files (like images or PDF), it’s important to select the Binary message type. If you select the String message type, the file contents will be base64 encoded.

Ingestion Settings

All reader types have a common configuration for file reading.

Polling Interval: Set the interval (in seconds) between each file scan. Note that this can be scheduled by clicking the icon beside the text box.

Minimum File Age: The minimum age of files before they can be ingested, as determined by the CreatedDateTime and LastWriteDateTime.

image-20250917-161244.png

Source Path: The root path from where files will be read.

Recurse Subdirectories: Ingest files in sub directories (of the Source Path).

File Permissions Check: Verify Connexion has read/write/delete permissions on the file being read. If not, the file is skipped.

Write Breadcrumb: Writes a tiny file into the directory being read with the structure __[R][MachineName][GroupName][TabName][ChannelName]. This can be useful for support teams to see which Connexion channel(s) are reading from a specific directory.

Impersonate: By default, Connexion will read files using the Connexion service account (default is __cxne_user__). This account may not have read/delete permissions on the Source Path. In this case, supply a User and Password for an account which has the required permissions, and Connexion will impersonate that user for file operations.

File Filter: A standard wildcard file filter string, or, a regex string which matches the files you want to ingest.

Behavior

By default, files are read in Age Ascending order, and are deleted once successfully ingested. If you prefer to copy files to a different directory after successful ingestion, specify a path in the Copy to File Path field. The impersonation settings (if specified) will be used to access this path.

image-20250917-165158.png

If your target files are compressed (zip/gzip/bzip), use the Decompress option to access files within the archive. Your files must have the expected extension of .zip, .gz, .bz2. Decompression will find any files within the source path with archive extensions and extract all their contents. The contents will subsequently be matched against the file filter.

You can use the Decompress and add to attachments option to read compressed files, extract the contents into attachments, and makes the primary message a summary of the archive contents.

The Error Behavior options are:

  • Abort and Sleep: An error will be logged and processing retried after the next directory poll. No other files will be processed.

  • Skip and Process Later: An error will be logged and the erroring file skipped. The erroring file will be retried on the next directory poll.

Purging

If the Copy To File Path field is populated, a Purging tab is displayed.

image-20250917-174421.png

This is designed to optionally purge files out of the Copy To File Path using the given configuration.

File Reader

The File Reader supports the concept of attachments. This is the ability to ingest other related files along with the ‘primary’ file. For example, if you had three related files - an HL7v2 primary file named msg01.hl7, an associated xml file named msg01.xml, and additional content in msg01.rtf, you would define your File Filter as *.hl7, and add *.xml and *.rtf into the Attachments field.

The xml and rtf files are ingested along with the hl7 file, and placed in the attachments collection. Attachments can be read and manipulated by other devices in your channel.

image-20250917-164250.png
image-20250917-164642.png

There are several different Attachment Behaviors. Typically, you only want to ingest when all the expected files exist (All Must Exist). You can also choose to ingest when any expected attachment file exists (At Least One Exists), or, when an attachment may not exist at all (Optional).

Fixed Width Reader

The fixed-width reader includes a simple table used to defined the structure of your fixed width file. Simply enter the length of each field (in order).

image-20250917-171251.png

After ingestion, a KeyValue message is created for each row in your delimited file. The KeyValue message type has a number of dictionary-like properties and functions for easy access via Custom Code or Custom Device.

image-20250917-172045.png

Delimited Reader

The delimited reader creates a KeyValue message for each line within a delimited file (like a CSV). It includes a number of settings to align with the structure of your file. If your file includes a header row, you can leave the definition table empty, or, populate the definition table to override the headers used in your file.

image-20250917-173721.png
image-20250917-174001.png

Diagnostics

The Diagnostics tab displays the file reader state as well as directory, file, and user information. It can be especially useful when diagnosing file permissions issues, as it displays impersonation information as well as attempts to write and delete files from various directories.

image-20250917-174732.png