hl7batch / error
EL6004
hl7batch.batch-count
Applies to: hl7v2
What it catches and why it matters
FTS-1 does not match the recounted BHS batches in the file. An empty FTS-1 is not checked; the field is optional.
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).
FHS|^~\& BHS|^~\& BTS|0 FTS|2 (one batch, declared as two)
How to fix it
Count BHS batches in the file and write that number to FTS-1. Preview edilint fix after confirming the file contains all intended batches.
False positives and limits
Empty FTS-1 is optional and is not checked. A count change cannot recover a batch missing from a truncated export.
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 EL6004, 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/EL6004.html