private List <Appointment> GetRecommendedAppointmentsByPriority(AppointmentRecommendationDTO recommendationDTO)
 {
     if (recommendationDTO.Priority == RecommendationPriority.DOCTOR)
     {
         return(GetRecommendedAppointmentsByDoctorPriority(recommendationDTO));
     }
     else
     {
         return(GetRecommendedAppointmentsByTimeIntervalPriority(recommendationDTO));
     }
 }
        private List <Appointment> GetRecommendedAppointmentsByTimeIntervalPriority(AppointmentRecommendationDTO recommendationDTO)
        {
            List <Doctor>      doctors = _doctorService.GetDoctorByType(recommendationDTO.Doctor.DoctorType).ToList();
            List <Appointment> recommendedCandidates = new List <Appointment>();

            foreach (Doctor doctor in doctors)
            {
                List <Appointment> doctorsFreeAppointments = GetRecommendedAppointmentsCandidates(doctor, recommendationDTO.TimeInterval);
                recommendedCandidates.AddRange(doctorsFreeAppointments);
            }

            return(recommendedCandidates);
        }
        public List <Appointment> GetRecommendedAppointments(AppointmentRecommendationDTO recommendationDTO)
        {
            List <Appointment> freeAppointments = GetRecommendedAppointmentsCandidates(recommendationDTO.Doctor, recommendationDTO.TimeInterval);

            if (freeAppointments.Count >= _minimumAppointments)
            {
                return(freeAppointments);
            }
            else
            {
                List <Appointment> freeAppointmentsByPriority = GetRecommendedAppointmentsByPriority(recommendationDTO);
                return(MergeAppointments(freeAppointments, freeAppointmentsByPriority));
            }
        }
 public List <Appointment> GetRecommendedAppointments(AppointmentRecommendationDTO recommendation)
 => _appointmentRecommendationService.GetRecommendedAppointments(recommendation);