edilint / rule reference

hl7batch / error

EL6001

hl7batch.unclosed

Applies to: hl7v2

What it catches and why it matters

FHS or BHS is never closed by a matching FTS or BTS, so the batch envelope is incomplete.

Failing example

These synthetic fragments illustrate the defect; they are not complete interchange files. Backslash escapes name bytes such as \r (CR) and \n (LF).

BHS|^~\&
MSH|^~\&|EXAMPLE
  (no BTS follows)

How to fix it

Restore the complete batch or file envelope, including BTS for BHS and FTS for FHS. Confirm completeness before recounting trailers.

False positives and limits

Bare MSH message streams are valid without batch headers. This pairing rule applies when envelope segments are present; partial captures may omit the closing segment.

Acknowledgments and suppression

No direct acknowledgment code is mapped for this rule.
HL7 ACKs acknowledge individual messages. Batch/file envelope and count errors have no universal ACK code; response batches and error handling depend on the partner agreement. ERR-3 uses Table 0357 and does not determine the acknowledgment status in MSA-1.
Sources: https://www.hl7.eu/refactored/ctrl.html (2.10.3.2) https://www.hl7.eu/refactored/segERR.html https://terminology.hl7.org/5.5.0/CodeSystem-v2-0357.html
Suppress the rule with --disable EL6001, or list it under "disable" in .edilint.yml. To accept the occurrences a file already has without suppressing the rule, record them with --write-baseline and run with --baseline.
Reference: https://crb2nu.github.io/edilint/rules/EL6001.html

All rules · Configuration