So I need something that will copy all of the IAR.1’s into a single IAM.5 field on the outbound separated by a ~. The IAM and IAR are in a repeating group. The IAM segment doesn’t repeat but the IAR can have multiple instances associated with a single IAM which is where my problem is. I need to be able to pull Abdominal Pain and Rash from the below example and then place in IAM.5 as Abdominal Pain~Rash. I have an Iterate setup on the group and the segment but I am not having any luck. I have banged my head against the wall for a while one this. Does anyone have any experience pulling values from multiple segments and then placing them into one field?
IAM||DA|8921^Latex^99ING|||X|||||||||||C|K Halley^Halley, Kelly^^^^^^^SOARIAN||201506291029|||||||8921^Latex^99ING
IAR|^Abdominal pain|MO||
IAR|^Rash|MO||