This page contains information about the File Writer device. This device accepts messages from other devices in the Connexion channel and writes them to a file at the specified destination. New messages are appended to the end of the existing file. Files can be written and stored in a server directory or sent via FTP.

Device configuration is divided into four areas.

Actions

Options on the Actions tab define how the file is written (see image above). Use the following options to configure the device actions.

Write Operations: Choose how the file will be written. Synchronous writing means that messages in the channel can be blocked by the File Writer device and will not be written. In Asynchronous mode, message processing will never be blocked and the file will be saved when possible. Why would you want to use either method?

Once the file is saved/written, you can either copy it to a destination or FTP it.

In addition, there are two options that are available regardless of the action you choose (copy or FTP).

Set File Name: Check this option if you want to use a specific name for the copied/FTP'd file. The field should only contain the file name, not the entire path. You can insert variables into the name of the copied file, such as the date or a file counter. Variables are inserted between braces ({ }) in the destination path. Click on the blue information icon next to the Destination field to see a list of possible variables and how to use them.

As part of the file name, you can include one of two dates, either the date the first message was received by the device or the date the last message was written by the device. Select the appropriate option under the Destination field.

Compress File: If the file being written is very large, you can compress it (this is useful if the destination system has a limit on file size). Check this option to compress the file. If the compressed file should be encrypted (using AES 256 encryption), enter a password in the associated field. Note: this encryption is for decompressing the file and does not affect security during an FTP transfer.

Conditions

As messages are written to the file, it will increase in size. Once the file meets certain conditions, you can choose to archive it to save space at the destination.

Click the add condition icon (the rectangle with the green plus) to add one or more of the following conditions:

Multiple conditions are joined using the boolean OR operator. For example, you can set up conditions to archive when the file size reaches 10240KB (10MB) OR when the number of messages in the file reaches 1000.

To delete a condition, select it and click the delete icon (the red circle with the X next to the "add condition" icon).

Framing

You can frame any HL7 messages being written to indicate the start and finish of the message. This is particularly useful when writing to a file that may contain hundreds of messages.

On the Framing tab, choose the message encoding scheme and select the Frame Messages option. Then specify the following:

Purging

As messages are written, and the number of files (or the file size) increases, Connexion can be configured to automatically purge individual files or even the entire directory.

By default, file purging is disabled. To enable file purging, the following conditions must be met:

Once those conditions are met, you can enable file purging on the device. Choose your purge condition:

Set the interval (in hours) over which the device should purge the directory (e.g., purge every 24 hours). You can also choose to purge the entire directory (if it is empty) by checking the Remove Directory If Empty option.

When purging is set up correctly, the device will display the conditions under which files will be deleted.