>>>I'll check into that in the diagnoses table and source tables.
>
>Wise. To immediate review there is no obvious explanation for additional segments inside the string, except field values from the diagnosis table. Example: it may well be that in the dim distant past, somebody created a placeholder row in diagnosis to make one or more index values mimic the "not found" state even though they do exist. Your code tests for this and no longer needs the placeholder rows- but if they're there, you get the duplicates. If so, be careful changing it, in case you transfer the breakage somewhere else!
Examination of the diagnoses table did not show any of the ^^| in the table itself. Even more strange, in places where the code and qualifier are sent from the diagnoses table, the qualifier is NOT correct.... example....
^2015-09-24 12:00:00 AM^|^^|^v04.81^|^1^|^v^|^1^|^^|^2015-09-23 12:00:00 AM^|
The diagnosis_code is 'v04.81' and the diagnosis_code_qualifier is '1'
BUT..... in the diagnoses table the diagnosis_code_qualifier is '01'
and the code that gets the diagnosis_code_qualifier was
lcText = lcText + "^" + ALLTRIM(diagnoses.diagnosis_code_qualifier) + "^|"
So, the ALLTRIM(diagnoses.diagnosis_code_qualifier) should be '01'..... not '1' !!!
It acts like some other code is running feeding the incorrect rows ( I will check into this )....
This one of the MOST bizarre problems I have run across.
Thanks for the help!
Tommy Tillman A+ NetWork+ MCP