Skip to content

Skip TA1 segment when checking interchange version#80

Open
AbhinavMir wants to merge 1 commit into
imsweb:masterfrom
AbhinavMir:fix-999-ta1-version-check
Open

Skip TA1 segment when checking interchange version#80
AbhinavMir wants to merge 1 commit into
imsweb:masterfrom
AbhinavMir:fix-999-ta1-version-check

Conversation

@AbhinavMir

Copy link
Copy Markdown

When parsing a 999 (or any) file that contains a TA1 interchange acknowledgement segment between the ISA and GS segments, parsing failed with:

ANSI version 000 not consistent with version specified ANSI837_5010_X231

checkVersionsAreConsistent read the segment immediately after ISA and used its last element as the GS08 version identifier. A TA1 segment is a valid interchange-level segment that can appear between ISA and GS (some clearinghouses include it even when the interchange is accepted), so the check read the TA1 segment's last element (000) instead of the GS version and aborted the parse.

This change scans forward past any interchange-level segments to the GS segment before reading the version.

A new test resource (x12_999_accepted_ta1.txt, the file from the report) and test test999AcceptedWithTA1 cover the case. All existing tests still pass.

The version check read the segment immediately following ISA and treated
its last element as the GS08 version. When a TA1 interchange acknowledgement
segment appears between ISA and GS, the check read TA1 instead of GS and
failed with 'ANSI version 000 not consistent with version specified ...',
aborting the parse.

Scan forward past any interchange-level segments (such as TA1) to the GS
segment before reading the version. Adds a 999 test file with a TA1 segment.
@ctmay4

ctmay4 commented Jun 17, 2026

Copy link
Copy Markdown
Member

@angelaszek can you please take a look?

@ctmay4 ctmay4 requested a review from angelaszek June 17, 2026 12:08
@ctmay4

ctmay4 commented Jun 17, 2026

Copy link
Copy Markdown
Member

Please merge master into this branch to fix build errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants