From 79a540bb7f135930964d52716eba64279bb1a5aa Mon Sep 17 00:00:00 2001 From: JF Technology <57098161+jf-tech@users.noreply.github.com> Date: Wed, 26 Jul 2023 07:38:42 +1200 Subject: [PATCH] Introducing `repetition_delimiter` to EDI schema. (#215) Issue: https://github.com/jf-tech/omniparser/issues/212 `repetition_delimiter`: delimiter to separate multiple data instances for an element. For example, if `^` is the repetition delimiter for a segment `DMG*D8*19690815*M**A^B^C^D~`, then the last element has 4 pieces of data: `A`, `B`, `C`, and `D`. Any element without `repetition_delimiter` present has essentially one piece of data; similarly, if `^` is the repetition delimiter for a segment `CLM*A37YH556*500***11:B:1^12:B:2~`, the last element has 2 pieces of data: `11:B:1` and `12:B:2`, each of which is further delimited by a `component_delimiter` `:`. Note, since `repetition_delimiter` creates multiple pieces of data under the same element name in the schema, in most cases the suitable construct type in `transform_declarations` is `array`. Currently we read in all the elements and their components in serial in `NonValidatingReader` into a slice: `[]RawSegElem`, each of which contains the element value, the element index, and component index if there are more than 1 component. When `repetition_delimiter` is added, we continue down the same pattern: `NonValidatingReader` still reads everything into the slice, except now, there potentially can be multiple `RawSegElem` share the same `ElemIndex` and `CompIndex`. Using the example above: `^` is the rep delim and seg is `CLM*A37YH556*500***11:B:1^12:B:2~`. After `NonValidatingReader.Read()` is done, we'll have the following `[]RawSegElem` (simplified): ``` { {'CLM', ElemIndex: 0, CompIndex: 1}, {'A37YH556', ElemIndex: 1, CompIndex: 1}, {'500', ElemIndex: 2, CompIndex: 1}, {'', ElemIndex: 3, CompIndex: 1}, {'', ElemIndex: 4, CompIndex: 1}, {'', ElemIndex: 4, CompIndex: 1}, {'11', ElemIndex: 5, CompIndex: 1}, {'B', ElemIndex: 5, CompIndex: 2}, {'1', ElemIndex: 5, CompIndex: 3}, {'12', ElemIndex: 5, CompIndex: 1}, {'B', ElemIndex: 5, CompIndex: 2}, {'2', ElemIndex: 5, CompIndex: 3}, } ``` Note the last 3 elements have the same `ElemIndex` and `CompIndex` as the previous 3 elements. This behavior is new and introduced in this PR. Now on the EDI reader side (reader.go), previously when we match element decl against the raw element slice, we only do one way scan, because `ElemIndex` and `CompIndex` are always increase, thus we never need to back-scan. With introduction of potentially duplicate `ElemIndex` and `CompIndex`, now for each of the element decl, we simply do a full `[]RawSegElem` scan. Yes, it is a bit more expensive but given usually the number of total elements and components in a seg is really really small (around 20), we feel this trade-off is acceptable without making the already-complex code even more so. With this reader change, the IDR produced will potentially contain child element nodes with the same element name. Thus in schema writing, it's practically required that the user of the `repetition_delimiter` feature needs to use `array` type in the `transform_declarations`. --- doc/edi_in_depth.md | 12 +- ...estRead-1_seg_decl_with_rep-delim,_success | 155 + .../.snapshots/TestRead-2_seg_decls,_success | 164 +- ...ead-2_seg_groups,_filtered_target,_success | 164 +- ...Read-multiple_root_level_segments,_success | 70 +- ...-seg_min_not_satisfied_before_EOF,_failure | 82 +- ..._seg_decl,_multiple_seg_instances,_success | 164 +- .../TestRead-unprocessed_raw_segment,_failure | 12 +- extensions/omniv21/fileformat/edi/decl.go | 1 + extensions/omniv21/fileformat/edi/reader.go | 25 +- extensions/omniv21/fileformat/edi/reader2.go | 86 +- .../omniv21/fileformat/edi/reader_test.go | 72 +- .../samples/edi/.snapshots/Test3_X12_834 | 12 + .../omniv21/samples/edi/3_x12_834.input.txt | 163 + .../omniv21/samples/edi/3_x12_834.schema.json | 5804 +++++++++++++++++ extensions/omniv21/samples/edi/edi_test.go | 126 +- .../samples/fixedlength2/fixedlength_test.go | 1 - .../omniv21/validation/ediFileDeclaration.go | 2 + .../validation/ediFileDeclaration.json | 3 +- idr/marshal1.go | 9 +- idr/marshal2.go | 3 +- 21 files changed, 7025 insertions(+), 105 deletions(-) create mode 100644 extensions/omniv21/fileformat/edi/.snapshots/TestRead-1_seg_decl_with_rep-delim,_success create mode 100644 extensions/omniv21/samples/edi/.snapshots/Test3_X12_834 create mode 100644 extensions/omniv21/samples/edi/3_x12_834.input.txt create mode 100644 extensions/omniv21/samples/edi/3_x12_834.schema.json diff --git a/doc/edi_in_depth.md b/doc/edi_in_depth.md index 7c30339..ae3f866 100644 --- a/doc/edi_in_depth.md +++ b/doc/edi_in_depth.md @@ -87,6 +87,7 @@ A full EDI schema `file_declaration` is as follows: "segment_delimiter": "", <== required "element_delimiter": "", <== required "component_delimiter": "", <== optional + "repetition_delimiter": "", <== optional "release_character": "", <== optional "ignore_crlf": true/false, <== optional "segment_declarations": [ @@ -126,6 +127,15 @@ standards call for a single ASCII character as `element_delimiter`, omniparser a `component_delimiter` in omniparser allows UTF-8 string. This is optional, and if not specified, you can treat each element as of a single component. +- `repetition_delimiter`: delimiter to separate multiple data instances for an element. For example, +if `^` is the repetition delimiter for a segment `DMG*D8*19690815*M**A^B^C^D~`, then the last +element has 4 pieces of data: `A`, `B`, `C`, and `D`. Any element without `repetition_delimiter` +present has essentially one piece of data; similarly, if `^` is the repetition delimiter for a +segment `CLM*A37YH556*500***11:B:1^12:B:2~`, the last element has 2 pieces of data: `11:B:1` and +`12:B:2`, each of which is further delimited by a `component_delimiter` `:`. Note, since +`repetition_delimiter` creates multiple pieces of data under the same element name in the schema, +in most cases the suitable construct type in `transform_declarations` is `array`. + - `release_character`: an optional escape character for delimiters. Imagine a piece of element data contains a `*` which happens to be `element_delimiter`. Without escaping, parser would treat that `*` as a real delimiter. Any character preceded by `release_character` will be treated literally. @@ -550,7 +560,7 @@ And we can add the transform reference into the `FINAL_OUTPUT` directly: ``` Run cli we have: ``` -$ cli.sh transform -i 2_ups_edi_210.input.txt -s test.schema.json +$ cli.sh transform -i 2_ups_edi_210.input.txt -s test.schema.json [ { "invoice_number": "0000001808WW308" diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-1_seg_decl_with_rep-delim,_success b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-1_seg_decl_with_rep-delim,_success new file mode 100644 index 0000000..484c3eb --- /dev/null +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-1_seg_decl_with_rep-delim,_success @@ -0,0 +1,155 @@ +{ + "Records": [ + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "D8", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode d8)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "d8", + "FirstChild": "(TextNode 'D8')", + "FormatSpecific": null, + "LastChild": "(TextNode 'D8')", + "NextSibling": "(ElementNode d_date)", + "Parent": "(ElementNode DMG)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "19910512", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode d_date)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "d_date", + "FirstChild": "(TextNode '19910512')", + "FormatSpecific": null, + "LastChild": "(TextNode '19910512')", + "NextSibling": "(ElementNode d_cat)", + "Parent": "(ElementNode DMG)", + "PrevSibling": "(ElementNode d8)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "RET", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode d_cat)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "d_cat", + "FirstChild": "(TextNode 'RET')", + "FormatSpecific": null, + "LastChild": "(TextNode 'RET')", + "NextSibling": "(ElementNode d_cat)", + "Parent": "(ElementNode DMG)", + "PrevSibling": "(ElementNode d_date)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "RET", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode d_cat)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "d_cat", + "FirstChild": "(TextNode 'RET')", + "FormatSpecific": null, + "LastChild": "(TextNode 'RET')", + "NextSibling": "(ElementNode d_code)", + "Parent": "(ElementNode DMG)", + "PrevSibling": "(ElementNode d_cat)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "2135-2", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode d_code)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "d_code", + "FirstChild": "(TextNode '2135-2')", + "FormatSpecific": null, + "LastChild": "(TextNode '2135-2')", + "NextSibling": "(ElementNode d_code)", + "Parent": "(ElementNode DMG)", + "PrevSibling": "(ElementNode d_cat)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "2106-3", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode d_code)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "d_code", + "FirstChild": "(TextNode '2106-3')", + "FormatSpecific": null, + "LastChild": "(TextNode '2106-3')", + "NextSibling": null, + "Parent": "(ElementNode DMG)", + "PrevSibling": "(ElementNode d_code)", + "Type": "ElementNode" + } + ], + "Data": "DMG", + "FirstChild": "(ElementNode d8)", + "FormatSpecific": null, + "LastChild": "(ElementNode d_code)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + } + ], + "FinalErr": "EOF" +} diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_decls,_success b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_decls,_success index a8433b5..2aa3641 100644 --- a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_decls,_success +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_decls,_success @@ -1,7 +1,167 @@ { "Records": [ - "{'e1':'0','e2':'1','e3':'2'}", - "{'e1':'3','e2':'4','e3':'5'}" + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "0", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '0')", + "FormatSpecific": null, + "LastChild": "(TextNode '0')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "1", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '1')", + "FormatSpecific": null, + "LastChild": "(TextNode '1')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "2", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode '2')", + "FormatSpecific": null, + "LastChild": "(TextNode '2')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "3", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '3')", + "FormatSpecific": null, + "LastChild": "(TextNode '3')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "4", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '4')", + "FormatSpecific": null, + "LastChild": "(TextNode '4')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "5", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode '5')", + "FormatSpecific": null, + "LastChild": "(TextNode '5')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + } ], "FinalErr": "EOF" } diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_groups,_filtered_target,_success b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_groups,_filtered_target,_success index a8433b5..629f5f7 100644 --- a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_groups,_filtered_target,_success +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-2_seg_groups,_filtered_target,_success @@ -1,7 +1,167 @@ { "Records": [ - "{'e1':'0','e2':'1','e3':'2'}", - "{'e1':'3','e2':'4','e3':'5'}" + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "0", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '0')", + "FormatSpecific": null, + "LastChild": "(TextNode '0')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "1", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '1')", + "FormatSpecific": null, + "LastChild": "(TextNode '1')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "2", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode '2')", + "FormatSpecific": null, + "LastChild": "(TextNode '2')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(ElementNode isa_group)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "3", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '3')", + "FormatSpecific": null, + "LastChild": "(TextNode '3')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "4", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '4')", + "FormatSpecific": null, + "LastChild": "(TextNode '4')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "5", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode '5')", + "FormatSpecific": null, + "LastChild": "(TextNode '5')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(ElementNode isa_group)", + "PrevSibling": null, + "Type": "ElementNode" + } ], "FinalErr": "EOF" } diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-multiple_root_level_segments,_success b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-multiple_root_level_segments,_success index 0e5407f..b5d3f5c 100644 --- a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-multiple_root_level_segments,_success +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-multiple_root_level_segments,_success @@ -1,7 +1,73 @@ { "Records": [ - "{'IEA':{},'ISA':{}}", - "{'IEA':{},'ISA':{}}" + { + "Children": [ + { + "Children": null, + "Data": "ISA", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": "(ElementNode IEA)", + "Parent": "(ElementNode group1)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": null, + "Data": "IEA", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode group1)", + "PrevSibling": "(ElementNode ISA)", + "Type": "ElementNode" + } + ], + "Data": "group1", + "FirstChild": "(ElementNode ISA)", + "FormatSpecific": null, + "LastChild": "(ElementNode IEA)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "ISA", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": "(ElementNode IEA)", + "Parent": "(ElementNode group1)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": null, + "Data": "IEA", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode group1)", + "PrevSibling": "(ElementNode ISA)", + "Type": "ElementNode" + } + ], + "Data": "group1", + "FirstChild": "(ElementNode ISA)", + "FormatSpecific": null, + "LastChild": "(ElementNode IEA)", + "NextSibling": null, + "Parent": "(ElementNode #root)", + "PrevSibling": null, + "Type": "ElementNode" + } ], "FinalErr": "EOF" } diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-seg_min_not_satisfied_before_EOF,_failure b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-seg_min_not_satisfied_before_EOF,_failure index a86155d..65f5581 100644 --- a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-seg_min_not_satisfied_before_EOF,_failure +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-seg_min_not_satisfied_before_EOF,_failure @@ -1,6 +1,86 @@ { "Records": [ - "{'e1':'0','e2':'1','e3':'2'}" + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "0", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '0')", + "FormatSpecific": null, + "LastChild": "(TextNode '0')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "1", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '1')", + "FormatSpecific": null, + "LastChild": "(TextNode '1')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "2", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode '2')", + "FormatSpecific": null, + "LastChild": "(TextNode '2')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + } ], "FinalErr": "input 'test' at segment no.3 (char[11,11]): segment 'IEA' needs min occur 1, but only got 0" } diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-single_seg_decl,_multiple_seg_instances,_success b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-single_seg_decl,_multiple_seg_instances,_success index d3f1f4c..a395ef5 100644 --- a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-single_seg_decl,_multiple_seg_instances,_success +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-single_seg_decl,_multiple_seg_instances,_success @@ -1,7 +1,167 @@ { "Records": [ - "{'e1':'0','e2':'1','e3':'2'}", - "{'e1':'3','e2':'','e3':'x'}" + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "0", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '0')", + "FormatSpecific": null, + "LastChild": "(TextNode '0')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "1", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '1')", + "FormatSpecific": null, + "LastChild": "(TextNode '1')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "2", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode '2')", + "FormatSpecific": null, + "LastChild": "(TextNode '2')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": [ + { + "Children": null, + "Data": "3", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e1)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e1", + "FirstChild": "(TextNode '3')", + "FormatSpecific": null, + "LastChild": "(TextNode '3')", + "NextSibling": "(ElementNode e2)", + "Parent": "(ElementNode ISA)", + "PrevSibling": null, + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e2)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e2", + "FirstChild": "(TextNode '')", + "FormatSpecific": null, + "LastChild": "(TextNode '')", + "NextSibling": "(ElementNode e3)", + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e1)", + "Type": "ElementNode" + }, + { + "Children": [ + { + "Children": null, + "Data": "x", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(ElementNode e3)", + "PrevSibling": null, + "Type": "TextNode" + } + ], + "Data": "e3", + "FirstChild": "(TextNode 'x')", + "FormatSpecific": null, + "LastChild": "(TextNode 'x')", + "NextSibling": null, + "Parent": "(ElementNode ISA)", + "PrevSibling": "(ElementNode e2)", + "Type": "ElementNode" + } + ], + "Data": "ISA", + "FirstChild": "(ElementNode e1)", + "FormatSpecific": null, + "LastChild": "(ElementNode e3)", + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + } ], "FinalErr": "EOF" } diff --git a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-unprocessed_raw_segment,_failure b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-unprocessed_raw_segment,_failure index b64d2b0..5ad104d 100644 --- a/extensions/omniv21/fileformat/edi/.snapshots/TestRead-unprocessed_raw_segment,_failure +++ b/extensions/omniv21/fileformat/edi/.snapshots/TestRead-unprocessed_raw_segment,_failure @@ -1,6 +1,16 @@ { "Records": [ - "{}" + { + "Children": null, + "Data": "ISA", + "FirstChild": null, + "FormatSpecific": null, + "LastChild": null, + "NextSibling": null, + "Parent": "(DocumentNode)", + "PrevSibling": null, + "Type": "ElementNode" + } ], "FinalErr": "input 'test' at segment no.2 (char[13,13]): segment 'UNKNOWN' is either not declared in schema or appears in an invalid order" } diff --git a/extensions/omniv21/fileformat/edi/decl.go b/extensions/omniv21/fileformat/edi/decl.go index d43574d..ab11e7f 100644 --- a/extensions/omniv21/fileformat/edi/decl.go +++ b/extensions/omniv21/fileformat/edi/decl.go @@ -5,6 +5,7 @@ type FileDecl struct { SegDelim string `json:"segment_delimiter,omitempty"` ElemDelim string `json:"element_delimiter,omitempty"` CompDelim *string `json:"component_delimiter,omitempty"` + RepDelim *string `json:"repetition_delimiter,omitempty"` ReleaseChar *string `json:"release_character,omitempty"` IgnoreCRLF bool `json:"ignore_crlf,omitempty"` SegDecls []*SegDecl `json:"segment_declarations,omitempty"` diff --git a/extensions/omniv21/fileformat/edi/reader.go b/extensions/omniv21/fileformat/edi/reader.go index 219be01..86c1b19 100644 --- a/extensions/omniv21/fileformat/edi/reader.go +++ b/extensions/omniv21/fileformat/edi/reader.go @@ -103,23 +103,26 @@ func (r *ediReader) rawSegToNode(segDecl *SegDecl) (*idr.Node, error) { panic("unprocessedRawSeg is not valid") } n := idr.CreateNode(idr.ElementNode, segDecl.Name) - rawElems := r.unprocessedRawSeg.Elems for _, elemDecl := range segDecl.Elems { - rawElemIndex := 0 - for ; rawElemIndex < len(rawElems); rawElemIndex++ { - if rawElems[rawElemIndex].ElemIndex == elemDecl.Index && - rawElems[rawElemIndex].CompIndex == elemDecl.compIndex() { - break + found := false + for _, rawElem := range r.unprocessedRawSeg.Elems { + if rawElem.ElemIndex == elemDecl.Index && rawElem.CompIndex == elemDecl.compIndex() { + elemN := idr.CreateNode(idr.ElementNode, elemDecl.Name) + idr.AddChild(n, elemN) + data := string(strs.ByteUnescape(rawElem.Data, r.releaseChar.b, true)) + elemV := idr.CreateNode(idr.TextNode, data) + idr.AddChild(elemN, elemV) + found = true } } - if rawElemIndex < len(rawElems) || elemDecl.EmptyIfMissing || elemDecl.Default != nil { + if found { + continue + } + if elemDecl.EmptyIfMissing || elemDecl.Default != nil { elemN := idr.CreateNode(idr.ElementNode, elemDecl.Name) idr.AddChild(n, elemN) data := "" - if rawElemIndex < len(rawElems) { - data = string(strs.ByteUnescape(rawElems[rawElemIndex].Data, r.releaseChar.b, true)) - rawElemIndex++ - } else if elemDecl.Default != nil { + if elemDecl.Default != nil { data = *elemDecl.Default } elemV := idr.CreateNode(idr.TextNode, data) diff --git a/extensions/omniv21/fileformat/edi/reader2.go b/extensions/omniv21/fileformat/edi/reader2.go index 395a22a..105afbd 100644 --- a/extensions/omniv21/fileformat/edi/reader2.go +++ b/extensions/omniv21/fileformat/edi/reader2.go @@ -48,8 +48,9 @@ type RawSeg struct { } const ( - defaultElemsPerSeg = 32 - defaultCompsPerElem = 8 + defaultElemsPerSeg = 32 // default # of elements per segment + defaultCompsPerElem = 8 // default # of components per element + defaultRepsPerElem = 4 // default # of repetitions per element ) func newRawSeg() RawSeg { @@ -112,6 +113,7 @@ type NonValidatingReader struct { segDelim strPtrByte elemDelim strPtrByte compDelim strPtrByte + repDelim strPtrByte releaseChar strPtrByte runeBegin, runeEnd int segCount int @@ -121,7 +123,6 @@ type NonValidatingReader struct { // Read returns a raw segment of an EDI document. Note all the []byte are not a copy, so READONLY, // no modification. func (r *NonValidatingReader) Read() (RawSeg, error) { - resetRawSeg(&r.rawSeg) var token []byte for r.scanner.Scan() { b := r.scanner.Bytes() @@ -149,10 +150,17 @@ func (r *NonValidatingReader) Read() (RawSeg, error) { if token == nil { return RawSeg{}, io.EOF } - // From now on, the important thing is to operate on token (of []byte) without modification and without - // allocation to keep performance. - r.rawSeg.Raw = token - // First we need to drop the trailing segment delimiter. + if err = r.readToken(token, &r.rawSeg); err != nil { + return RawSeg{}, err + } + return r.rawSeg, nil +} + +func (r *NonValidatingReader) readToken(token []byte, rawSeg *RawSeg) error { + resetRawSeg(rawSeg) + // Remember the token is a reference into the actual scanner, so do not modify. + rawSeg.Raw = token + // First we need to "drop" the trailing segment delimiter. noSegDelim := token[:len(token)-len(r.segDelim.b)] // In rare occasions, input uses '\n' as segment delimiter, but '\r' somehow // gets included as well (more common in business platform running on Windows) @@ -161,36 +169,46 @@ func (r *NonValidatingReader) Read() (RawSeg, error) { noSegDelim = noSegDelim[:len(noSegDelim)-utf8.RuneLen('\r')] } for i, elem := range strs.ByteSplitWithEsc(noSegDelim, r.elemDelim.b, r.releaseChar.b, defaultElemsPerSeg) { - if len(r.compDelim.b) == 0 { - // if we don't have comp delimiter, treat the entire element as one component. - r.rawSeg.Elems = append( - r.rawSeg.Elems, - RawSegElem{ - // while (element) index in schema starts with 1, it actually refers to the first element - // AFTER the seg name element, thus we can use i as ElemIndex directly. - ElemIndex: i, - // comp_index always starts with 1 - CompIndex: 1, - Data: elem, - }) - continue + // If an element value contains repetition delimiters, that value is really a concatenation + // of multiple element values. + var elemVals [][]byte + if len(r.repDelim.b) != 0 { + elemVals = strs.ByteSplitWithEsc(elem, r.repDelim.b, r.releaseChar.b, defaultRepsPerElem) + } else { + elemVals = [][]byte{elem} } - for j, comp := range strs.ByteSplitWithEsc(elem, r.compDelim.b, r.releaseChar.b, defaultCompsPerElem) { - r.rawSeg.Elems = append( - r.rawSeg.Elems, - RawSegElem{ - ElemIndex: i, - CompIndex: j + 1, - Data: comp, - }) + for _, elemVal := range elemVals { + if len(r.compDelim.b) == 0 { + // if we don't have comp delimiter, treat the entire element as one component. + rawSeg.Elems = append( + rawSeg.Elems, + RawSegElem{ + // while (element) index in schema starts with 1, it actually refers to the first element + // AFTER the seg name element, thus we can use i as ElemIndex directly. + ElemIndex: i, + // comp_index always starts with 1 + CompIndex: 1, + Data: elemVal, + }) + continue + } + for j, comp := range strs.ByteSplitWithEsc(elemVal, r.compDelim.b, r.releaseChar.b, defaultCompsPerElem) { + rawSeg.Elems = append( + rawSeg.Elems, + RawSegElem{ + ElemIndex: i, + CompIndex: j + 1, + Data: comp, + }) + } } } - if len(r.rawSeg.Elems) == 0 || len(r.rawSeg.Elems[0].Data) == 0 { - return RawSeg{}, ErrInvalidEDI("missing segment name") + if len(rawSeg.Elems) == 0 || len(rawSeg.Elems[0].Data) == 0 { + return ErrInvalidEDI("missing segment name") } - r.rawSeg.Name = string(r.rawSeg.Elems[0].Data) - r.rawSeg.valid = true - return r.rawSeg, nil + rawSeg.Name = string(rawSeg.Elems[0].Data) + rawSeg.valid = true + return nil } // RuneBegin returns the current reader's beginning rune position. @@ -213,6 +231,7 @@ func NewNonValidatingReader(r io.Reader, decl *FileDecl) *NonValidatingReader { segDelim := newStrPtrByte(&decl.SegDelim) elemDelim := newStrPtrByte(&decl.ElemDelim) compDelim := newStrPtrByte(decl.CompDelim) + repDelim := newStrPtrByte(decl.RepDelim) releaseChar := newStrPtrByte(decl.ReleaseChar) if decl.IgnoreCRLF { r = ios.NewBytesReplacingReader(r, crBytes, nil) @@ -224,6 +243,7 @@ func NewNonValidatingReader(r io.Reader, decl *FileDecl) *NonValidatingReader { segDelim: segDelim, elemDelim: elemDelim, compDelim: compDelim, + repDelim: repDelim, releaseChar: releaseChar, runeBegin: 1, runeEnd: 1, diff --git a/extensions/omniv21/fileformat/edi/reader_test.go b/extensions/omniv21/fileformat/edi/reader_test.go index 13b68e0..c12f742 100644 --- a/extensions/omniv21/fileformat/edi/reader_test.go +++ b/extensions/omniv21/fileformat/edi/reader_test.go @@ -281,6 +281,45 @@ func TestGetUnprocessedRawSeg(t *testing.T) { {rawSeg: RawSeg{}, err: io.EOF.Error()}, }, }, + { + name: "| seg-delim; multi-seg; no comp-delim; ^ rep-delim; ? release-char", + input: strings.NewReader("seg1*^e11^e12^*e2|seg2*e3?^|"), + decl: FileDecl{ + SegDelim: "|", + ElemDelim: "*", + RepDelim: strs.StrPtr("^"), + ReleaseChar: strs.StrPtr("?"), + }, + expected: []result{ + { + rawSeg: RawSeg{ + valid: true, + Name: "seg1", + Raw: []byte("seg1*^e11^e12^*e2|"), + Elems: []RawSegElem{ + {ElemIndex: 0, CompIndex: 1, Data: []byte("seg1")}, + {ElemIndex: 1, CompIndex: 1, Data: []byte("")}, + {ElemIndex: 1, CompIndex: 1, Data: []byte("e11")}, + {ElemIndex: 1, CompIndex: 1, Data: []byte("e12")}, + {ElemIndex: 1, CompIndex: 1, Data: []byte("")}, + {ElemIndex: 2, CompIndex: 1, Data: []byte("e2")}, + }, + }, + }, + { + rawSeg: RawSeg{ + valid: true, + Name: "seg2", + Raw: []byte("seg2*e3?^|"), + Elems: []RawSegElem{ + {ElemIndex: 0, CompIndex: 1, Data: []byte("seg2")}, + {ElemIndex: 1, CompIndex: 1, Data: []byte("e3?^")}, + }, + }, + }, + {rawSeg: RawSeg{}, err: io.EOF.Error()}, + }, + }, } { t.Run(test.name, func(t *testing.T) { reader, err := NewReader("test", test.input, &test.decl, "") @@ -672,6 +711,31 @@ func TestRead(t *testing.T) { xpath: "", readerCreationErr: "", }, + { + name: "1 seg decl with rep-delim, success", + input: "DMG*D8*19910512*M*M*:RET:2135-2^:RET:2106-3~", + declJSON: ` + { + "segment_delimiter": "~", + "element_delimiter": "*", + "component_delimiter": ":", + "repetition_delimiter": "^", + "segment_declarations": [ + { + "name": "DMG", + "is_target": true, + "elements": [ + { "name": "d8", "index": 1 }, + { "name": "d_date", "index": 2 }, + { "name": "d_cat", "index": 5, "component_index": 2 }, + { "name": "d_code", "index": 5, "component_index": 3 } + ] + } + ] + }`, + xpath: "", + readerCreationErr: "", + }, { name: "2 seg groups, filtered target, success", input: "ISA*0*1*2|\nISA*3*4*5|\nISA*6*7*8|\r\nIEA*6|\n", @@ -824,7 +888,7 @@ func TestRead(t *testing.T) { { "name": "ISA", "is_target": true, - "min": 0 + "min": 0 } ] }`, @@ -870,7 +934,7 @@ func TestRead(t *testing.T) { return } assert.NoError(t, err) - var records []string + var records []interface{} var finalErr error for { n, err := reader.Read() @@ -878,11 +942,11 @@ func TestRead(t *testing.T) { finalErr = err break } - records = append(records, strings.ReplaceAll(idr.JSONify2(n), `"`, `'`)) + records = append(records, idr.J1NodeToInterface(n)) } cupaloy.SnapshotT(t, jsons.BPM( struct { - Records []string + Records []interface{} FinalErr string }{ Records: records, diff --git a/extensions/omniv21/samples/edi/.snapshots/Test3_X12_834 b/extensions/omniv21/samples/edi/.snapshots/Test3_X12_834 new file mode 100644 index 0000000..f108219 --- /dev/null +++ b/extensions/omniv21/samples/edi/.snapshots/Test3_X12_834 @@ -0,0 +1,12 @@ +[ + { + "RawRecord": "{\"BGN\":{\"BGN01\":\"00\",\"BGN02\":\"70023\",\"BGN03\":\"20211212\",\"BGN04\":\"152025\",\"BGN05\":\"ET\",\"BGN06\":\"\",\"BGN07\":\"\",\"BGN08\":\"2\",\"BGN09\":\"\"},\"LOOP1000\":[{\"N1\":{\"N101\":\"P5\",\"N102\":\"JANE SMITH\",\"N103\":\"FI\",\"N104\":\"234567890\",\"N105\":\"\",\"N106\":\"\"}},{\"N1\":{\"N101\":\"IN\",\"N102\":\"ISSUER BUSINESS NAME\",\"N103\":\"FI\",\"N104\":\"987654321\",\"N105\":\"\",\"N106\":\"\"}},{\"N1\":{\"N101\":\"BO\",\"N102\":\"BROKER NAME\",\"N103\":\"94\",\"N104\":\"88888888\",\"N105\":\"\",\"N106\":\"\"}}],\"LOOP2000\":[{\"DTP\":{\"DTP01\":\"356\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"INS\":{\"INS01\":\"Y\",\"INS02\":\"18\",\"INS03\":\"021\",\"INS04\":\"EC\",\"INS05\":\"A\",\"INS06_01\":\"\",\"INS06_02\":\"\",\"INS06_03\":\"\",\"INS06_04\":\"\",\"INS07\":\"\",\"INS08\":\"AC\",\"INS09\":\"\",\"INS10\":\"\",\"INS11\":\"\",\"INS12\":\"\",\"INS13\":\"\",\"INS14\":\"\",\"INS15\":\"\",\"INS16\":\"\",\"INS17\":\"\"},\"LOOP2100\":[{\"DMG\":{\"DMG01\":\"D8\",\"DMG02\":\"19910412\",\"DMG03\":\"F\",\"DMG04\":\"M\",\"DMG05_01\":\"\",\"DMG05_02\":\"\",\"DMG05_03\":\"\",\"DMG06\":\"\",\"DMG07\":\"\",\"DMG08\":\"\",\"DMG09\":\"\",\"DMG10\":\"\",\"DMG11\":\"\"},\"HLH\":{\"HLH01\":\"N\",\"HLH02\":\"\",\"HLH03\":\"\",\"HLH04\":\"\",\"HLH05\":\"\",\"HLH06\":\"\",\"HLH07\":\"\"},\"LUI\":{\"LUI01\":\"LD\",\"LUI02\":\"SPA\",\"LUI03\":\"\",\"LUI04\":\"6\",\"LUI05\":\"\"},\"N3\":{\"N301\":\"1234 MY STREET\",\"N302\":\"\"},\"N4\":{\"N401\":\"YOURTOWN\",\"N402\":\"XX\",\"N403\":\"555553510\",\"N404\":\"\",\"N405\":\"CY\",\"N406\":\"11111\",\"N407\":\"\"},\"NM1\":{\"NM101\":\"IL\",\"NM102\":\"1\",\"NM103\":\"SMITH\",\"NM104\":\"JANE\",\"NM105\":\"\",\"NM106\":\"\",\"NM107\":\"\",\"NM108\":\"34\",\"NM109\":\"234567890\",\"NM110\":\"\",\"NM111\":\"\",\"NM112\":\"\"},\"PER\":{\"PER01\":\"IP\",\"PER02\":\"\",\"PER03\":\"TE\",\"PER04\":\"8885551212\",\"PER05\":\"AP\",\"PER06\":\"8885551212\",\"PER07\":\"\",\"PER08\":\"\",\"PER09\":\"\"}},{\"N3\":{\"N301\":\"45678 MY MAIL STREET\",\"N302\":\"\"},\"N4\":{\"N401\":\"MY MAIL CITY\",\"N402\":\"XX\",\"N403\":\"55556\",\"N404\":\"\",\"N405\":\"\",\"N406\":\"\",\"N407\":\"\"},\"NM1\":{\"NM101\":\"31\",\"NM102\":\"1\",\"NM103\":\"\",\"NM104\":\"\",\"NM105\":\"\",\"NM106\":\"\",\"NM107\":\"\",\"NM108\":\"\",\"NM109\":\"\",\"NM110\":\"\",\"NM111\":\"\",\"NM112\":\"\"}}],\"LOOP2300\":{\"DTP\":{\"DTP01\":\"348\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"HD\":{\"HD01\":\"021\",\"HD02\":\"\",\"HD03\":\"HLT\",\"HD04\":\"\",\"HD05\":\"\",\"HD06\":\"\",\"HD07\":\"\",\"HD08\":\"\",\"HD09\":\"\",\"HD10\":\"\",\"HD11\":\"\"},\"REF\":[{\"REF01\":\"1L\",\"REF02\":\"21479225\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"CE\",\"REF02\":\"12345XX001000301\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},\"LOOP2700\":{\"LE\":{\"LE01\":\"2700\"},\"LOOP2700\":[{\"LOOP2750\":{\"N1\":{\"N101\":\"75\",\"N102\":\"REQUEST SUBMIT TIMESTAMP\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"20211212114142\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"1\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"APTC AMT\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9V\",\"REF02\":\"150.00\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"2\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"PRE AMT 1\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9X\",\"REF02\":\"164.23\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"3\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"PRE AMT TOT\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9X\",\"REF02\":\"528.46\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"4\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"TOT RES AMT\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9V\",\"REF02\":\"378.46\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"5\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"RATING AREA\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9X\",\"REF02\":\"R-XX001\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"6\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"SOURCE EXCHANGE ID\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"XX0\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"7\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20211212\"},\"N1\":{\"N101\":\"75\",\"N102\":\"APPLICATION ID AND ORIGIN\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"6M\",\"REF02\":\"1734584752-11\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"8\"}}],\"LS\":{\"LS01\":\"2700\"}},\"REF\":[{\"REF01\":\"0F\",\"REF02\":\"980111001\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"17\",\"REF02\":\"980111001\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"6O\",\"REF02\":\"XX00020613519\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},{\"DTP\":{\"DTP01\":\"356\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"INS\":{\"INS01\":\"N\",\"INS02\":\"01\",\"INS03\":\"021\",\"INS04\":\"EC\",\"INS05\":\"A\",\"INS06_01\":\"\",\"INS06_02\":\"\",\"INS06_03\":\"\",\"INS06_04\":\"\",\"INS07\":\"\",\"INS08\":\"\",\"INS09\":\"\",\"INS10\":\"\",\"INS11\":\"\",\"INS12\":\"\",\"INS13\":\"\",\"INS14\":\"\",\"INS15\":\"\",\"INS16\":\"\",\"INS17\":\"\"},\"LOOP2100\":{\"DMG\":{\"DMG01\":\"D8\",\"DMG02\":\"19910512\",\"DMG03\":\"M\",\"DMG04\":\"M\",\"DMG05_01\":[\"\",\"\"],\"DMG05_02\":[\"RET\",\"RET\"],\"DMG05_03\":[\"2135-2\",\"2106-3\"],\"DMG06\":\"\",\"DMG07\":\"\",\"DMG08\":\"\",\"DMG09\":\"\",\"DMG10\":\"\",\"DMG11\":\"\"},\"HLH\":{\"HLH01\":\"N\",\"HLH02\":\"\",\"HLH03\":\"\",\"HLH04\":\"\",\"HLH05\":\"\",\"HLH06\":\"\",\"HLH07\":\"\"},\"LUI\":{\"LUI01\":\"LD\",\"LUI02\":\"SPA\",\"LUI03\":\"\",\"LUI04\":\"6\",\"LUI05\":\"\"},\"N3\":{\"N301\":\"1234 MY STREET\",\"N302\":\"\"},\"N4\":{\"N401\":\"YOURTOWN\",\"N402\":\"XX\",\"N403\":\"555553510\",\"N404\":\"\",\"N405\":\"CY\",\"N406\":\"11111\",\"N407\":\"\"},\"NM1\":{\"NM101\":\"IL\",\"NM102\":\"1\",\"NM103\":\"SMITH\",\"NM104\":\"JOHN\",\"NM105\":\"\",\"NM106\":\"\",\"NM107\":\"\",\"NM108\":\"34\",\"NM109\":\"533229865\",\"NM110\":\"\",\"NM111\":\"\",\"NM112\":\"\"},\"PER\":{\"PER01\":\"IP\",\"PER02\":\"\",\"PER03\":\"TE\",\"PER04\":\"8885551212\",\"PER05\":\"AP\",\"PER06\":\"8885551212\",\"PER07\":\"\",\"PER08\":\"\",\"PER09\":\"\"}},\"LOOP2300\":{\"DTP\":{\"DTP01\":\"348\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"HD\":{\"HD01\":\"021\",\"HD02\":\"\",\"HD03\":\"HLT\",\"HD04\":\"\",\"HD05\":\"\",\"HD06\":\"\",\"HD07\":\"\",\"HD08\":\"\",\"HD09\":\"\",\"HD10\":\"\",\"HD11\":\"\"},\"REF\":[{\"REF01\":\"1L\",\"REF02\":\"21479225\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"CE\",\"REF02\":\"12345XX001000301\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},\"LOOP2700\":{\"LE\":{\"LE01\":\"2700\"},\"LOOP2700\":[{\"LOOP2750\":{\"N1\":{\"N101\":\"75\",\"N102\":\"REQUEST SUBMIT TIMESTAMP\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"20211212114142\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"1\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"PRE AMT 1\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9X\",\"REF02\":\"164.23\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"2\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"SOURCE EXCHANGE ID\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"XX0\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"3\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20211212\"},\"N1\":{\"N101\":\"75\",\"N102\":\"APPLICATION ID AND ORIGIN\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"6M\",\"REF02\":\"1734584752-11\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"4\"}}],\"LS\":{\"LS01\":\"2700\"}},\"REF\":[{\"REF01\":\"0F\",\"REF02\":\"980111001\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"17\",\"REF02\":\"980111002\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"6O\",\"REF02\":\"XX00020613519\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},{\"DTP\":{\"DTP01\":\"356\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"INS\":{\"INS01\":\"N\",\"INS02\":\"19\",\"INS03\":\"021\",\"INS04\":\"EC\",\"INS05\":\"A\",\"INS06_01\":\"\",\"INS06_02\":\"\",\"INS06_03\":\"\",\"INS06_04\":\"\",\"INS07\":\"\",\"INS08\":\"\",\"INS09\":\"\",\"INS10\":\"\",\"INS11\":\"\",\"INS12\":\"\",\"INS13\":\"\",\"INS14\":\"\",\"INS15\":\"\",\"INS16\":\"\",\"INS17\":\"\"},\"LOOP2100\":{\"DMG\":{\"DMG01\":\"D8\",\"DMG02\":\"20100522\",\"DMG03\":\"F\",\"DMG04\":\"\",\"DMG05_01\":\"\",\"DMG05_02\":\"\",\"DMG05_03\":\"\",\"DMG06\":\"\",\"DMG07\":\"\",\"DMG08\":\"\",\"DMG09\":\"\",\"DMG10\":\"\",\"DMG11\":\"\"},\"HLH\":{\"HLH01\":\"N\",\"HLH02\":\"\",\"HLH03\":\"\",\"HLH04\":\"\",\"HLH05\":\"\",\"HLH06\":\"\",\"HLH07\":\"\"},\"LUI\":{\"LUI01\":\"LD\",\"LUI02\":\"SPA\",\"LUI03\":\"\",\"LUI04\":\"6\",\"LUI05\":\"\"},\"N3\":{\"N301\":\"1234 MY STREET\",\"N302\":\"\"},\"N4\":{\"N401\":\"YOURTOWN\",\"N402\":\"XX\",\"N403\":\"555553510\",\"N404\":\"\",\"N405\":\"CY\",\"N406\":\"11111\",\"N407\":\"\"},\"NM1\":{\"NM101\":\"IL\",\"NM102\":\"1\",\"NM103\":\"SMITH\",\"NM104\":\"MARY\",\"NM105\":\"\",\"NM106\":\"\",\"NM107\":\"\",\"NM108\":\"34\",\"NM109\":\"543890233\",\"NM110\":\"\",\"NM111\":\"\",\"NM112\":\"\"},\"PER\":{\"PER01\":\"IP\",\"PER02\":\"\",\"PER03\":\"TE\",\"PER04\":\"8885551212\",\"PER05\":\"AP\",\"PER06\":\"8885551212\",\"PER07\":\"\",\"PER08\":\"\",\"PER09\":\"\"}},\"LOOP2300\":{\"DTP\":{\"DTP01\":\"348\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"HD\":{\"HD01\":\"021\",\"HD02\":\"\",\"HD03\":\"HLT\",\"HD04\":\"\",\"HD05\":\"\",\"HD06\":\"\",\"HD07\":\"\",\"HD08\":\"\",\"HD09\":\"\",\"HD10\":\"\",\"HD11\":\"\"},\"REF\":[{\"REF01\":\"1L\",\"REF02\":\"21479225\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"CE\",\"REF02\":\"12345XX001000301\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},\"LOOP2700\":{\"LE\":{\"LE01\":\"2700\"},\"LOOP2700\":[{\"LOOP2750\":{\"N1\":{\"N101\":\"75\",\"N102\":\"REQUEST SUBMIT TIMESTAMP\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"20211212114142\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"1\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"PRE AMT 1\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9X\",\"REF02\":\"100.00\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"2\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"SOURCE EXCHANGE ID\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"XX0\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"3\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20211212\"},\"N1\":{\"N101\":\"75\",\"N102\":\"APPLICATION ID AND ORIGIN\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"6M\",\"REF02\":\"1734584752-11\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"4\"}}],\"LS\":{\"LS01\":\"2700\"}},\"REF\":[{\"REF01\":\"0F\",\"REF02\":\"980111001\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"17\",\"REF02\":\"980111003\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"6O\",\"REF02\":\"XX00020613519\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},{\"DTP\":{\"DTP01\":\"356\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"INS\":{\"INS01\":\"N\",\"INS02\":\"19\",\"INS03\":\"021\",\"INS04\":\"EC\",\"INS05\":\"A\",\"INS06_01\":\"\",\"INS06_02\":\"\",\"INS06_03\":\"\",\"INS06_04\":\"\",\"INS07\":\"\",\"INS08\":\"\",\"INS09\":\"\",\"INS10\":\"\",\"INS11\":\"\",\"INS12\":\"\",\"INS13\":\"\",\"INS14\":\"\",\"INS15\":\"\",\"INS16\":\"\",\"INS17\":\"\"},\"LOOP2100\":{\"DMG\":{\"DMG01\":\"D8\",\"DMG02\":\"20100522\",\"DMG03\":\"M\",\"DMG04\":\"\",\"DMG05_01\":\"\",\"DMG05_02\":\"\",\"DMG05_03\":\"\",\"DMG06\":\"\",\"DMG07\":\"\",\"DMG08\":\"\",\"DMG09\":\"\",\"DMG10\":\"\",\"DMG11\":\"\"},\"HLH\":{\"HLH01\":\"N\",\"HLH02\":\"\",\"HLH03\":\"\",\"HLH04\":\"\",\"HLH05\":\"\",\"HLH06\":\"\",\"HLH07\":\"\"},\"LUI\":{\"LUI01\":\"LD\",\"LUI02\":\"SPA\",\"LUI03\":\"\",\"LUI04\":\"6\",\"LUI05\":\"\"},\"N3\":{\"N301\":\"1234 MY STREET\",\"N302\":\"\"},\"N4\":{\"N401\":\"YOURTOWN\",\"N402\":\"XX\",\"N403\":\"555553510\",\"N404\":\"\",\"N405\":\"CY\",\"N406\":\"11111\",\"N407\":\"\"},\"NM1\":{\"NM101\":\"IL\",\"NM102\":\"1\",\"NM103\":\"SMITH\",\"NM104\":\"TIMMY\",\"NM105\":\"\",\"NM106\":\"\",\"NM107\":\"\",\"NM108\":\"34\",\"NM109\":\"822451288\",\"NM110\":\"\",\"NM111\":\"\",\"NM112\":\"\"},\"PER\":{\"PER01\":\"IP\",\"PER02\":\"\",\"PER03\":\"TE\",\"PER04\":\"8885551212\",\"PER05\":\"AP\",\"PER06\":\"8885551212\",\"PER07\":\"\",\"PER08\":\"\",\"PER09\":\"\"}},\"LOOP2300\":{\"DTP\":{\"DTP01\":\"348\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"HD\":{\"HD01\":\"021\",\"HD02\":\"\",\"HD03\":\"HLT\",\"HD04\":\"\",\"HD05\":\"\",\"HD06\":\"\",\"HD07\":\"\",\"HD08\":\"\",\"HD09\":\"\",\"HD10\":\"\",\"HD11\":\"\"},\"REF\":[{\"REF01\":\"1L\",\"REF02\":\"21479225\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"CE\",\"REF02\":\"12345XX001000301\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]},\"LOOP2700\":{\"LE\":{\"LE01\":\"2700\"},\"LOOP2700\":[{\"LOOP2750\":{\"N1\":{\"N101\":\"75\",\"N102\":\"REQUEST SUBMIT TIMESTAMP\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"20211212114142\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"1\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"PRE AMT 1\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"9X\",\"REF02\":\"100.00\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"2\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20220101\"},\"N1\":{\"N101\":\"75\",\"N102\":\"SOURCE EXCHANGE ID\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"17\",\"REF02\":\"XX0\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"3\"}},{\"LOOP2750\":{\"DTP\":{\"DTP01\":\"007\",\"DTP02\":\"D8\",\"DTP03\":\"20211212\"},\"N1\":{\"N101\":\"75\",\"N102\":\"APPLICATION ID AND ORIGIN\",\"N103\":\"\",\"N104\":\"\",\"N105\":\"\",\"N106\":\"\"},\"REF\":{\"REF01\":\"6M\",\"REF02\":\"1734584752-11\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}},\"LX\":{\"LX01\":\"4\"}}],\"LS\":{\"LS01\":\"2700\"}},\"REF\":[{\"REF01\":\"0F\",\"REF02\":\"980111001\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"17\",\"REF02\":\"980111004\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"},{\"REF01\":\"6O\",\"REF02\":\"XX00020613519\",\"REF03\":\"\",\"REF04_01\":\"\",\"REF04_02\":\"\",\"REF04_03\":\"\",\"REF04_04\":\"\",\"REF04_05\":\"\",\"REF04_06\":\"\"}]}],\"QTY\":[{\"QTY01\":\"TO\",\"QTY02\":\"4\",\"QTY03_01\":\"\",\"QTY03_02\":\"\",\"QTY03_03\":\"\",\"QTY03_04\":\"\",\"QTY03_05\":\"\",\"QTY03_06\":\"\",\"QTY03_07\":\"\",\"QTY03_08\":\"\",\"QTY03_09\":\"\",\"QTY03_10\":\"\",\"QTY03_11\":\"\",\"QTY03_12\":\"\",\"QTY03_13\":\"\",\"QTY03_14\":\"\",\"QTY03_15\":\"\",\"QTY04\":\"\"},{\"QTY01\":\"DT\",\"QTY02\":\"3\",\"QTY03_01\":\"\",\"QTY03_02\":\"\",\"QTY03_03\":\"\",\"QTY03_04\":\"\",\"QTY03_05\":\"\",\"QTY03_06\":\"\",\"QTY03_07\":\"\",\"QTY03_08\":\"\",\"QTY03_09\":\"\",\"QTY03_10\":\"\",\"QTY03_11\":\"\",\"QTY03_12\":\"\",\"QTY03_13\":\"\",\"QTY03_14\":\"\",\"QTY03_15\":\"\",\"QTY04\":\"\"}],\"SE\":{\"SE01\":\"159\",\"SE02\":\"70023\"},\"ST\":{\"ST01\":\"834\",\"ST02\":\"70023\",\"ST03\":\"005010X220A1\"}}", + "RawRecordHash": "54f9833e-8e01-3f12-b01b-8cf6526e1fbd", + "TransformedRecord": { + "race_ethnicity_code": [ + "2135-2", + "2106-3" + ] + } + } +] diff --git a/extensions/omniv21/samples/edi/3_x12_834.input.txt b/extensions/omniv21/samples/edi/3_x12_834.input.txt new file mode 100644 index 0000000..8986c94 --- /dev/null +++ b/extensions/omniv21/samples/edi/3_x12_834.input.txt @@ -0,0 +1,163 @@ +ISA*00* *00* *ZZ*CMSFFM *ZZ*987654321 *230614*1605*^*00501*000001001*1*T*:~ +GS*BE*XX0*12345XX0010003*20231614*1607*2001*X*005010X220A1~ +ST*834*70023*005010X220A1~ +BGN*00*70023*20211212*152025*ET***2~ +QTY*TO*4~ +QTY*DT*3~ +N1*P5*JANE SMITH*FI*234567890~ +N1*IN*ISSUER BUSINESS NAME*FI*987654321~ +N1*BO*BROKER NAME*94*88888888~ +INS*Y*18*021*EC*A***AC~ +REF*0F*980111001~ +REF*17*980111001~ +REF*6O*XX00020613519~ +DTP*356*D8*20220101~ +NM1*IL*1*SMITH*JANE****34*234567890~ +PER*IP**TE*8885551212*AP*8885551212~ +N3*1234 MY STREET~ +N4*YOURTOWN*XX*555553510**CY*11111~ +DMG*D8*19910412*F*M~ +HLH*N~ +LUI*LD*SPA**6~ +NM1*31*1~ +N3*45678 MY MAIL STREET~ +N4*MY MAIL CITY*XX*55556~ +HD*021**HLT~ +DTP*348*D8*20220101~ +REF*1L*21479225~ +REF*CE*12345XX001000301~ +LS*2700~ +LX*1~ +N1*75*REQUEST SUBMIT TIMESTAMP~ +REF*17*20211212114142~ +LX*2~ +N1*75*APTC AMT~ +REF*9V*150.00~ +DTP*007*D8*20220101~ +LX*3~ +N1*75*PRE AMT 1~ +REF*9X*164.23~ +DTP*007*D8*20220101~ +LX*4~ +N1*75*PRE AMT TOT~ +REF*9X*528.46~ +DTP*007*D8*20220101~ +LX*5~ +N1*75*TOT RES AMT~ +REF*9V*378.46~ +DTP*007*D8*20220101~ +LX*6~ +N1*75*RATING AREA~ +REF*9X*R-XX001~ +DTP*007*D8*20220101~ +LX*7~ +N1*75*SOURCE EXCHANGE ID~ +REF*17*XX0~ +DTP*007*D8*20220101~ +LX*8~ +N1*75*APPLICATION ID AND ORIGIN~ +REF*6M*1734584752-11~ +DTP*007*D8*20211212~ +LE*2700~ +INS*N*01*021*EC*A~ +REF*0F*980111001~ +REF*17*980111002~ +REF*6O*XX00020613519~ +DTP*356*D8*20220101~ +NM1*IL*1*SMITH*JOHN****34*533229865~ +PER*IP**TE*8885551212*AP*8885551212~ +N3*1234 MY STREET~ +N4*YOURTOWN*XX*555553510**CY*11111~ +DMG*D8*19910512*M*M*:RET:2135-2^:RET:2106-3~ +HLH*N~ +LUI*LD*SPA**6~ +HD*021**HLT~ +DTP*348*D8*20220101~ +REF*1L*21479225~ +REF*CE*12345XX001000301~ +LS*2700~ +LX*1~ +N1*75*REQUEST SUBMIT TIMESTAMP~ +REF*17*20211212114142~ +LX*2~ +N1*75*PRE AMT 1~ +REF*9X*164.23~ +DTP*007*D8*20220101~ +LX*3~ +N1*75*SOURCE EXCHANGE ID~ +REF*17*XX0~ +DTP*007*D8*20220101~ +LX*4~ +N1*75*APPLICATION ID AND ORIGIN~ +REF*6M*1734584752-11~ +DTP*007*D8*20211212~ +LE*2700~ +INS*N*19*021*EC*A~ +REF*0F*980111001~ +REF*17*980111003~ +REF*6O*XX00020613519~ +DTP*356*D8*20220101~ +NM1*IL*1*SMITH*MARY****34*543890233~ +PER*IP**TE*8885551212*AP*8885551212~ +N3*1234 MY STREET~ +N4*YOURTOWN*XX*555553510**CY*11111~ +DMG*D8*20100522*F~ +HLH*N~ +LUI*LD*SPA**6~ +HD*021**HLT~ +DTP*348*D8*20220101~ +REF*1L*21479225~ +REF*CE*12345XX001000301~ +LS*2700~ +LX*1~ +N1*75*REQUEST SUBMIT TIMESTAMP~ +REF*17*20211212114142~ +LX*2~ +N1*75*PRE AMT 1~ +REF*9X*100.00~ +DTP*007*D8*20220101~ +LX*3~ +N1*75*SOURCE EXCHANGE ID~ +REF*17*XX0~ +DTP*007*D8*20220101~ +LX*4~ +N1*75*APPLICATION ID AND ORIGIN~ +REF*6M*1734584752-11~ +DTP*007*D8*20211212~ +LE*2700~ +INS*N*19*021*EC*A~ +REF*0F*980111001~ +REF*17*980111004~ +REF*6O*XX00020613519~ +DTP*356*D8*20220101~ +NM1*IL*1*SMITH*TIMMY****34*822451288~ +PER*IP**TE*8885551212*AP*8885551212~ +N3*1234 MY STREET~ +N4*YOURTOWN*XX*555553510**CY*11111~ +DMG*D8*20100522*M~ +HLH*N~ +LUI*LD*SPA**6~ +HD*021**HLT~ +DTP*348*D8*20220101~ +REF*1L*21479225~ +REF*CE*12345XX001000301~ +LS*2700~ +LX*1~ +N1*75*REQUEST SUBMIT TIMESTAMP~ +REF*17*20211212114142~ +LX*2~ +N1*75*PRE AMT 1~ +REF*9X*100.00~ +DTP*007*D8*20220101~ +LX*3~ +N1*75*SOURCE EXCHANGE ID~ +REF*17*XX0~ +DTP*007*D8*20220101~ +LX*4~ +N1*75*APPLICATION ID AND ORIGIN~ +REF*6M*1734584752-11~ +DTP*007*D8*20211212~ +LE*2700~ +SE*159*70023~ +GE*1*2001~ +IEA*1*000001001~ diff --git a/extensions/omniv21/samples/edi/3_x12_834.schema.json b/extensions/omniv21/samples/edi/3_x12_834.schema.json new file mode 100644 index 0000000..d0c89af --- /dev/null +++ b/extensions/omniv21/samples/edi/3_x12_834.schema.json @@ -0,0 +1,5804 @@ +{ + "parser_settings": { + "version": "omni.2.1", + "file_format_type": "edi" + }, + "file_declaration": { + "element_delimiter": "*", + "segment_delimiter": "~", + "component_delimiter": ":", + "repetition_delimiter": "^", + "ignore_crlf": true, + "segment_declarations": [ + { + "name": "ISA", + "elements": [ + { + "name": "ISA01", + "index": 1 + }, + { + "name": "ISA02", + "index": 2 + }, + { + "name": "ISA03", + "index": 3 + }, + { + "name": "ISA04", + "index": 4 + }, + { + "name": "ISA05", + "index": 5 + }, + { + "name": "ISA06", + "index": 6 + }, + { + "name": "ISA07", + "index": 7 + }, + { + "name": "ISA08", + "index": 8 + }, + { + "name": "ISA09", + "index": 9 + }, + { + "name": "ISA10", + "index": 10 + }, + { + "name": "ISA11", + "index": 11 + }, + { + "name": "ISA12", + "index": 12 + }, + { + "name": "ISA13", + "index": 13 + }, + { + "name": "ISA14", + "index": 14 + }, + { + "name": "ISA15", + "index": 15 + }, + { + "name": "ISA16", + "index": 16 + } + ], + "child_segments": [ + { + "name": "functional_groups", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "name": "GS", + "elements": [ + { + "name": "GS01", + "index": 1 + }, + { + "name": "GS02", + "index": 2 + }, + { + "name": "GS03", + "index": 3 + }, + { + "name": "GS04", + "index": 4 + }, + { + "name": "GS05", + "index": 5 + }, + { + "name": "GS06", + "index": 6 + }, + { + "name": "GS07", + "index": 7 + }, + { + "name": "GS08", + "index": 8 + } + ], + "child_segments": [ + { + "name": "transactions", + "type": "segment_group", + "is_target": true, + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Transaction Set Header", + "name": "ST", + "elements": [ + { + "_comment": "Transaction Set Identifier Number", + "name": "ST01", + "index": 1, + "default": "" + }, + { + "_comment": "Transaction Set Control Number", + "name": "ST02", + "index": 2, + "default": "" + }, + { + "_comment": "Implementation Convention Reference", + "name": "ST03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Beginning Segment", + "name": "BGN", + "elements": [ + { + "_comment": "Transaction Set Purpose Code", + "name": "BGN01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "BGN02", + "index": 2, + "default": "" + }, + { + "_comment": "Date", + "name": "BGN03", + "index": 3, + "default": "" + }, + { + "_comment": "Time", + "name": "BGN04", + "index": 4, + "default": "" + }, + { + "_comment": "Time Code", + "name": "BGN05", + "index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "BGN06", + "index": 6, + "default": "" + }, + { + "_comment": "Transaction Type Code", + "name": "BGN07", + "index": 7, + "default": "" + }, + { + "_comment": "Action Code", + "name": "BGN08", + "index": 8, + "default": "" + }, + { + "_comment": "Security Level Code", + "name": "BGN09", + "index": 9, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Quantity Information", + "name": "QTY", + "min": 0, + "max": 3, + "elements": [ + { + "_comment": "Quantity Qualifier", + "name": "QTY01", + "index": 1, + "default": "" + }, + { + "_comment": "Quantity", + "name": "QTY02", + "index": 2, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_10", + "index": 3, + "component_index": 10, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_11", + "index": 3, + "component_index": 11, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_12", + "index": 3, + "component_index": 12, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_13", + "index": 3, + "component_index": 13, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_14", + "index": 3, + "component_index": 14, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_15", + "index": 3, + "component_index": 15, + "default": "" + }, + { + "_comment": "Free-form Information", + "name": "QTY04", + "index": 4, + "default": "" + } + ] + }, + { + "_comment": "loop 1000 PARTY IDENTIFICATION", + "name": "LOOP1000", + "type": "segment_group", + "max": -1, + "child_segments": [ + { + "_comment": "Party Identification", + "name": "N1", + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "N101", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N102", + "index": 2, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "N103", + "index": 3, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "N104", + "index": 4, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "N105", + "index": 5, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "N106", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Additional Name Information", + "name": "N2", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "Name", + "name": "N201", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N202", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Administrative Communications Contact", + "name": "PER", + "min": 0, + "max": 3, + "elements": [ + { + "_comment": "Contract Function Code", + "name": "PER01", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "PER02", + "index": 2, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER03", + "index": 3, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER04", + "index": 4, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER05", + "index": 5, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER06", + "index": 6, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER07", + "index": 7, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER08", + "index": 8, + "default": "" + }, + { + "_comment": "Contract Inquiry Reference", + "name": "PER09", + "index": 9, + "default": "" + } + ] + }, + { + "_comment": "loop 1100 ACCOUNT IDENTIFICATION", + "name": "LOOP1100", + "type": "segment_group", + "min": 0, + "max": 10, + "child_segments": [ + { + "_comment": "Account Identification", + "name": "ACT", + "min": 0, + "elements": [ + { + "_comment": "Account Number", + "name": "ACT01", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "ACT02", + "index": 2, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "ACT03", + "index": 3, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "ACT04", + "index": 4, + "default": "" + }, + { + "_comment": "Account Number Qualifier", + "name": "ACT05", + "index": 5, + "default": "" + }, + { + "_comment": "Account Number", + "name": "ACT06", + "index": 6, + "default": "" + }, + { + "_comment": "Description", + "name": "ACT07", + "index": 7, + "default": "" + }, + { + "_comment": "Payment Method Type Code", + "name": "ACT08", + "index": 8, + "default": "" + }, + { + "_comment": "Benefit Status Code", + "name": "ACT09", + "index": 9, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": 5, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Administrative Communications Contact", + "name": "PER", + "min": 0, + "max": 5, + "elements": [ + { + "_comment": "Contract Function Code", + "name": "PER01", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "PER02", + "index": 2, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER03", + "index": 3, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER04", + "index": 4, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER05", + "index": 5, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER06", + "index": 6, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER07", + "index": 7, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER08", + "index": 8, + "default": "" + }, + { + "_comment": "Contract Inquiry Reference", + "name": "PER09", + "index": 9, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "loop 2000 INSURED BENEFIT", + "name": "LOOP2000", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Insured Benefit", + "name": "INS", + "min": 0, + "elements": [ + { + "_comment": "Yes/No Condition or Response Code", + "name": "INS01", + "index": 1, + "default": "" + }, + { + "_comment": "Individual Relationship Code", + "name": "INS02", + "index": 2, + "default": "" + }, + { + "_comment": "Maintenance Type Code", + "name": "INS03", + "index": 3, + "default": "" + }, + { + "_comment": "Maintenance Reason Code", + "name": "INS04", + "index": 4, + "default": "" + }, + { + "_comment": "Benefit Status Code", + "name": "INS05", + "index": 5, + "default": "" + }, + { + "_comment": "Benefit Status Code", + "name": "INS06_01", + "index": 6, + "component_index": 1, + "default": "" + }, + { + "_comment": "Eligibility Reason Code", + "name": "INS06_02", + "index": 6, + "component_index": 2, + "default": "" + }, + { + "_comment": "Eligibility Reason Code", + "name": "INS06_03", + "index": 6, + "component_index": 3, + "default": "" + }, + { + "_comment": "Eligibility Reason Code", + "name": "INS06_04", + "index": 6, + "component_index": 4, + "default": "" + }, + { + "_comment": "Consolidated Omnibus Budget Reconciliation Act (COBRA) Qualifying", + "name": "INS07", + "index": 7, + "default": "" + }, + { + "_comment": "Employment Status Code", + "name": "INS08", + "index": 8, + "default": "" + }, + { + "_comment": "Student Status Code", + "name": "INS09", + "index": 9, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "INS10", + "index": 10, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "INS11", + "index": 11, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "INS12", + "index": 12, + "default": "" + }, + { + "_comment": "Confidentiality Code", + "name": "INS13", + "index": 13, + "default": "" + }, + { + "_comment": "City Name", + "name": "INS14", + "index": 14, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "INS15", + "index": 15, + "default": "" + }, + { + "_comment": "Country Code", + "name": "INS16", + "index": 16, + "default": "" + }, + { + "_comment": "Number", + "name": "INS17", + "index": 17, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "max": -1, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "loop 2100 INDIVIDUAL OR ORGANIZATION NAME", + "name": "LOOP2100", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Individual or Organizational Name", + "name": "NM1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "NM101", + "index": 1, + "default": "" + }, + { + "_comment": "Entity Type Qualifier", + "name": "NM102", + "index": 2, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM103", + "index": 3, + "default": "" + }, + { + "_comment": "Name First", + "name": "NM104", + "index": 4, + "default": "" + }, + { + "_comment": "Name Middle", + "name": "NM105", + "index": 5, + "default": "" + }, + { + "_comment": "Name Prefix", + "name": "NM106", + "index": 6, + "default": "" + }, + { + "_comment": "Name Suffix", + "name": "NM107", + "index": 7, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "NM108", + "index": 8, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "NM109", + "index": 9, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "NM110", + "index": 10, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "NM111", + "index": 11, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM112", + "index": 12, + "default": "" + } + ] + }, + { + "_comment": "Administrative Communications Contact", + "name": "PER", + "min": 0, + "elements": [ + { + "_comment": "Contract Function Code", + "name": "PER01", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "PER02", + "index": 2, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER03", + "index": 3, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER04", + "index": 4, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER05", + "index": 5, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER06", + "index": 6, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER07", + "index": 7, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER08", + "index": 8, + "default": "" + }, + { + "_comment": "Contract Inquiry Reference", + "name": "PER09", + "index": 9, + "default": "" + } + ] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Demographic Information", + "name": "DMG", + "min": 0, + "elements": [ + { + "_comment": "Date Time Period Format Qualifier", + "name": "DMG01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DMG02", + "index": 2, + "default": "" + }, + { + "_comment": "Gender Code", + "name": "DMG03", + "index": 3, + "default": "" + }, + { + "_comment": "Marital Status Code", + "name": "DMG04", + "index": 4, + "default": "" + }, + { + "_comment": "Race or Ethnicity Code", + "name": "DMG05_01", + "index": 5, + "component_index": 1, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "DMG05_02", + "index": 5, + "component_index": 2, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "DMG05_03", + "index": 5, + "component_index": 3, + "default": "" + }, + { + "_comment": "Citizenship Status Code", + "name": "DMG06", + "index": 6, + "default": "" + }, + { + "_comment": "Country Code", + "name": "DMG07", + "index": 7, + "default": "" + }, + { + "_comment": "Basis of Verification Code", + "name": "DMG08", + "index": 8, + "default": "" + }, + { + "_comment": "Quantity", + "name": "DMG09", + "index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "DMG10", + "index": 10, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "DMG11", + "index": 11, + "default": "" + } + ] + }, + { + "_comment": "Electronic Funds Transfer Information", + "name": "PM", + "min": 0, + "elements": [] + }, + { + "_comment": "Employment Class", + "name": "EC", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Employment Class Code", + "name": "EC01", + "index": 1, + "default": "" + }, + { + "_comment": "Employment Class Code", + "name": "EC02", + "index": 2, + "default": "" + }, + { + "_comment": "Employment Class Code", + "name": "EC03", + "index": 3, + "default": "" + }, + { + "_comment": "Percentage as Decimal", + "name": "EC04", + "index": 4, + "default": "" + }, + { + "_comment": "Information Status Code", + "name": "EC05", + "index": 5, + "default": "" + }, + { + "_comment": "Occupation Code", + "name": "EC06", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Individual Income", + "name": "ICM", + "min": 0, + "elements": [ + { + "_comment": "Frequency Code", + "name": "ICM01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "ICM02", + "index": 2, + "default": "" + }, + { + "_comment": "Quantity", + "name": "ICM03", + "index": 3, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "ICM04", + "index": 4, + "default": "" + }, + { + "_comment": "Salary Grade", + "name": "ICM05", + "index": 5, + "default": "" + }, + { + "_comment": "Currency Code", + "name": "ICM06", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "max": 10, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Health Information", + "name": "HLH", + "min": 0, + "elements": [ + { + "_comment": "Health-Related Code", + "name": "HLH01", + "index": 1, + "default": "" + }, + { + "_comment": "Height", + "name": "HLH02", + "index": 2, + "default": "" + }, + { + "_comment": "Weight", + "name": "HLH03", + "index": 3, + "default": "" + }, + { + "_comment": "Weight", + "name": "HLH04", + "index": 4, + "default": "" + }, + { + "_comment": "Description", + "name": "HLH05", + "index": 5, + "default": "" + }, + { + "_comment": "Current Health Condition Code", + "name": "HLH06", + "index": 6, + "default": "" + }, + { + "_comment": "Description", + "name": "HLH07", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Health Care Information Codes", + "name": "HI", + "min": 0, + "max": 10, + "elements": [ + { + "_comment": "Code List Qualifier Code", + "name": "HI01_01", + "index": 1, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI01_02", + "index": 1, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI01_03", + "index": 1, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI01_04", + "index": 1, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI01_05", + "index": 1, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI01_06", + "index": 1, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI01_07", + "index": 1, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI01_08", + "index": 1, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI01_09", + "index": 1, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI02_01", + "index": 2, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI02_02", + "index": 2, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI02_03", + "index": 2, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI02_04", + "index": 2, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI02_05", + "index": 2, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI02_06", + "index": 2, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI02_07", + "index": 2, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI02_08", + "index": 2, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI02_09", + "index": 2, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI03_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI03_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI03_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI03_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI03_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI03_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI03_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI03_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI03_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI04_06", + "index": 4, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI04_07", + "index": 4, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI04_08", + "index": 4, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI04_09", + "index": 4, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI05_01", + "index": 5, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI05_02", + "index": 5, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI05_03", + "index": 5, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI05_04", + "index": 5, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI05_05", + "index": 5, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI05_06", + "index": 5, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI05_07", + "index": 5, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI05_08", + "index": 5, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI05_09", + "index": 5, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI06_01", + "index": 6, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI06_02", + "index": 6, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI06_03", + "index": 6, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI06_04", + "index": 6, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI06_05", + "index": 6, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI06_06", + "index": 6, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI06_07", + "index": 6, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI06_08", + "index": 6, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI06_09", + "index": 6, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI07_01", + "index": 7, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI07_02", + "index": 7, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI07_03", + "index": 7, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI07_04", + "index": 7, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI07_05", + "index": 7, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI07_06", + "index": 7, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI07_07", + "index": 7, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI07_08", + "index": 7, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI07_09", + "index": 7, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI08_01", + "index": 8, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI08_02", + "index": 8, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI08_03", + "index": 8, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI08_04", + "index": 8, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI08_05", + "index": 8, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI08_06", + "index": 8, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI08_07", + "index": 8, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI08_08", + "index": 8, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI08_09", + "index": 8, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI09_01", + "index": 9, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI09_02", + "index": 9, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI09_03", + "index": 9, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI09_04", + "index": 9, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI09_05", + "index": 9, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI09_06", + "index": 9, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI09_07", + "index": 9, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI09_08", + "index": 9, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI09_09", + "index": 9, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI10_01", + "index": 10, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI10_02", + "index": 10, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI10_03", + "index": 10, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI10_04", + "index": 10, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI10_05", + "index": 10, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI10_06", + "index": 10, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI10_07", + "index": 10, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI10_08", + "index": 10, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI10_09", + "index": 10, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI11_01", + "index": 11, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI11_02", + "index": 11, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI11_03", + "index": 11, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI11_04", + "index": 11, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI11_05", + "index": 11, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI11_06", + "index": 11, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI11_07", + "index": 11, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI11_08", + "index": 11, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI11_09", + "index": 11, + "component_index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "HI12_01", + "index": 12, + "component_index": 1, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI12_02", + "index": 12, + "component_index": 2, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "HI12_03", + "index": 12, + "component_index": 3, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "HI12_04", + "index": 12, + "component_index": 4, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "HI12_05", + "index": 12, + "component_index": 5, + "default": "" + }, + { + "_comment": "Quantity", + "name": "HI12_06", + "index": 12, + "component_index": 6, + "default": "" + }, + { + "_comment": "Version Identifier", + "name": "HI12_07", + "index": 12, + "component_index": 7, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "HI12_08", + "index": 12, + "component_index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HI12_09", + "index": 12, + "component_index": 9, + "default": "" + } + ] + }, + { + "_comment": "Language Use", + "name": "LUI", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Identification Code Qualifier", + "name": "LUI01", + "index": 1, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "LUI02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "LUI03", + "index": 3, + "default": "" + }, + { + "_comment": "Use of Language Indicator", + "name": "LUI04", + "index": 4, + "default": "" + }, + { + "_comment": "Language Proficiency Indicator", + "name": "LUI05", + "index": 5, + "default": "" + } + ] + } + ] + }, + { + "_comment": "loop 2200 DISABILITY INFORMATION", + "name": "LOOP2200", + "type": "segment_group", + "min": 0, + "max": 4, + "child_segments": [ + { + "_comment": "Disability Information", + "name": "DSB", + "min": 0, + "elements": [ + { + "_comment": "Disability Type Code", + "name": "DSB01", + "index": 1, + "default": "" + }, + { + "_comment": "Quantity", + "name": "DSB02", + "index": 2, + "default": "" + }, + { + "_comment": "Occupation Code", + "name": "DSB03", + "index": 3, + "default": "" + }, + { + "_comment": "Work Intensity Code", + "name": "DSB04", + "index": 4, + "default": "" + }, + { + "_comment": "Product Option Code", + "name": "DSB05", + "index": 5, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "DSB06", + "index": 6, + "default": "" + }, + { + "_comment": "Product/Service ID Qualifier", + "name": "DSB07", + "index": 7, + "default": "" + }, + { + "_comment": "Medical Code Value", + "name": "DSB08", + "index": 8, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": 10, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Adjustment Amount", + "name": "AD1", + "min": 0, + "max": 10, + "elements": [] + } + ] + }, + { + "_comment": "loop 2300 HEALTH COVERAGE", + "name": "LOOP2300", + "type": "segment_group", + "min": 0, + "max": 99, + "child_segments": [ + { + "_comment": "Health Coverage", + "name": "HD", + "min": 0, + "elements": [ + { + "_comment": "Maintenance Type Code", + "name": "HD01", + "index": 1, + "default": "" + }, + { + "_comment": "Maintenance Reason Code", + "name": "HD02", + "index": 2, + "default": "" + }, + { + "_comment": "Insurance Line Code", + "name": "HD03", + "index": 3, + "default": "" + }, + { + "_comment": "Plan Coverage Description", + "name": "HD04", + "index": 4, + "default": "" + }, + { + "_comment": "Coverage Level Code", + "name": "HD05", + "index": 5, + "default": "" + }, + { + "_comment": "Count", + "name": "HD06", + "index": 6, + "default": "" + }, + { + "_comment": "Count", + "name": "HD07", + "index": 7, + "default": "" + }, + { + "_comment": "Underwriting Decision Code", + "name": "HD08", + "index": 8, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HD09", + "index": 9, + "default": "" + }, + { + "_comment": "Drug House Code", + "name": "HD10", + "index": 10, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "HD11", + "index": 11, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": 10, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "max": 3, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": 5, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Identification Card", + "name": "IDC", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Plan Coverage Description", + "name": "IDC01", + "index": 1, + "default": "" + }, + { + "_comment": "Identification Card Type Code", + "name": "IDC02", + "index": 2, + "default": "" + }, + { + "_comment": "Quantity", + "name": "IDC03", + "index": 3, + "default": "" + }, + { + "_comment": "Action Code", + "name": "IDC04", + "index": 4, + "default": "" + } + ] + }, + { + "_comment": "loop 2310 TRANSACTION SET LINE NUMBER", + "name": "LOOP2310", + "type": "segment_group", + "min": 0, + "max": 30, + "child_segments": [ + { + "_comment": "Transaction Set Line Number", + "name": "LX", + "min": 0, + "elements": [ + { + "_comment": "Assigned Number", + "name": "LX01", + "index": 1, + "default": "" + } + ] + }, + { + "_comment": "Individual or Organizational Name", + "name": "NM1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "NM101", + "index": 1, + "default": "" + }, + { + "_comment": "Entity Type Qualifier", + "name": "NM102", + "index": 2, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM103", + "index": 3, + "default": "" + }, + { + "_comment": "Name First", + "name": "NM104", + "index": 4, + "default": "" + }, + { + "_comment": "Name Middle", + "name": "NM105", + "index": 5, + "default": "" + }, + { + "_comment": "Name Prefix", + "name": "NM106", + "index": 6, + "default": "" + }, + { + "_comment": "Name Suffix", + "name": "NM107", + "index": 7, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "NM108", + "index": 8, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "NM109", + "index": 9, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "NM110", + "index": 10, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "NM111", + "index": 11, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM112", + "index": 12, + "default": "" + } + ] + }, + { + "_comment": "Party Identification", + "name": "N1", + "min": 0, + "max": 3, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "N101", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N102", + "index": 2, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "N103", + "index": 3, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "N104", + "index": 4, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "N105", + "index": 5, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "N106", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Additional Name Information", + "name": "N2", + "min": 0, + "elements": [ + { + "_comment": "Name", + "name": "N201", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N202", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Administrative Communications Contact", + "name": "PER", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "Contract Function Code", + "name": "PER01", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "PER02", + "index": 2, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER03", + "index": 3, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER04", + "index": 4, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER05", + "index": 5, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER06", + "index": 6, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER07", + "index": 7, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER08", + "index": 8, + "default": "" + }, + { + "_comment": "Contract Inquiry Reference", + "name": "PER09", + "index": 9, + "default": "" + } + ] + }, + { + "_comment": "Provider Information", + "name": "PRV", + "min": 0, + "elements": [ + { + "_comment": "Provider Code", + "name": "PRV01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "PRV02", + "index": 2, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "PRV03", + "index": 3, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "PRV04", + "index": 4, + "default": "" + }, + { + "_comment": "Provider Specialty Code", + "name": "PRV05_01", + "index": 5, + "component_index": 1, + "default": "" + }, + { + "_comment": "Agency Qualifier Code", + "name": "PRV05_02", + "index": 5, + "component_index": 2, + "default": "" + }, + { + "_comment": "Yes/No Condition or Response Code", + "name": "PRV05_03", + "index": 5, + "component_index": 3, + "default": "" + }, + { + "_comment": "Provider Organization Code", + "name": "PRV06", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": 6, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Place or Location", + "name": "PLA", + "min": 0, + "elements": [ + { + "_comment": "Action Code", + "name": "PLA01", + "index": 1, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "PLA02", + "index": 2, + "default": "" + }, + { + "_comment": "Date", + "name": "PLA03", + "index": 3, + "default": "" + }, + { + "_comment": "Time", + "name": "PLA04", + "index": 4, + "default": "" + }, + { + "_comment": "Maintenance Reason Code", + "name": "PLA05", + "index": 5, + "default": "" + } + ] + } + ] + }, + { + "_comment": "loop 2320 COORDINATION OF BENEFITS", + "name": "LOOP2320", + "type": "segment_group", + "min": 0, + "max": 5, + "child_segments": [ + { + "_comment": "Coordination of Benefits", + "name": "COB", + "min": 0, + "elements": [ + { + "_comment": "Payer Responsibility Sequence", + "name": "COB01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "COB02", + "index": 2, + "default": "" + }, + { + "_comment": "Coordination of Benefits Code", + "name": "COB03", + "index": 3, + "default": "" + }, + { + "_comment": "Service Type Code", + "name": "COB04", + "index": 4, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "loop 2330 INDIVIDUAL OR ORGANIZATION NAME", + "name": "LOOP2330", + "type": "segment_group", + "min": 0, + "max": 3, + "child_segments": [ + { + "_comment": "Individual or Organizational Name", + "name": "NM1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "NM101", + "index": 1, + "default": "" + }, + { + "_comment": "Entity Type Qualifier", + "name": "NM102", + "index": 2, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM103", + "index": 3, + "default": "" + }, + { + "_comment": "Name First", + "name": "NM104", + "index": 4, + "default": "" + }, + { + "_comment": "Name Middle", + "name": "NM105", + "index": 5, + "default": "" + }, + { + "_comment": "Name Prefix", + "name": "NM106", + "index": 6, + "default": "" + }, + { + "_comment": "Name Suffix", + "name": "NM107", + "index": 7, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "NM108", + "index": 8, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "NM109", + "index": 9, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "NM110", + "index": 10, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "NM111", + "index": 11, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM112", + "index": 12, + "default": "" + } + ] + }, + { + "_comment": "Additional Name Information", + "name": "N2", + "min": 0, + "elements": [ + { + "_comment": "Name", + "name": "N201", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N202", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "max": 2, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Administrative Communications Contact", + "name": "PER", + "min": 0, + "elements": [ + { + "_comment": "Contract Function Code", + "name": "PER01", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "PER02", + "index": 2, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER03", + "index": 3, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER04", + "index": 4, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER05", + "index": 5, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER06", + "index": 6, + "default": "" + }, + { + "_comment": "Communication Number Qualifier", + "name": "PER07", + "index": 7, + "default": "" + }, + { + "_comment": "Communication Number", + "name": "PER08", + "index": 8, + "default": "" + }, + { + "_comment": "Contract Inquiry Reference", + "name": "PER09", + "index": 9, + "default": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "_comment": "loop 2400 LIFE COVERAGE", + "name": "LOOP2400", + "type": "segment_group", + "min": 0, + "max": 10, + "child_segments": [ + { + "_comment": "Life Coverage", + "name": "LC", + "min": 0, + "elements": [] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "loop 2410 BENEFICIARY OR OWNER INFORMATION", + "name": "LOOP2410", + "type": "segment_group", + "min": 0, + "max": 20, + "child_segments": [ + { + "_comment": "Beneficiary or Owner Information", + "name": "BEN", + "min": 0, + "elements": [] + }, + { + "_comment": "Individual or Organizational Name", + "name": "NM1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "NM101", + "index": 1, + "default": "" + }, + { + "_comment": "Entity Type Qualifier", + "name": "NM102", + "index": 2, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM103", + "index": 3, + "default": "" + }, + { + "_comment": "Name First", + "name": "NM104", + "index": 4, + "default": "" + }, + { + "_comment": "Name Middle", + "name": "NM105", + "index": 5, + "default": "" + }, + { + "_comment": "Name Prefix", + "name": "NM106", + "index": 6, + "default": "" + }, + { + "_comment": "Name Suffix", + "name": "NM107", + "index": 7, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "NM108", + "index": 8, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "NM109", + "index": 9, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "NM110", + "index": 10, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "NM111", + "index": 11, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM112", + "index": 12, + "default": "" + } + ] + }, + { + "_comment": "Party Identification", + "name": "N1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "N101", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N102", + "index": 2, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "N103", + "index": 3, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "N104", + "index": 4, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "N105", + "index": 5, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "N106", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Additional Name Information", + "name": "N2", + "min": 0, + "elements": [ + { + "_comment": "Name", + "name": "N201", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N202", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Demographic Information", + "name": "DMG", + "min": 0, + "elements": [ + { + "_comment": "Date Time Period Format Qualifier", + "name": "DMG01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DMG02", + "index": 2, + "default": "" + }, + { + "_comment": "Gender Code", + "name": "DMG03", + "index": 3, + "default": "" + }, + { + "_comment": "Marital Status Code", + "name": "DMG04", + "index": 4, + "default": "" + }, + { + "_comment": "Race or Ethnicity Code", + "name": "DMG05_01", + "index": 5, + "component_index": 1, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "DMG05_02", + "index": 5, + "component_index": 2, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "DMG05_03", + "index": 5, + "component_index": 3, + "default": "" + }, + { + "_comment": "Citizenship Status Code", + "name": "DMG06", + "index": 6, + "default": "" + }, + { + "_comment": "Country Code", + "name": "DMG07", + "index": 7, + "default": "" + }, + { + "_comment": "Basis of Verification Code", + "name": "DMG08", + "index": 8, + "default": "" + }, + { + "_comment": "Quantity", + "name": "DMG09", + "index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "DMG10", + "index": 10, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "DMG11", + "index": 11, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "loop 2500 TAX ADVANTAGE ACCOUNT", + "name": "LOOP2500", + "type": "segment_group", + "min": 0, + "max": 5, + "child_segments": [ + { + "_comment": "Flexible Spending Account", + "name": "FSA", + "min": 0, + "elements": [] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "max": 10, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": 10, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + } + ] + }, + { + "_comment": "loop 2600 RETIREMENT PRODUCT", + "name": "LOOP2600", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Retirement Product", + "name": "RP", + "min": 0, + "elements": [] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Investment Vehicle", + "name": "INV", + "min": 0, + "max": -1, + "elements": [] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "max": 20, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Quantity Information", + "name": "QTY", + "min": 0, + "max": 20, + "elements": [ + { + "_comment": "Quantity Qualifier", + "name": "QTY01", + "index": 1, + "default": "" + }, + { + "_comment": "Quantity", + "name": "QTY02", + "index": 2, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_10", + "index": 3, + "component_index": 10, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_11", + "index": 3, + "component_index": 11, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_12", + "index": 3, + "component_index": 12, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_13", + "index": 3, + "component_index": 13, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_14", + "index": 3, + "component_index": 14, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_15", + "index": 3, + "component_index": 15, + "default": "" + }, + { + "_comment": "Free-form Information", + "name": "QTY04", + "index": 4, + "default": "" + } + ] + }, + { + "_comment": "File Information", + "name": "K3", + "min": 0, + "max": 3, + "elements": [ + { + "_comment": "Fixed Format Information", + "name": "K301", + "index": 1, + "default": "" + }, + { + "_comment": "Record Format Code", + "name": "K302", + "index": 2, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_10", + "index": 3, + "component_index": 10, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_11", + "index": 3, + "component_index": 11, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_12", + "index": 3, + "component_index": 12, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_13", + "index": 3, + "component_index": 13, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_14", + "index": 3, + "component_index": 14, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_15", + "index": 3, + "component_index": 15, + "default": "" + } + ] + }, + { + "_comment": "Relationship", + "name": "REL", + "min": 0, + "elements": [] + }, + { + "_comment": "loop 2610 INDIVIDUAL OR ORGANIZATIONAL NAME", + "name": "LOOP2610", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Individual or Organizational Name", + "name": "NM1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "NM101", + "index": 1, + "default": "" + }, + { + "_comment": "Entity Type Qualifier", + "name": "NM102", + "index": 2, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM103", + "index": 3, + "default": "" + }, + { + "_comment": "Name First", + "name": "NM104", + "index": 4, + "default": "" + }, + { + "_comment": "Name Middle", + "name": "NM105", + "index": 5, + "default": "" + }, + { + "_comment": "Name Prefix", + "name": "NM106", + "index": 6, + "default": "" + }, + { + "_comment": "Name Suffix", + "name": "NM107", + "index": 7, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "NM108", + "index": 8, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "NM109", + "index": 9, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "NM110", + "index": 10, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "NM111", + "index": 11, + "default": "" + }, + { + "_comment": "Name Last or Organization Name", + "name": "NM112", + "index": 12, + "default": "" + } + ] + }, + { + "_comment": "Additional Name Information", + "name": "N2", + "min": 0, + "elements": [ + { + "_comment": "Name", + "name": "N201", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N202", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Demographic Information", + "name": "DMG", + "min": 0, + "elements": [ + { + "_comment": "Date Time Period Format Qualifier", + "name": "DMG01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DMG02", + "index": 2, + "default": "" + }, + { + "_comment": "Gender Code", + "name": "DMG03", + "index": 3, + "default": "" + }, + { + "_comment": "Marital Status Code", + "name": "DMG04", + "index": 4, + "default": "" + }, + { + "_comment": "Race or Ethnicity Code", + "name": "DMG05_01", + "index": 5, + "component_index": 1, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "DMG05_02", + "index": 5, + "component_index": 2, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "DMG05_03", + "index": 5, + "component_index": 3, + "default": "" + }, + { + "_comment": "Citizenship Status Code", + "name": "DMG06", + "index": 6, + "default": "" + }, + { + "_comment": "Country Code", + "name": "DMG07", + "index": 7, + "default": "" + }, + { + "_comment": "Basis of Verification Code", + "name": "DMG08", + "index": 8, + "default": "" + }, + { + "_comment": "Quantity", + "name": "DMG09", + "index": 9, + "default": "" + }, + { + "_comment": "Code List Qualifier Code", + "name": "DMG10", + "index": 10, + "default": "" + }, + { + "_comment": "Industry Code", + "name": "DMG11", + "index": 11, + "default": "" + } + ] + }, + { + "_comment": "Beneficiary or Owner Information", + "name": "BEN", + "min": 0, + "elements": [] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "loop 2620 PROPERTY OR ENTITIY IDENTIFICATION", + "name": "LOOP2620", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Property or Entity Identification", + "name": "NX1", + "min": 0, + "elements": [] + }, + { + "_comment": "Party Location", + "name": "N3", + "min": 0, + "elements": [ + { + "_comment": "Address Information", + "name": "N301", + "index": 1, + "default": "" + }, + { + "_comment": "Address Information", + "name": "N302", + "index": 2, + "default": "" + } + ] + }, + { + "_comment": "Geographic Location", + "name": "N4", + "min": 0, + "elements": [ + { + "_comment": "City Name", + "name": "N401", + "index": 1, + "default": "" + }, + { + "_comment": "State or Province Code", + "name": "N402", + "index": 2, + "default": "" + }, + { + "_comment": "Postal Code", + "name": "N403", + "index": 3, + "default": "" + }, + { + "_comment": "Country Code", + "name": "N404", + "index": 4, + "default": "" + }, + { + "_comment": "Location Qualifier", + "name": "N405", + "index": 5, + "default": "" + }, + { + "_comment": "Location Identifier", + "name": "N406", + "index": 6, + "default": "" + }, + { + "_comment": "Country Subdivision Code", + "name": "N407", + "index": 7, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "loop 2630 FINANCIAL CONTRIBUTION", + "name": "LOOP2630", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Financial Contribution", + "name": "FC", + "min": 0, + "elements": [] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "loop 2640 INVESTMENT VEHICLE SELECTION", + "name": "LOOP2640", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Investment Vehicle", + "name": "INV", + "min": 0, + "elements": [] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "Quantity Information", + "name": "QTY", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Quantity Qualifier", + "name": "QTY01", + "index": 1, + "default": "" + }, + { + "_comment": "Quantity", + "name": "QTY02", + "index": 2, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_10", + "index": 3, + "component_index": 10, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_11", + "index": 3, + "component_index": 11, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_12", + "index": 3, + "component_index": 12, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_13", + "index": 3, + "component_index": 13, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_14", + "index": 3, + "component_index": 14, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_15", + "index": 3, + "component_index": 15, + "default": "" + }, + { + "_comment": "Free-form Information", + "name": "QTY04", + "index": 4, + "default": "" + } + ] + }, + { + "_comment": "Entity", + "name": "ENT", + "min": 0, + "max": -1, + "elements": [] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Monetary Amount Information", + "name": "AMT", + "min": 0, + "max": 20, + "elements": [ + { + "_comment": "Amount Qualifier Code", + "name": "AMT01", + "index": 1, + "default": "" + }, + { + "_comment": "Monetary Amount", + "name": "AMT02", + "index": 2, + "default": "" + }, + { + "_comment": "Credit/Debit Flag Code", + "name": "AMT03", + "index": 3, + "default": "" + } + ] + }, + { + "_comment": "File Information", + "name": "K3", + "min": 0, + "max": 3, + "elements": [ + { + "_comment": "Fixed Format Information", + "name": "K301", + "index": 1, + "default": "" + }, + { + "_comment": "Record Format Code", + "name": "K302", + "index": 2, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_10", + "index": 3, + "component_index": 10, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_11", + "index": 3, + "component_index": 11, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_12", + "index": 3, + "component_index": 12, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "K303_13", + "index": 3, + "component_index": 13, + "default": "" + }, + { + "_comment": "Exponent", + "name": "K303_14", + "index": 3, + "component_index": 14, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "K303_15", + "index": 3, + "component_index": 15, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "loop 2650 INCOME", + "name": "LOOP2650", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Income", + "name": "AIN", + "min": 0, + "elements": [] + }, + { + "_comment": "Quantity Information", + "name": "QTY", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Quantity Qualifier", + "name": "QTY01", + "index": 1, + "default": "" + }, + { + "_comment": "Quantity", + "name": "QTY02", + "index": 2, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_01", + "index": 3, + "component_index": 1, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_02", + "index": 3, + "component_index": 2, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_03", + "index": 3, + "component_index": 3, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_04", + "index": 3, + "component_index": 4, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_05", + "index": 3, + "component_index": 5, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_06", + "index": 3, + "component_index": 6, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_07", + "index": 3, + "component_index": 7, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_08", + "index": 3, + "component_index": 8, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_09", + "index": 3, + "component_index": 9, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_10", + "index": 3, + "component_index": 10, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_11", + "index": 3, + "component_index": 11, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_12", + "index": 3, + "component_index": 12, + "default": "" + }, + { + "_comment": "Unit or Basis for Measurement Code", + "name": "QTY03_13", + "index": 3, + "component_index": 13, + "default": "" + }, + { + "_comment": "Exponent", + "name": "QTY03_14", + "index": 3, + "component_index": 14, + "default": "" + }, + { + "_comment": "Multiplier", + "name": "QTY03_15", + "index": 3, + "component_index": 15, + "default": "" + }, + { + "_comment": "Free-form Information", + "name": "QTY04", + "index": 4, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "max": -1, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "loop 2700 LS LOOP HEADER", + "name": "LOOP2700", + "type": "segment_group", + "min": 0, + "child_segments": [ + { + "_comment": "Loop Header", + "name": "LS", + "min": 0, + "elements": [ + { + "_comment": "Loop Identifier Code", + "name": "LS01", + "index": 1, + "default": "" + } + ] + }, + { + "_comment": "loop 2700 TRANSACTION SET LINE NUMBER", + "name": "LOOP2700", + "type": "segment_group", + "min": 0, + "max": -1, + "child_segments": [ + { + "_comment": "Transaction Set Line Number", + "name": "LX", + "min": 0, + "elements": [ + { + "_comment": "Assigned Number", + "name": "LX01", + "index": 1, + "default": "" + } + ] + }, + { + "_comment": "loop 2750 PARTY IDENTIFICATION", + "name": "LOOP2750", + "type": "segment_group", + "min": 0, + "child_segments": [ + { + "_comment": "Party Identification", + "name": "N1", + "min": 0, + "elements": [ + { + "_comment": "Entity Identifier Code", + "name": "N101", + "index": 1, + "default": "" + }, + { + "_comment": "Name", + "name": "N102", + "index": 2, + "default": "" + }, + { + "_comment": "Identification Code Qualifier", + "name": "N103", + "index": 3, + "default": "" + }, + { + "_comment": "Identification Code", + "name": "N104", + "index": 4, + "default": "" + }, + { + "_comment": "Entity Relation Code", + "name": "N105", + "index": 5, + "default": "" + }, + { + "_comment": "Entity Identifier Code", + "name": "N106", + "index": 6, + "default": "" + } + ] + }, + { + "_comment": "Reference Information", + "name": "REF", + "min": 0, + "max": 16, + "elements": [ + { + "_comment": "Reference Identification Qualifier", + "name": "REF01", + "index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF02", + "index": 2, + "default": "" + }, + { + "_comment": "Description", + "name": "REF03", + "index": 3, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_01", + "index": 4, + "component_index": 1, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_02", + "index": 4, + "component_index": 2, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_03", + "index": 4, + "component_index": 3, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_04", + "index": 4, + "component_index": 4, + "default": "" + }, + { + "_comment": "Reference Identification Qualifier", + "name": "REF04_05", + "index": 4, + "component_index": 5, + "default": "" + }, + { + "_comment": "Reference Identification", + "name": "REF04_06", + "index": 4, + "component_index": 6, + "default": "" + } + ] + }, + { + "_comment": "Date or Time Period", + "name": "DTP", + "min": 0, + "elements": [ + { + "_comment": "Date/Time Qualifier", + "name": "DTP01", + "index": 1, + "default": "" + }, + { + "_comment": "Date Time Period Format Qualifier", + "name": "DTP02", + "index": 2, + "default": "" + }, + { + "_comment": "Date Time Period", + "name": "DTP03", + "index": 3, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "Loop Trailer", + "name": "LE", + "elements": [ + { + "_comment": "Loop Identifier Code", + "name": "LE01", + "index": 1, + "default": "" + } + ] + } + ] + } + ] + }, + { + "_comment": "Transaction Set Trailer", + "name": "SE", + "elements": [ + { + "_comment": "Number of Included Segments", + "name": "SE01", + "index": 1, + "default": "" + }, + { + "_comment": "Transaction Set Control Number", + "name": "SE02", + "index": 2, + "default": "" + } + ] + } + ] + } + ] + }, + { + "name": "GE" + } + ] + } + ] + }, + { + "name": "IEA" + } + ] + }, + "transform_declarations": { + "FINAL_OUTPUT": { + "object": { + "race_ethnicity_code": { + "array": [ + { + "xpath": "LOOP2000/LOOP2100[NM1[(NM101='74' or NM101='IL') and NM102='1']]/DMG/DMG05_03" + } + ] + } + } + } + } + } diff --git a/extensions/omniv21/samples/edi/edi_test.go b/extensions/omniv21/samples/edi/edi_test.go index 934d48b..0972b8b 100644 --- a/extensions/omniv21/samples/edi/edi_test.go +++ b/extensions/omniv21/samples/edi/edi_test.go @@ -18,14 +18,87 @@ import ( "github.com/jf-tech/omniparser/transformctx" ) +type testCase struct { + schemaFile string + inputFile string + schema omniparser.Schema + input []byte +} + +const ( + test1_CanadaPost_EDI_214 = iota + test2_UPS_EDI_210 + test3_X12_834 +) + +var tests = []testCase{ + { + // test1_CanadaPost_EDI_214 + schemaFile: "./1_canadapost_edi_214.schema.json", + inputFile: "./1_canadapost_edi_214.input.txt", + }, + { + // test2_UPS_EDI_210 + schemaFile: "./2_ups_edi_210.schema.json", + inputFile: "./2_ups_edi_210.input.txt", + }, + { + // test3_X12_834 + schemaFile: "./3_x12_834.schema.json", + inputFile: "./3_x12_834.input.txt", + }, +} + +func init() { + for i := range tests { + schema, err := ioutil.ReadFile(tests[i].schemaFile) + if err != nil { + panic(err) + } + tests[i].schema, err = omniparser.NewSchema("bench", bytes.NewReader(schema)) + if err != nil { + panic(err) + } + tests[i].input, err = ioutil.ReadFile(tests[i].inputFile) + if err != nil { + panic(err) + } + } +} + +func (tst testCase) doTest(t *testing.T) { + cupaloy.SnapshotT(t, jsons.BPJ(samples.SampleTestCommon(t, tst.schemaFile, tst.inputFile))) +} + +func (tst testCase) doBenchmark(b *testing.B) { + for i := 0; i < b.N; i++ { + transform, err := tst.schema.NewTransform( + "bench", bytes.NewReader(tst.input), &transformctx.Ctx{}) + if err != nil { + b.FailNow() + } + for { + _, err = transform.Read() + if err == io.EOF { + break + } + if err != nil { + b.FailNow() + } + } + } +} + func Test1_CanadaPost_EDI_214(t *testing.T) { - cupaloy.SnapshotT(t, jsons.BPJ(samples.SampleTestCommon( - t, "./1_canadapost_edi_214.schema.json", "./1_canadapost_edi_214.input.txt"))) + tests[test1_CanadaPost_EDI_214].doTest(t) } func Test2_UPS_EDI_210(t *testing.T) { - cupaloy.SnapshotT(t, jsons.BPJ(samples.SampleTestCommon( - t, "./2_ups_edi_210.schema.json", "./2_ups_edi_210.input.txt"))) + tests[test2_UPS_EDI_210].doTest(t) +} + +func Test3_X12_834(t *testing.T) { + tests[test3_X12_834].doTest(t) } func Test3_NonValidatingReader(t *testing.T) { @@ -84,42 +157,17 @@ func Test3_NonValidatingReader(t *testing.T) { cupaloy.SnapshotT(t, jsons.BPM(rawSegs)) } -var benchSchemaFile = "./1_canadapost_edi_214.schema.json" -var benchInputFile = "./1_canadapost_edi_214.input.txt" -var benchSchema omniparser.Schema -var benchInput []byte +// Benchmark1_CanadaPost_EDI_214-8 1627 752143 ns/op 398667 B/op 9401 allocs/op +func Benchmark1_CanadaPost_EDI_214(b *testing.B) { + tests[test1_CanadaPost_EDI_214].doBenchmark(b) +} -func init() { - schema, err := ioutil.ReadFile(benchSchemaFile) - if err != nil { - panic(err) - } - benchSchema, err = omniparser.NewSchema("bench", bytes.NewReader(schema)) - if err != nil { - panic(err) - } - benchInput, err = ioutil.ReadFile(benchInputFile) - if err != nil { - panic(err) - } +// Benchmark2_UPS_EDI_210-8 201 6012683 ns/op 3213400 B/op 79062 allocs/op +func Benchmark2_UPS_EDI_210(b *testing.B) { + tests[test2_UPS_EDI_210].doBenchmark(b) } -// Benchmark1_CanadaPost_EDI_214-8 963 1248482 ns/op 362593 B/op 8301 allocs/op -func Benchmark1_CanadaPost_EDI_214(b *testing.B) { - for i := 0; i < b.N; i++ { - transform, err := benchSchema.NewTransform( - "bench", bytes.NewReader(benchInput), &transformctx.Ctx{}) - if err != nil { - b.FailNow() - } - for { - _, err = transform.Read() - if err == io.EOF { - break - } - if err != nil { - b.FailNow() - } - } - } +// Benchmark3_X12_834-8 4438 259565 ns/op 77049 B/op 2179 allocs/op +func Benchmark3_X12_834(b *testing.B) { + tests[test3_X12_834].doBenchmark(b) } diff --git a/extensions/omniv21/samples/fixedlength2/fixedlength_test.go b/extensions/omniv21/samples/fixedlength2/fixedlength_test.go index 81da1e0..e71df68 100644 --- a/extensions/omniv21/samples/fixedlength2/fixedlength_test.go +++ b/extensions/omniv21/samples/fixedlength2/fixedlength_test.go @@ -39,7 +39,6 @@ var tests = []testCase{ schemaFile: "./2_multi_rows.schema.json", inputFile: "./2_multi_rows.input.txt", }, - { // test3_Header_Footer schemaFile: "./3_header_footer.schema.json", diff --git a/extensions/omniv21/validation/ediFileDeclaration.go b/extensions/omniv21/validation/ediFileDeclaration.go index c93f8f3..57aee1a 100644 --- a/extensions/omniv21/validation/ediFileDeclaration.go +++ b/extensions/omniv21/validation/ediFileDeclaration.go @@ -17,6 +17,7 @@ const ( "segment_delimiter": { "type": "string", "minLength": 1 }, "element_delimiter": { "type": "string", "minLength": 1 }, "component_delimiter": { "type": "string", "minLength": 1 }, + "repetition_delimiter": { "type": "string", "minLength": 1 }, "release_character": { "type": "string", "minLength": 1 }, "ignore_crlf": { "type": "boolean" }, "segment_declarations": { @@ -70,5 +71,6 @@ const ( "value_comment": { "type": "string" } } } + ` ) diff --git a/extensions/omniv21/validation/ediFileDeclaration.json b/extensions/omniv21/validation/ediFileDeclaration.json index 2a30335..81ffea6 100644 --- a/extensions/omniv21/validation/ediFileDeclaration.json +++ b/extensions/omniv21/validation/ediFileDeclaration.json @@ -10,6 +10,7 @@ "segment_delimiter": { "type": "string", "minLength": 1 }, "element_delimiter": { "type": "string", "minLength": 1 }, "component_delimiter": { "type": "string", "minLength": 1 }, + "repetition_delimiter": { "type": "string", "minLength": 1 }, "release_character": { "type": "string", "minLength": 1 }, "ignore_crlf": { "type": "boolean" }, "segment_declarations": { @@ -62,4 +63,4 @@ }, "value_comment": { "type": "string" } } -} \ No newline at end of file +} diff --git a/idr/marshal1.go b/idr/marshal1.go index 229e47c..dd27062 100644 --- a/idr/marshal1.go +++ b/idr/marshal1.go @@ -30,8 +30,9 @@ func j1NodePtrName(n *Node) *string { } } -// j1NodeToInterface converts *Node into an interface{} suitable for json marshaling used in JSONify1. -func j1NodeToInterface(n *Node) interface{} { +// J1NodeToInterface translates an *idr.Node and its subtree into a JSON-marshaling friendly +// interface{} that includes all the idr.Node internal fields, including tree pointers. +func J1NodeToInterface(n *Node) interface{} { m := make(map[string]interface{}) m["Parent"] = j1NodePtrName(n.Parent) m["FirstChild"] = j1NodePtrName(n.FirstChild) @@ -43,7 +44,7 @@ func j1NodeToInterface(n *Node) interface{} { m["FormatSpecific"] = n.FormatSpecific var children []interface{} for child := n.FirstChild; child != nil; child = child.NextSibling { - children = append(children, j1NodeToInterface(child)) + children = append(children, J1NodeToInterface(child)) } m["Children"] = children return m @@ -51,5 +52,5 @@ func j1NodeToInterface(n *Node) interface{} { // JSONify1 json marshals a *Node verbatim. Mostly used in test for snapshotting. func JSONify1(n *Node) string { - return jsons.BPM(j1NodeToInterface(n)) + return jsons.BPM(J1NodeToInterface(n)) } diff --git a/idr/marshal2.go b/idr/marshal2.go index 82f7399..2a741c7 100644 --- a/idr/marshal2.go +++ b/idr/marshal2.go @@ -202,7 +202,8 @@ func (ctx *ctx) nodeToInterface(n *Node) interface{} { } } -// J2NodeToInterface translate an *idr.Node and its subtree into a JSON-marshaling friendly interface{}. +// J2NodeToInterface translates an *idr.Node and its subtree into a JSON-marshaling friendly +// interface{} that does not include any idr.Node internal fields, such as tree pointers. func J2NodeToInterface(n *Node, useJSONType bool) interface{} { return (&ctx{useJSONType: useJSONType}).nodeToInterface(n) }