Hello Dr. Sparks,
Thanks for clarifying. I initially reported this because I noticed the following behavior:
- When multiple providers are selected, you usually get multiple slots per day.
- When a single provider is selected, you only get one.
I had to guess which one was intended, and the one that made more sense to us (and the one we want) was the first one, so I assumed the bug was in the single-provider case. According to what you're saying, my assumption was inside-out.
So to make it behave as intended, one option is the following patch (which I hope you don't use, as I mention below

):
Code: Select all
--- AppointmentL.cs.head-2010-09-10 2010-09-10 14:55:08.643210100 -0700
+++ AppointmentL.cs 2010-09-10 15:45:13.835155000 -0700
@@ -82,8 +82,11 @@
//step through day, one increment at a time, looking for a slot
pattern=ContrApptSingle.GetPatternShowing(apt.Pattern);
timeFound=new TimeSpan(0);
- for(int i=0;i<provBar[0].Length;i++){//144 if using 10 minute increments
- for(int p=0;p<providers.Length;p++){
+
+ bool findMoreMatchesToday=true;
+
+ for(int i=0;findMoreMatchesToday && i<provBar[0].Length;i++){//144 if using 10 minute increments
+ for(int p=0;findMoreMatchesToday && p<providers.Length;p++){
//assume apt will be placed here
aptIsMatch=true;
//test all apt increments for prov closed. If any found, continue
@@ -126,11 +129,9 @@
}
//match found
ALresults.Add(dayEvaluating+timeFound);
+ findMoreMatchesToday=false;
Plugins.HookAddCode(null,"AppointmentL.GetSearchResults_postfilter",ALresults,providers[p],apt);
}//for p
- if(aptIsMatch){//if a match found in this day
- break;//don't add any more matches for this day
- }
}
dayEvaluating=dayEvaluating.AddDays(1);//move to the next day
}
However, as I mentioned, we would prefer the search to return all options for a given day. Since it seems like we might be in the minority and that's not gonna happen, I'd like to request the ability to change the behavior within the hook I requested. The following alternate patch would squash the original bug and give me that flexibility all at the same time.
Code: Select all
--- AppointmentL.cs.head-2010-09-10 2010-09-10 14:55:08.643210100 -0700
+++ AppointmentL-allowoverride.cs 2010-09-10 15:51:14.571302200 -0700
@@ -82,8 +82,11 @@
//step through day, one increment at a time, looking for a slot
pattern=ContrApptSingle.GetPatternShowing(apt.Pattern);
timeFound=new TimeSpan(0);
- for(int i=0;i<provBar[0].Length;i++){//144 if using 10 minute increments
- for(int p=0;p<providers.Length;p++){
+
+ object[] findMoreMatchesToday=new object[]{true};
+
+ for(int i=0;((bool)(findMoreMatchesToday[0])) && i<provBar[0].Length;i++){//144 if using 10 minute increments
+ for(int p=0;((bool)(findMoreMatchesToday[0])) && p<providers.Length;p++){
//assume apt will be placed here
aptIsMatch=true;
//test all apt increments for prov closed. If any found, continue
@@ -126,11 +129,9 @@
}
//match found
ALresults.Add(dayEvaluating+timeFound);
- Plugins.HookAddCode(null,"AppointmentL.GetSearchResults_postfilter",ALresults,providers[p],apt);
+ findMoreMatchesToday[0]=false;
+ Plugins.HookAddCode(null,"AppointmentL.GetSearchResults_postfilter",ALresults,providers[p],apt,findMoreMatchesToday);
}//for p
- if(aptIsMatch){//if a match found in this day
- break;//don't add any more matches for this day
- }
}
dayEvaluating=dayEvaluating.AddDays(1);//move to the next day
}
Yes, it's ugly - enclosing the bool within an object array, but AFAIK, it's the cleanest way to achieve this within the callback framework as we have it.
Thanks again,