I am on RedHat Linux 4.0 running CL 5.5.
I have a repeating field that has 1 field with 3 components. Each doctor can have numerous different doctor numbers with a unique ID. The problem is that there is no unique delimiter between each set of doctor numbers.
ex) 10^name1^IDa~11^name1^IDb~12^name1^IDc~20^name2^IDa~22^name2^IDc~23^name2^IDd~30^name3^IDa~31^name3^IDb~32^name3^IDc~33^name3^IDd~34^name3^IDe
name1, name2 and name3 are three different doctors. Name1 has 3 doctor numbers, Name2 has 3 doctor numbers and Name3 has 5 doctor numbers.
I want to pull out one doctor number per doctor based on this logic:
copy the number ,name and ID if ID = IDe
if no IDe then not copy number, name and ID if ID = IDc
if no IDc then copy number , name and ID = IDa
So output for the above example should look like this:
OBR#28(0).[0] = 10
OBR#28(0).[1] = name1
OBR#28(0).[2] = IDa
OBR#28(1).[0] = 22
OBR#28(1).[1] = name2
OBR#28(1).[2] = IDc
OBR#28(2).[0] = 34
OBR#28(2).[1] = name3
OBR#28(2).[2] = IDe
Any and all help is greatly appreciated.