Ejemplo n.º 1
0
        ///<summary>Gets the data necessary from the database to run the appointment search logic.</summary>
        public static ApptSearchData GetDataForSearch(long aptNum, DateTime dateAfter, DateTime dateBefore, List <long> listProvNums, List <long> listOpNums
                                                      , List <long> listClinicNums, long blockoutType)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <ApptSearchData>(MethodBase.GetCurrentMethod(), aptNum, dateAfter, dateBefore, listProvNums, listOpNums, listClinicNums
                                                       , blockoutType));
            }
            ApptSearchData data = new ApptSearchData();

            data.DateEvaluating   = dateAfter.AddDays(1);
            data.AppointmentToAdd = Appointments.GetOneApt(aptNum);
            data.ListSchedules    = Schedules.GetSchedulesForAppointmentSearch(data.DateEvaluating, dateBefore, listClinicNums, listOpNums
                                                                               , listProvNums, blockoutType);
            //Get all appointments that exist in the operaotries we will be searching to find an opening, not just for provider we're looking for
            //so we can get conflicts when multiple provs work in a single operaotry.
            data.ListAppointments = Appointments.GetForPeriodList(data.DateEvaluating, dateBefore, listOpNums, listClinicNums);
            data.ListSchedOps     = ScheduleOps.GetForSchedList(data.ListSchedules, listOpNums);     //ops filter for case when a prov is scheduled in multiple ops
            return(data);
        }