Originally posted by Shannon Laughlin
Hello! I'm working on some code that should only send NK1;1-3 if NK1;3 = M and NK1;2.1 != null. On the ADT coming into Cloverleaf the NK1 has multiple repeating segments but the receiving system only wants the NK1 segment for the Mother. I have a segment Iterate on NK1 as follows:
Action: Iterate
Type: segment
Basis: 0(0).NK1
Variable: %n1
The code is as follows:
IF 0(0).NK1(%n1).#3(0).[0] eq =M && 0(0).NK1(%n1).#2(0).[0] ne
@null Copy: 0(0).NK1(%n1).#1(0).[0]->0(0).NK1(0).#1(0).[0]
Copy: 0(0).NK1(%n1).#2(0).[0]->0(0).NK1(0).#2(0).[0]
0(0).NK1(%n1).#2(0).[1]->0(0).NK1(0).#2(0).[1]
Copy: 0(0).NK1(%n1).#3(0).[0]->0(0).NK1(0).#3(0).[0]
This is the NK1 data as it is coming inbound to CL:
NK1|1|Asdf^Asdfasdf|F||(562)543-2132||EMC
NK1|2|Asdfasdf^Asdfasdf|M|6545 What^^Signal Hill^CA^90806|(562)652-1300||NOK||||||NO EMPLOYER|||20090505
In this example, we only want the 2nd iteration of the NK1 to be mapped in the outbound ADT but currently, both iterations are being sent. Any suggestions are greatly appreciated.
Best Regards,
Shannon