You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to parse a X12 830 file, and I am struggling to properly handle the LIN segment.
Within the LIN segment, after the 1st element which is an ID for the LIN loop, it begins alternating between "Product/Service ID Qualifier" and "Product/Service ID". Only the first alternation is required in the specs, but it is capable of alternating 15 times total.
I would like some guidance on how to handle this in three different ways, the first, which is probably going to be more valuable for my use-case, is to use conditions to store the pair of values in objects, as we know the qualifiers that we should be looking for.
The second way I would handle it is to get a list of the potential 15 product/services without explicitly defining each property separately. I am not sure how to loop through this alternating elements similar to how you would handle repeated segments.
The third way, which would be the most robust at handling custom scenarios like this but it the least ideal, would be to be able to store the entire segment in a string and parse it manually. I'm unsure how to do this after looking through documentation.
Below is an example LIN segment that I'm referring to.
LIN*00010*BP*AFH203668*EC*A*CR*5500164382*PD*TIE BAND, FIR TREE MOUNT~
Broken down, the repeating alternations end up being as follows:
1: BP*AFH203668
2: EC*A
3: CR*5500164382
4: PD*TIE BAND, FIR TREE MOUNT
The text was updated successfully, but these errors were encountered:
I am trying to parse a X12 830 file, and I am struggling to properly handle the
LIN
segment.Within the LIN segment, after the 1st element which is an ID for the LIN loop, it begins alternating between "Product/Service ID Qualifier" and "Product/Service ID". Only the first alternation is required in the specs, but it is capable of alternating 15 times total.
I would like some guidance on how to handle this in three different ways, the first, which is probably going to be more valuable for my use-case, is to use conditions to store the pair of values in objects, as we know the qualifiers that we should be looking for.
The second way I would handle it is to get a list of the potential 15 product/services without explicitly defining each property separately. I am not sure how to loop through this alternating elements similar to how you would handle repeated segments.
The third way, which would be the most robust at handling custom scenarios like this but it the least ideal, would be to be able to store the entire segment in a string and parse it manually. I'm unsure how to do this after looking through documentation.
Below is an example LIN segment that I'm referring to.
LIN*00010*BP*AFH203668*EC*A*CR*5500164382*PD*TIE BAND, FIR TREE MOUNT~
Broken down, the repeating alternations end up being as follows:
The text was updated successfully, but these errors were encountered: