Tom,
I think your basis is off.
First question though is – will there be multiple patients? This does not afffect the change I am going to recommend but the first iteration is not necessary if each mesage will only have one Patient.
Assuming that you want to continue as if there were multiple patients…
Try setting your basis by using the inbound message tree.
In your first ITERATE select the flag just above the PID segment (that is the group flag for the PID Group). If the ‘Copy to Basis’ button (looks like this {…}) below the inbound treee is no longer greyed out, you are at the right place and you should see a path below the buttons. If you click on the ‘Copy to Basis’ button your Basis field in the ITERATE should be populated. I am guessing it will look like this:
1(0).1
Now do the same thing with the OBR. Since it is a group the position to select in the inbound tree is the flag above the OBR segment (there could be two only one will activate the ‘Copy to Basis’ button.
I am guessing this one will look like this:
1(0).1(0).0
and you should make it look like this in your basis field for the OBR ITERATE: 1(0).1(%g1).0
In your COPY:
1(0).1(%g1).0(%g2).OBR.00543.[0]
If you know there will only be one Patient then you can just do the second ITERATE and modify the COPY accordingly.
If you want to double check, here is something I do sometimes to check my sanity with Repeitions:
Run the HL/7 tester for this variant against a message that has the repetitions you want with the detail level at something like 2 and look at the pathing. You will see the number change in the appropriate places for each repetition. Compare that pathing to where you have your basis.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.