Originally posted by Shannon Laughlin
Hello - I have an HL7 message (ORU) that has multiple repeating OBX/NTE groups. I need to copy all iterations of the NTE for each OBX but my code is only copying the NTE segments for the first OBX group. Currently I have an iterate at the group level for the OBX and then an iterate at the segment level within that one for the NTE segment. As stated, this works fine if there is only one OBX segment. However, when there are multiple OBX segments, none of the NTE's are copied over for any OBX other than the first one. I also tried changing the NTE iterate to the group level (instead of segment) and when I do that, only the first NTE segment is attached to each OBX group (i.e. it trucates NTE|2|, NTE|3|, etc). Does anyone have suggestions on how I can get all NTE's for each OBX group to copy successfully?
Current Code with segment level iterate for NTE:
Iterate (group)
Pathcopy 1.(0).1(0).1(%g1).OBX(0)->1.(0).1(0).1(%g1).OBX(0)
Iterate (segment)
Pathcopy 1(0).1(0).1(0).NTE(%s1)->Pathcopy 1(0).1(0).1(0).NTE(%s1)
Output:
OBX|1|NUM|LABCHOL^Cholesterol Level||200|mg/dL^mg/dL|65-175^65^175|H|||F|||20131029132457||1111115851^^^^^^^^EXTID^^^^DONOTSEND|^^^CD:48074003
NTE|1||This is the first NTE segment.
NTE|2||This is the second NTE segment.
NTE|3||This is the third NTE segment.
NTE|4||This is the fourth NTE segment.
NTE|5||This is the fifth NTE segment.
NTE|6||Desirable: <200mg/dL
NTE|7||Borderline High: 200-239 mg/dL
NTE|8||High: > 240 mg/dL
OBX|2|NUM|CD:48101823^Cardiac Risk Factor||8.00||2.14-3.74^2.14^3.74|H|||F|||20131029132457||1111115851^^^^^^^^EXTID^^^^DONOTSEND|^^^CD:48074003
OBX|3|NUM|LABTRIG^Triglycerides Level||138|mg/dL^mg/dL|30-135^30^135|H|||F|||20131029132457||1111115851^^^^^^^^EXTID^^^^DONOTSEND|^^^CD:48074003
Code with group level iterate for NTE:
Iterate (group)
Pathcopy 1.(0).1(0).1(%g1).OBX(0)->1.(0).1(0).1(%g1).OBX(0)
Iterate (group)
Pathcopy 1(0).1(0).1(%s1).NTE(0)->Pathcopy 1(0).1(0).1(%s1).NTE(0)
Output:
OBX|1|NU|LABCHOL^Cholesterol Level||200|mg/dL^mg/dL|65-175^65|H|||F|||20131029132457||1111115851^^^^^^^^EXTID^^^^DONOTSEND|^^^CD:48074003
NTE|1||This is the first NTE segment
OBX|2|NU|CD:48101823^Cardiac Risk Factor||8.00||2.14-3.74|H|||F|||20131029132457||1111115851^^^^^^^^EXTID^^^^DONOTSEND|^^^CD:48074003
NTE|1||MEN WOMEN RELATIVE RISK
OBX|3|NU|LABTRIG^Triglycerides Level||138|mg/dL^mg/dL|30-135^30|H|||F|||20131029132457||1111115851^^^^^^^^EXTID^^^^DONOTSEND|^^^CD:48074003
NTE|1||This is the first NTE segment.