Do you need to specificall clear the first 4 iterations of OBX:5 from the iteration at the group level? Also it appears as though you have treated the repeating groups at the top of your iterate and then started using the %f1 variable further on down.
I would need to know the structure of your variants in and out to take this further…
ie
MSH
EVN
PID
{
[{OBX}]
[NTE]
}….