This is for an ORU and I have repeating OBX segment.
the if statement is based off of the condistion that a value in OBX-8 is true copy string to NTE 3 directly under said OBX segment.
For some reason my iterations are only putting the NTE at the bottom of the OBX segments, and not nested within.
0(0).MSH(0) : >|^~&|QML|123433|EPIC|1230600006|20130212132236||ORU^R30|228|P|2.4|2013021200035||AL|NE< 1(0).0(0).0(0).PID(0) : >|||100000000565||CHARGETEST^BEAKER^B||19700101|F||||||||||1001535< 1(0).0(0).1(0).PV1(0) : >||I|G4S|EL|||MELNIVYA^MELNIKOV^VYACHESLAV^Y||||||||||||1001535|||||||||||||||||||||||||||20121119160100< 1(0).1(0).0(0).ORC(0) : >|NW|||POC9||||||||MELNIVYA^MELNIKOV^VYACHESLAV^Y||||||13366^GEM^GSR Gem^GSR Gem^I< 1(0).1(0).0(0).OBR(0) : >|1|||POC9^^SHSPROC|3|20130130110816|20130130110816||||O||||A|MELNIVYA^MELNIKOV^VYACHESLAV^Y^^^^^EPIC^^^^PROVID< 1(0).1(0).1(0).OBX(0) : >|1|NM|1511122||7.36||||||F|||||7050|||20130130110816< 1(0).1(0).1(0).OBX(1) : >|2|NM|1511120||39||||||F< 1(0).1(0).1(0).OBX(2) : >|3|NM|1511124||73||||||F< 1(0).1(0).1(0).OBX(3) : >|4|NM|248||137||||||F< 1(0).1(0).1(0).OBX(4) : >|5|NM|246||3.9||||||F< 1(0).1(0).1(0).OBX(5) : >|6|NM|1511114||1.18||||||F< 1(0).1(0).1(0).OBX(6) : >|7|NM|1511113||212|||NR|||F|||||||^^^^^^^^^NR< 1(0).1(0).1(0).OBX(7) : >|8|NM|224||0.8||||||F< 1(0).1(0).1(0).OBX(8) : >|9|NM|249||32||||||F< 1(0).1(0).1(0).OBX(9) : >|10|NM|245||1.1600||||||F< 1(0).1(0).1(0).OBX(10) : >|11|NM|1511108||22.0000|||NR|||F|||||||^^^^^^^^^NR< 1(0).1(0).1(0).OBX(11) : >|12|NM|1511127||23.2000||||||F< 1(0).1(0).1(0).OBX(12) : >|13|NM|1511107||-3.2000||||||F< 1(0).1(0).1(0).NTE(0) : >|||test Not Reportable<