HL7 Batch Device
The HL7 Batch device supports the HL7 Batch File Protocol, and creates files containing one or more HL7 messages. This protocol uses the following structure:
[FHS] (file header segment)
{ [BHS] (batch header segment)
{ MSH (one or more HL7 messages)
....
}
[BTS] (batch trailer segment)
}
[FTS] (file trailer segment)This device works in tandem with an upstream queue, letting messages accumulate within the queue until a user-defined schedule elapses. When scheduled, all messages in the queue are filed into one or more batches, and then processing is paused until the next schedule.
Batch files can be written to various targets (file, ftp, cloud, mllp, etc.) by using a file writer or HL7 outbound device.
Batch files are created in a device-specific working directory (%ProgramData%\ConnexionV14\UserData\bw_DeviceKey) and once created, are passed to the downstream device. They are either passed as a File Pointer, or as the full file content (as a string).
The File Pointer is a specific type understood by the File Writer and HL7 Sender devices, and minimizes the amount of data loaded into memory. If you are using other devices downstream of the HL7 Batch device, you will need to use an output type of Batch Document.
By default, batch files created in the working directory are persisted for 7 days. This can be useful for debugging and inspection purposes. They are automatically purged after this period.
You can customize the content of the BHS segment, including several supported variables:
{dt:format}: The local date/time, using the specified formatting (standard .NET date handling)
{utc:format}: the UTC date/time, using the specified formatting.
{n:format}: a batch counter, using the specified number formatting.
When the user-specified schedule elapses, all queued messages in the upstream queue will be batched. Instead of a single batch, you can optionally choose to create batches based on message count (within the batch), batch file size, or date the message was received within the upstream queue.
Batching logic is persisted across channel start/stop and service restart. If processing is interrupted mid-way through creating a batch file, that batch file will be re-opened and completed once the channel is running (and within schedule).
Messages are only batched when a user-defined schedule elapses. Messages build up within the upstream queue until this schedule is hit. Scheduling is defined within the standard scheduling UI, and supports Day/Hour, CRON, or daily start/end times.