I’ve read through several posts addressing iteration questions and adding/removing repeating segments. I don’t believe that any of them address the question that I have.
I am looking to iterate through the Consulting Physician field (PV1-8). In this field there can be multiple physicians, and each physician can have multiple physician IDs. For example, consulting physician 1 can have an internal ID, an external ID and a National Provider Index (NPI) ID. Consulting physician 2 can have the same information. I would like to strip out all non-NPI IDs for each physician, leaving only the NPIs for each physician.
|001^ONE^PHYSICIAN^Internal~010^ONE^PHYSICIAN^External~100^ONE^PHYSICIAN^NPI~002^TWO^PHYSICIAN^Internal~020^TWO^PHYSICIAN^External~200^TWO^PHYSICIAN^NPI|
I have the logic to iterate through the repeated fields and identify the NPI. My question is simple: can I manipulate a field iteration variable independently? Here is sample tcl code for within an xlate:
set npi “NPI”
set providerID $xlateInVals
if {[lsearch -regexp $providerID $npi]} {
set xlateOutVals $providerID
}
What I would like to do is have some sort of counter within the if statement that would be incremented, and use that in the Destination, i.e. 0(0).PV1.#7([counter]
As always, any insight is appreciated.