this post should be reviewed by OD team before being sure of it's user scopeRickliftig wrote:Also, I am getting a fair number of Unhandled exception errors: Tooth ID not valid
"Continue" hangs the program (just the chart part)
this problem plagued us for a couple of days, preventing us from opening the chart module for several thousand patients (but leaving others working just fine).
we poked around in the data tables and found some patients with garbage in the Surf column of procedurelog, and all of these had ProcDates prior to our conversion from Dentrix some months ago. so this is probably a conversion problem from Dentrix, but i can't verify that.
you can find any of these patients in your data tables by looking with this query (uncomment GROUP BY line to get list of patients):
Code: Select all
SELECT PatNum, ProcDate, Surf
FROM procedurelog p
WHERE Surf <''
#GROUP BY PatNum
ORDER BY PatNum
it seemed like OD was (in the latest chart rendering version) having trouble dealing with these garbage values. i tried to remove the garbage values with:
Code: Select all
UPDATE procedurelog p
SET Surf = ''
WHERE Surf <''
looking through the patient records, it looked these patients all had some sort of procedure that required a tooth range, but didn't have a range in the ToothRange column. i suspect that was a glitch with the Dentrix conversion that may hit a number of OD users.
i was able to narrow the thing down by looking for patients with empty ToothRange values, where the procedure would normally require them.....
Code: Select all
SELECT ProcNum, PatNum, ProcDate, Surf, ToothNum, ToothRange, ProcStatus, CodeNum
FROM procedurelog p
WHERE ToothRange = ''
AND CodeNum IN
(SELECT CodeNum
FROM procedurecode p
WHERE TreatArea = 7)
ORDER BY PatNum
Code: Select all
UPDATE procedurelog p
SET ToothRange = ToothNum
WHERE ToothRange = ''
AND CodeNum IN
(SELECT CodeNum
FROM procedurecode p
WHERE TreatArea = 7)
we were able to find them with this query:
Code: Select all
SELECT ProcNum, PatNum, ProcDate, Surf, ToothNum, ToothRange, ProcStatus, CodeNum
FROM procedurelog p
WHERE Surf = ''
AND CodeNum IN
(SELECT CodeNum
FROM procedurecode p
WHERE TreatArea = 6)
GROUP BY PatNum
ORDER BY PatNum
this last query seemed to do the trick and hopefully we have banished the "Invalid Tooth ID" error from our OpenDental universe:
Code: Select all
UPDATE procedurelog p
SET Surf = 'U'
WHERE Surf = '' # edited to reflect js's better query
AND CodeNum IN
(SELECT CodeNum
FROM procedurecode p
WHERE TreatArea = 6)