Update Recall table to disable until date for insurance type

For users or potential users.
Post Reply
khdilger
Posts: 112
Joined: Wed May 05, 2010 5:56 am

Update Recall table to disable until date for insurance type

Post by khdilger » Sun Feb 06, 2011 10:56 am

I would like to run the SQL statement below to update the recall table to disable recall until a specific date for the medicaid patient population. I have tested it on a backup of the database and from what I can tell its exactly what I am intending. I bought this practice and am beginning the process of transitioning to not take medicaid and I want them out of the recall for a while. Can someone verify that what I am doing is accurate? I picked a specific date/time just in case I wanted to find the records in the future. "EDS" is part of the name for the Medicaid insurance carriername.

update recall recallupdate SET DisableUntilDate = '2012-01-01 11:11:11' WHERE recallupdate.PatNUM IN (SELECT DISTINCTROW p.PatNum
FROM patient p
INNER JOIN patplan pp ON pp.PatNum=p.PatNum
INNER JOIN insplan ip ON ip.PlanNum=pp.PlanNum
INNER JOIN carrier ca ON ca.CarrierNum=ip.CarrierNum
INNER JOIN patient gu ON p.Guarantor=gu.PatNum
WHERE ca.CarrierName LIKE '%EDS%'
ORDER BY ca.CarrierName, gu.LName);

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Update Recall table to disable until date for insurance type

Post by jordansparks » Sun Feb 06, 2011 1:06 pm

I would get rid of all the aliases since they just make your query confusing. Also, get rid of the patient guarantor table and the order by. But as far as I can tell, that doesn't look too bad. I just want to stress that we always try to discourage customers from making changes like this.
Jordan Sparks, DMD
http://www.opendental.com

khdilger
Posts: 112
Joined: Wed May 05, 2010 5:56 am

Re: Update Recall table to disable until date for insurance type

Post by khdilger » Sun Feb 06, 2011 1:16 pm

jordansparks wrote:I would get rid of all the aliases since they just make your query confusing. Also, get rid of the patient guarantor table and the order by. But as far as I can tell, that doesn't look too bad. I just want to stress that we always try to discourage customers from making changes like this.
Yeah, the order by and gaurantor parts were from the example queries and I had them in there when I was looking at the data that was being brought back before the update. As far as discouraging making changes like this do you have any suggestions on how to do what I want without doing such a query? I guess paying someone to do it... My original background and degree is in CS and a programmer for a few years before going back to dental school. However its been 7+ years since I have done much so thats why I like to check with you guys first.

Kenny

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Update Recall table to disable until date for insurance type

Post by jordansparks » Sun Feb 06, 2011 2:21 pm

We try to convince users to use the UI to make such changes. Paying someone to sit for 3 hours to key it in might run $50. Making a mistake and causing a corrupt database would cost more than that.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply