Since some of what I explained leaves you with abstract ideas and I want to help lets try an abbreviated approach.
I remembered using this approach for sorting IN1 segments and you might be able to understand this and get it to work.
First make the OBR & OBX segments in your HL7 varinat optional if they aren’t already setup that way. This will allow you to use the same HL7 pathing on both the inbound and outbound variants because any optional segments that we NULL out will automatically be removed by cloverleaf on the outbound side if the segments are defined as optional.
then try this logic:
MSH
PID
ORC
OBR
OBX
OBR
OBX
OBX
OBR
OBX….
do SUPRESS at beginning of xltate to supress orginal message from going out
I need to have:
MSH, PID, ORC, OBR, OBX
send this message out, then use PATHCOPY to NULL the outbound OBR, OBX segments that you just populated
then
MSH,PID,ORC, OBR, OBX, OBX
send this message out, then use PATHCOPY to NULL the outbound OBR, OBX, OBX segments
and
MSH,PID,ORC, OBR, OBX…
send this message out, then use PATHCOPY to NULL the outbound OBR, OBX… segments
If OBR, OBX is a group you might need to make that optional, too.
Let’s see if this approach can get you there without having to completely understand how to get total control of the iterate counters.
Let us know if this gets you any closer because it still seems some understadning of controlling the iterate counters might be necessary when reiterating to do the PATHCOPY nulling of the segmetns you just sent out.
Here is a URL to help get you started at understanding how people use the $%s1 and $%g1 syntax to take control of iterate counters.
<a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=3706″ class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=3706
Here is the URL illustrating how I took advantage of this technique to sort IN1 groups which also show some use of the $%g1 notation:
<a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=2206″ class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=2206
the post does go on for a bit so if in a hurry look at my post in the above URL on Mon Sep 17, 2007 5:10 pm.
Russ Ross
RussRoss318@gmail.com