I have a xlate that is taking the field segments from ODS 4 and creating a new ODS segment for each, and writing the appropriate field data to ODS 3 in each segment.
Pre xlate:
0000000657MSH|^~\&||OGH|||201909181457||ORM^O01|728986|D|2.4|||AL|NE|
PID|1||H000000906^^^^MR~156-23-4569^^^^SS~H902^^^^PI||CBORD^TEST8^^^^^L||19201025|F||CA||||||||E00002224|
PV1|1|I|^^^MD|IN||MEDICARE|||||||||||||||||||OGH||ADM|||201909111436|
AL1|1|FA|MUSHROON^Mushroom|SV||20190918|
AL1|2|FA|WALNUT^Walnut|SV||20190918|
ORC|CA|DIET20190918-0001OGH|||X|N|||201909181457|JHARRIS|
OBR|1|DIET20190918-0001OGH||DIET^REG||||||||||||^^^MD|||||||||||^^^20190918D|
ODS|D||57^REG^Regular Diet|OEDIETFD^20190918~OEDIETFT^1457~U.DTMOD02^CCD1800~U.DTMOD02^HH/Cardiac|
Post xlate
0000000698MSH|^~\&||OGH|||201909181457||ORM^O01|728986|D|2.4|||AL|NE
PID|1||H000000906^^^^MR~156-23-4569^^^^SS~H902^^^^PI||CBORD^TEST8^^^^^L||19201025|F||CA||||||||E00002224
PV1|1|I|^^^MD|IN||MEDICARE|||||||||||||||||||OG||AD|||201909111436
AL1|1|FA|MUSHROON^Mushroom|SV||20190918
AL1|2|FA|WALNUT^Walnut|SV||20190918
ORC|CA|DIET20190918-0001OGH|||X|N|||201909181457|JHARRIS
OBR|1|DIET20190918-0001OGH||DIET^REG||||||||||||^^^MD|||||||||||^^^20190918D
ODS|D||20190918^REG^Regular Diet|OEDIETFD^20190918~OEDIETFT^1457~U.DTMOD02^CCD1800~U.DTMOD02^HH/Cardiac
ODS|D||1457
ODS|D||CCD1800
ODS|D||HH/Cardiac
I need to add another ODS segment and place OBR 4 into the additional ODS segment. I am unable to reference my %f1 field variable outside of the ODS 4 iteration. I have tried a few different ideas using tcl in the xlate to no avail. I am unable to reference the variables in the xlate when using tcl.
Any suggestions?
Thank you