EDI and healthcare flat files
Understand the finding.
Fix the source.
edilint checks X12, HL7v2, EDIFACT, delimited, and fixed-width files for envelope defects and file hygiene problems. Each rule below explains what it catches, how to repair it, and when to adjust the check.
go install github.com/crb2nu/edilint/cmd/edilint@latest edilint your-file.x12
The CLI runs locally with no network calls or telemetry. A clean file produces no output. This reference describes the current main branch; older releases may contain fewer rules. See the scope and limits.
Rule catalog 48 rules
Find the EL#### identifier from your diagnostic. Use your browser's find command to search by identifier, name, or format.
| Rule | Default | Applies to |
|---|---|---|
EL1001charset.bom | error | all (warning for delimited) |
EL1002charset.invalid-utf8 | error | all |
EL1003charset.nonprintable | error | all |
EL1004charset.zero-width | error | all |
EL1005charset.homoglyph | error | all |
EL1006charset.nonascii | warning | all |
EL1007charset.x12-basic | warning | x12 (requires --charset basic) |
EL1008charset.x12-extended | error | x12 |
EL2001terminator.mixed | error | hl7v2, delimited, fixed, text |
EL2002terminator.missing-final | warning | hl7v2, delimited, fixed, text |
EL2003terminator.x12-segment | error | x12 |
EL2004terminator.x12-padding | warning | x12 |
EL2005terminator.x12-separator | error | x12 |
EL2006terminator.edifact-segment | error | edifact |
EL3001envelope.isa-length | error | x12 |
EL3002envelope.nesting | error | x12 |
EL3003envelope.unclosed | error | x12 |
EL3004envelope.unopened | error | x12 |
EL3005envelope.control-number | error | x12 |
EL3006envelope.segment-count | error | x12 |
EL3007envelope.group-count | error | x12 |
EL3008envelope.interchange-count | error | x12 |
EL3009envelope.duplicate-control-number | error | x12 |
EL3010envelope.datetime | error | x12 |
EL3011envelope.missing-control-id | error | x12 |
EL3012envelope.trailing-data | error | x12 |
EL4001counts.mismatch | error | all (requires --count-rule) |
EL4002counts.unparsable | error | all (requires --count-rule) |
EL4003counts.missing-field | error | all (requires --count-rule) |
EL4004counts.no-declaring-record | warning | all (requires --count-rule) |
EL4101fields.count-outlier | error | delimited, hl7v2 (warning) |
EL5001layout.length | error | fixed (requires --layout) |
EL5002layout.padding | warning | fixed (requires --layout) |
EL6001hl7batch.unclosed | error | hl7v2 |
EL6002hl7batch.unopened | error | hl7v2 |
EL6003hl7batch.message-count | error | hl7v2 |
EL6004hl7batch.batch-count | error | hl7v2 |
EL6005hl7batch.separator | error | hl7v2 |
EL6006hl7batch.stray-message | warning | hl7v2 |
EL7001edifact.unclosed | error | edifact |
EL7002edifact.unopened | error | edifact |
EL7003edifact.segment-count | error | edifact |
EL7004edifact.group-count | error | edifact |
EL7005edifact.interchange-count | error | edifact |
EL7006edifact.control-reference | error | edifact |
EL7007edifact.service-string | error | edifact |
EL7008edifact.nesting | error | edifact |
EL7009edifact.trailing-data | error | edifact |
Adopt checks gradually
Use --disable EL3006 for a rule that does not fit your feed. Use --write-baseline and --baseline to accept existing findings while catching new ones. Per-rule pages explain the tradeoffs; the configuration guide covers severity overrides and file settings.