We are sending lab results from our hospital lab system to our physician practice EHR. On microbiology results, Novius Lab will send an OBX segment that could end at field 5 followed by one or more ADD segments. If there is only one ADD segment. ADD-1 is always a continuation of the text for the preceding OBX-5. If there is only on ADD segment the rest of the ADD will be the rest of the OBX, if there is more than one then all but the last ADD will have just the one field then the last one will be the full segment.
Our EHR system cannot process the ADD segments so I am having to concatinate all the ADD-1 fields with OBX-5 then take the rest of the last ADD segment and move it to the appropriate OBX fields. I have it working great if there is only one ADD segment but if there is more than one I am completely stuck on how to handle this. I am open to any help or suggestions. Since I am already using a XLT file I would prefer to keep using it rather than using TCL code.