Skip TA1 segment when checking interchange version#80
Open
AbhinavMir wants to merge 1 commit into
Open
Conversation
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.
Member
|
@angelaszek can you please take a look? |
Member
|
Please merge master into this branch to fix build errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When parsing a 999 (or any) file that contains a TA1 interchange acknowledgement segment between the ISA and GS segments, parsing failed with:
checkVersionsAreConsistentread 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 testtest999AcceptedWithTA1cover the case. All existing tests still pass.