public IActionResult AdvancedSearchAppointments(AppointmentAdvancedSearchDto dto)
 {
     return(Ok(this.regularAppointmentService.AdvancedSearchAppointments(dto)));
 }
Beispiel #2
0
 /// <summary> This method is getting list of filtered <c>DoctorAppointment</c> that match list of parameters in <c>AppointmentAdvnacedSearchDto</c></summary>
 /// <param name="appointments"> List of all <c>DoctorAppointment</c> of logged user.
 /// </param>
 /// <param name="dto"><c>AppointmentAdvancedSearchDto</c> is Data Transfer Object of a <c>DoctorAppointment</c> that is be used to filter appointments.
 /// </param>
 /// <param name="firstAppointments"> List of <c>DoctorAppointment</c> that contains appointments that matches first parameter.
 /// </param>
 /// <returns> List of filtered appointments. </returns>
 private List <DoctorAppointment> SearchForOtherParameters(List <DoctorAppointment> appointments, AppointmentAdvancedSearchDto dto, List <DoctorAppointment> firstAppointments)
 {
     for (int i = 0; i < dto.RestRoles.Length; i++)
     {
         firstAppointments = SearchForLogicOperators(dto.LogicOperators[i], SearchForOtherRoles(dto.RestRoles[i], dto.Rest[i], appointments), firstAppointments);
     }
     return(firstAppointments);
 }
Beispiel #3
0
 private List <DoctorAppointment> SearchForFirstParameter(List <DoctorAppointment> appointments, AppointmentAdvancedSearchDto dto)
 {
     return(dto.FirstRole.Equals("doctor") || UtilityMethods.CheckIfStringIsEmpty(dto.FirstRole) ? SearchForDoctorAdvanced(appointments, dto.First) :
            dto.FirstRole.Equals("date") ? SearchForDateAdvanced(appointments, dto.First) : SearchForRoomAdvanced(appointments, dto.First));
 }
Beispiel #4
0
 /// <summary> This method is calling searchForFirstParameter, searchForOtherParameters to get list of filtered <c>DoctorAppointment</c> of logged patient. </summary>
 /// /// <param name="dto"><c>AppointmentAdvancedSearchDto</c> is Data Transfer Object of a <c>DoctorAppointment</c> that is be used to filter appointments.
 /// </param>
 /// <returns> List of filtered appointments. </returns>
 public List <DoctorAppointment> AdvancedSearchAppointments(AppointmentAdvancedSearchDto dto)
 {
     return(SearchForOtherParameters(GetAppointmentsForPatient(2), dto, SearchForFirstParameter(GetAppointmentsForPatient(2), dto)));
 }