Yay for production estimates! :D ... but...

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Yay for production estimates! :D ... but...

Post by alkhaef » Mon Nov 08, 2010 12:52 pm

This has been a much anticipated feature for us! Thanks!

I ran into something when testing it though... It doesn't respect the WriteOffEstOverride ... Here are the relevant code sections in "Data Interface\Appointments.cs":

Line 646+...

Code: Select all

				command="SELECT AptNum,PlannedAptNum,"//AbbrDesc,procedurecode.CodeNum
					+"ProcFee, "
					+"SUM(WriteOffEst) writeoffPPO "
					//+"Surf,ToothNum,TreatArea  "
					+"FROM procedurelog "
					+"LEFT JOIN procedurecode ON procedurelog.CodeNum=procedurecode.CodeNum "
					+"LEFT JOIN claimproc ON claimproc.ProcNum=procedurelog.ProcNum "
					+"AND claimproc.WriteOffEst != -1 "
					+"WHERE ";
Line 920+...

Code: Select all

						production+=PIn.Decimal(rawProc.Rows[p]["ProcFee"].ToString());
						//WriteOffEst -1 already excluded
						production-=PIn.Decimal(rawProc.Rows[p]["writeoffPPO"].ToString());//frequently zero
One way to fix it that appears consistent with your approach would be to apply the following respective modifications:

Line 646+...

Code: Select all

				command="SELECT AptNum,PlannedAptNum,"//AbbrDesc,procedurecode.CodeNum
					+"ProcFee, "
					+"SUM(cpa.WriteOffEst) writeoffPPO, "
					+"SUM(cpb.WriteOffEstOverride) writeoffPPOOverride "
					//+"Surf,ToothNum,TreatArea  "
					+"FROM procedurelog "
					+"LEFT JOIN procedurecode ON procedurelog.CodeNum=procedurecode.CodeNum "
					+"LEFT JOIN claimproc cpa ON cpa.ProcNum=procedurelog.ProcNum "
					+"AND cpa.WriteOffEstOverride = -1 AND cpa.WriteOffEst != -1 "
					+"LEFT JOIN claimproc cpb ON cpb.ProcNum=procedurelog.ProcNum "
					+"AND cpb.WriteOffEstOverride != -1 "
					+"WHERE ";
Line 920+...

Code: Select all

						production+=PIn.Decimal(rawProc.Rows[p]["ProcFee"].ToString());
						//WriteOffEst -1 already excluded
						production-=PIn.Decimal(rawProc.Rows[p]["writeoffPPO"].ToString());//frequently zero
						production-=PIn.Decimal(rawProc.Rows[p]["writeoffPPOOverride"].ToString());//even more frequently zero
I tested it under some exotic possibilities and it works.

Also... Can I suggest to refactor this functionality out? It would be very useful for use in other parts of OD as well if you guys want to expand reporting, etc, and save me a lot of hassles in reimplimenting it in my plugin.

Thanks,
Al
Al
Help! I've OD'ed on OD! :)

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: Yay for production estimates! :D ... but...

Post by alkhaef » Mon Nov 08, 2010 12:57 pm

Whoops... This was probably better suited in the "Developers" forum... I probably misposted it when looking for a duplicate report...

Oh well :oops:
Al
Help! I've OD'ed on OD! :)

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: Yay for production estimates! :D ... but...

Post by alkhaef » Wed Nov 10, 2010 1:12 pm

Ping? :)
Al
Help! I've OD'ed on OD! :)

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

Re: Yay for production estimates! :D ... but...

Post by jordansparks » Wed Nov 10, 2010 9:08 pm

This was added to the bug list.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply