I'm unbundling 837p files at the 2300 loop and converting to XML. In the resulting XML the 2300 loop ends up as a child of Loop 2000B "SUBSCRIBER HIERARCHICAL LOOP" 85% of the time. The xpath statement to get to the claim amount
node, for example, is ./FunctionGroup/Transaction/HierarchicalLoop/HierarchicalLoop/Loop[@LoopId='2300']/CLM/CLM02
The problem is the other 15% of the time loop 2300 ends up a whole hierarchical loop level down as a child of loop 2000C "PATIENT HIERARCHICAL LOOP". So to get to the same claim amount node xpath would be ./FunctionGroup/Transaction/HierarchicalLoop/HierarchicalLoop/HierarchicalLoop/Loop[@LoopId='2300']/CLM/CLM02
Is this supposed to be the case? If so, is there a rule that determines when this will occur?
The problem is that the way I'm parsing the XML, I'm iterating on the lowest loop level available above 2300. I thought this was 2000B, but now that 2000C has shown up, it's thrown a wrench into the process. I can upload a deidentified 837 if
that would help.