/
File Writer device

File Writer device

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.

The device configuration is divided into four areas.

Actions

Options on the Actions tab defines 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. Using Asynchronous processing may provide better system performance and scaling, especially if you are writing large numbers of messages.

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

  • To copy the file, select the Copy File option. set the following:
    • Destination: The location to which the file should be copied, usually a network path. Connexion must have write permissions to the destination for the copy action to be successful. As part of the action, you can use variables to determine the appropriate destination path, 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.
    • Use Impersonation: Similar to the File Reader device, the Filter Writer device can use the credentials of a specific user or group to access the Destination path. Select the checkbox and then enter the username and password for the appropriate credentials.
  • To FTP the file, select the FTP File option and set the following:
    • Destination: The location to which the file should be sent via FTP. As part of the action, 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.
    • Username: The username for the FTP client. This should be a user that has permissions to use the FTP client.
    • Password: The password for the FTP client user specified above.
    • Use SSL: Select this box if the FTP client should use SSL encryption to transmit the file. Remember, without SSL encryption, user names, passwords and PHI are vulnerable to outside parties. Once you check the Use SSL option, complete the following fields:
      • SSL Port: the port that should be used for the SSL-protected FTP process.
      • Cert Path: the path to the location of the SSL certificate.

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

Set File Name: Check this option to set the 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 ({ }). You can use custom variables you have defined with a Custom Code device in the file names. Click on the blue information icon next to the Destination field to see a list of possible variables and how to use them. This field is required to enable Purging.

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:

  • File size reaches: archive the file when it reaches a certain size (specified in KB).
  • Number of messages reaches: archive the file when it contains the specified number of messages.
  • File is older than: archive the file when it is older than the specified number of minutes.
  • The time is: archive the file at a specified time of day

Multiple conditions are joined using the boolean OR operator. For example, you can set up conditions to the 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:

  • Start of Message Character: The character or character string that indicates the start of a message.
  • End of Message Character: The character or character string that indicates the end of a message.

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:

  • The action must be Copy File (you cannot purge via FTP).
  • The first part of the destination directory cannot contain any user variables.
  • The file must have a valid file extension, such as *.txt (no user variables are allowed in the extension for purging purposes).

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

  • Remove files that are older than: purge files based on their age in days.
  • Remove the oldest log file when: purge files when the oldest log file exceeds the specified number of MB.

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.

Related content

File Reader device
File Reader device
More like this
Concurrent File Writer device
Concurrent File Writer device
More like this
14.0 Release 12 (v14.0.9985)
14.0 Release 12 (v14.0.9985)
More like this
Logging in Custom Devices
Logging in Custom Devices
More like this
Network IO devices
Network IO devices
More like this
Connexion 14.5 R7 (14.5.2422)
Connexion 14.5 R7 (14.5.2422)
More like this