Skip to content

Do tables repeat? #172

@kputnam

Description

@kputnam

Most X12 transaction set definitions have three tables: a header table, a detail table, and a summary table. The header and summary tables usually begin with a non-repeatable segment (eg, ST and SE); it seems clear that the tables must only occur once. In HP835, the summary table begins with an optional, repeatable PLB segment; however, it still doesn't make sense for the table to be repeated, because that would allow more than one SE segment.

Unlike header and summary tables, it's less clear if entire detail tables can be repeated, or if only the loop directly inside the tables can repeat. In most cases there is only a single detail table, and it begins with a repeatable loop; it's not clear if occurrences of that loop should each be placed in the same table or each in their own table. For most purposes, it doesn't matter. Currently (v1.2.0), each loop will be parsed into a separate table.

In other cases, there are detail tables which begin with either a non-repeatable segment or loop (005010X214 HN277). It's not clear if the table should be allowed to repeat, but most likely it should not. Finally, there are cases where a transaction set has multiple detail tables (005010X214 HN277). When these begin with repeatable segments or loops, then the ambiguity about repeating tables becomes significant.

If tables cannot repeat, then interleaving multiple detail tables would not be allowed. For example, in 005010 HN277, Table 2 - Billing Provider Detail begins with a repeatble HL**19 loop, and Table 2 - Patient Detail begins with a repeatable HL**PT loop. Suppose the input contains the sequence HL**19,HL**19, HL**PT. This could be organized into a single Billing Provider Detail table (with two occurrences of the HL**19 loop), followed by a single Patient Detail table. Now suppose the order is changed to HL**19, HL**PT, HL**19. This must construct at least two Billing Provider Detail tables. If tables cannot be repeated, this would be a syntax error.

I have sent a request to X12 for clarification, but I expect it will take a few months for a response. In the meantime, I will be changing TableDef.detail to define a non-repeatable table, and I will add TableDef.repeatable_detail as its counterpart. One advantage of this change is that TransactionSetDefs will more closely match the documentation they're derived from, both superficially and meaningfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions