I have an inbound message (not HL7) which contains amoungst other things one primary procedure and zero or more secondary procedures. The information for both of these is to be mapped to the repeating PR1 (HL7 segment). What I want to do is store the primary procedure in PR1(0) and the secondary procedures in PR1(n). I can populate the secondary procedures using the following iterate but it just overrides the primary procedure information. Ideally what I want to do is for the iterate to start populating segments after the primary procedure information (PR1(1) and above). The primary procedure information is stored in a different inbound segment
Any suggestions as to how this can be done?
I am using Cloverleaf V5.3
{ { OP COPY }
{ ERR 0 }
{ IN {=0 =OPCS =SEG4.OPCS_Primary_Intended_Procedure_Code} }
{ OUT {0(0).PR1(0).00391 {0(0).PR1(0).00392.[0]]} 0(0).PR1(0).00393} }
}
{ { OP ITERATE }
{ BASIS SEG5 }
{ VAR %s1 }
{ TYPE segment }
{ BODY {
{ { OP COMMENT }
{ COMMENT {TODO: Insert new actions here} }
}
{ { OP COPY }
{ ERR 2 }
{ IN {{$%s1}} }
{ OUT 0(0).PR1(%s1).00391 }
}
{ { OP COPY }
{ ERR 2 }
{ IN =OPCS }
{ OUT 0(0).PR1(%s1).00392 }
}
{ { OP COPY }
{ ERR 2 }
{ IN SEG5(%s1).OPCS_Secondary_Intended_Procedure_Code }
{ OUT 0(0).PR1(%s1).00393 }
}
}}
}
Output using the Xlate test GUI
0(0).PR1(0).00391(0).[0].[0] “Set ID – PR1” : >0< 0(0).PR1(0).00392(0).[0].[0] “Procedure Coding Method” : >OPCS< 0(0).PR1(0).00393(0).[0].[0] “Procedure Code” : >W21.1< 0(0).PR1(1).00391(0).[0].[0] “Set ID – PR1” : >1< 0(0).PR1(1).00392(0).[0].[0] “Procedure Coding Method” : >OPCS< 0(0).PR1(1).00393(0).[0].[0] “Procedure Code” : >W11.1< 0(0).PR1(2).00391(0).[0].[0] “Set ID – PR1” : >2< 0(0).PR1(2).00392(0).[0].[0] “Procedure Coding Method” : >OPCS< 0(0).PR1(2).00393(0).[0].[0] “Procedure Code” : >W33.1< Thanks in advance for your assistance. Graham