edilint / rule reference

hl7batch / error

EL6003

hl7batch.message-count

Applies to: hl7v2

What it catches and why it matters

BTS-1 does not match the recounted MSH messages in the batch. An empty BTS-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).

BHS|^~\&
MSH|^~\&|EXAMPLE
BTS|2
  (one MSH, declared as two)

How to fix it

Count MSH messages in the batch and write that number to BTS-1. Preview edilint fix after verifying that no messages were lost.

False positives and limits

Empty BTS-1 is optional and is not checked. Malformed batch structure can affect the recount; fix envelope errors first.

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 EL6003, 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/EL6003.html

All rules · Configuration