Minor index-limit bug in appointment search

This forum is for programmers who have questions about the source code.
Post Reply
alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Minor index-limit bug in appointment search

Post by alkhaef » Mon Sep 13, 2010 1:58 pm

During testing of the search functionality, I found that the search functionality always incorrectly reports one extra block of time at the tail end of a schedule because of the function below:

Code: Select all

		///<summary>Only used in GetSearchResults.  All times between start and stop get set to true in provBarSched.</summary>
		private static void SetProvBarSched(ref bool[] provBarSched,DateTime timeStart,DateTime timeStop){
			int startI=GetProvBarIndex(timeStart);
			int stopI=GetProvBarIndex(timeStop);
			for(int i=startI;i<=stopI;i++){
				provBarSched[i]=true;
			}
		}
The line should instead read

Code: Select all

			for(int i=startI;i<stopI;i++){
Not a huge deal for me, since I'm planning to move to 5-minute increments after overcoming some barriers, but it might matter more for others using coarser granularity (especially if procedure code patterns are set up tightly).
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: Minor index-limit bug in appointment search

Post by jordansparks » Mon Sep 13, 2010 8:02 pm

I'm sure there's a reason why I used <= instead of the normal <. But I don't have time to investigate.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply