Page 1 of 1

Minor index-limit bug in appointment search

Posted: Mon Sep 13, 2010 1:58 pm
by alkhaef
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).

Re: Minor index-limit bug in appointment search

Posted: Mon Sep 13, 2010 8:02 pm
by jordansparks
I'm sure there's a reason why I used <= instead of the normal <. But I don't have time to investigate.