-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation of sibling detail tables is wrong #7
Conversation
Navigation of sibling detail tables is wrong
This change required care to point out specifications that may be parsed unexpectedly. Detail tables are, by definition, always repeatable. New occurrences of the table's entry point (e.g., an As a result, even if the table's entry point is marked repeatable, it will never be parsed such that it occurs consecutively -- because it will be placed in a separate table. Now
You will need to change the repeat count to |
Navigation of sibling detail tables is wrong
Navigation of sibling detail tables is wrong
In transactions that have multiple detail tables,
m.find
behaves incorrectly when iterating their start segments. This happens under very specific circumstances. Consider this 277 Health Care Information Status Notification transaction where theHL
segments denote the start of a loop (and possibly a table).When building the parse tree, a heuristic is used: the segment is placed within the current structure if possible, but a new "uncle" structure is created only if the current structure cannot be used. For example, if two
HL*..*..*19
occur consecutively, they will be placed in adjacent loops within the same table.However, if an
HL*..*..*20
is placed between them, eachHL
segment must be placed in separate tables.This is a reasonable heuristic for constructing the parse tree. However, the same heuristic is used when traversing the parse tree. If we're currently positioned at an
HL*..*..*19
and we callm.find(:HL, nil, nil, "19")
, the search is incorrectly limited to within the current loop. In the example above, we cannot reach the thirdHL
segment because it was placed in an "uncle" table, which is outside the scope of our search.Note that we can reach all
HL
segments by removing the element constraints:m.find(:HL)
should first search for sibling loops within the current table, then search uncle tables. This was addressed in #6.