/// <summary> This method is getting list of filtered <c>Operation</c> of one patient by date. </summary> /// /// <param name="operations"><c>operations</c> is List of operations that matches search fields. /// </param> /// /// <param name="appointmentReportSearchDto"><c>appointmentReportSearchDto</c> is Data Transfer Object of a <c>Operation</c> that is being used to filter operations. /// </param> /// <returns> List of filtered patient's operations. </returns> private List <Operation> SearchForDate(List <Operation> operations, AppointmentReportSearchDto appointmentSearchDto) { if (!UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.Start) && !UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.End)) { operations = GetOperationsBetweenDates(appointmentSearchDto.Start, appointmentSearchDto.End, operations); } else if (UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.Start) && !UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.End)) { operations = GetOperationsBeforeDate(appointmentSearchDto.End, operations); } else if (!UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.Start) && UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.End)) { operations = GetOperationsAfterDate(appointmentSearchDto.Start, operations); } return(operations); }
public IActionResult SimpleSearchAppointments(AppointmentReportSearchDto dto) { return(Ok(new AppointmentAdapter().ConvertAppointmentListToAppointmentDtoList(this.regularAppointmentService.SimpleSearchAppointments(dto)))); }
/// <summary> This method is calling SearchForAppointmentType, SearchForDoctorNameAndSurname, SearchForDate to get list of filtered <c>Operation</c> of one patient. </summary> /// /// <param name="appointmentReportSearchDto"><c>appointmentReportSearchDto</c> is Data Transfer Object of a <c>Operation</c> that is being used to filter operations. /// </param> /// <returns> List of filtered patient's operations. </returns> public List <Operation> SimpleSearchOperations(AppointmentReportSearchDto appointmentReportSearchDto) { return(SearchForAppointmentType(SearchForDoctorNameAndSurname(SearchForDate(GetOperationsForPatient(appointmentReportSearchDto.PatientId), appointmentReportSearchDto), appointmentReportSearchDto), appointmentReportSearchDto)); }
/// <summary> This method is getting list of filtered <c>Operation</c> of one patient by appointment type. </summary> /// /// <param name="operations"><c>operations</c> is List of operations that matches search fields. /// </param> /// <param name="appointmentReportSearchDto"><c>appointmentReportSearchDto</c> is Data Transfer Object of a <c>Operation</c> that is being used to filter operations. /// </param> /// <returns> List of filtered patient's operations. </returns> private List <Operation> SearchForAppointmentType(List <Operation> operations, AppointmentReportSearchDto appointmentSearchDto) { if (UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.AppointmentType) || CheckIfOperation(appointmentSearchDto.AppointmentType)) { return(operations); } return(new List <Operation>()); }
/// <summary> This method is getting list of filtered <c>Operation</c> of one patient by doctor's name and surname. </summary> /// /// <param name="operations"><c>operations</c> is List of operations that matches search fields. /// </param> /// /// <param name="appointmentReportSearchDto"><c>appointmentReportSearchDto</c> is Data Transfer Object of a <c>Operation</c> that is being used to filter operations. /// </param> /// <returns> List of filtered patient's operations. </returns> private List <Operation> SearchForDoctorNameAndSurname(List <Operation> operations, AppointmentReportSearchDto appointmentSearchDto) { if (!UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.DoctorNameAndSurname)) { operations = operations.FindAll(operation => operation.Doctor.firstName.Contains(appointmentSearchDto.DoctorNameAndSurname) || operation.Doctor.secondName.Contains(appointmentSearchDto.DoctorNameAndSurname)); } return(operations); }
public IActionResult SimpleSearchOperations(AppointmentReportSearchDto dto) { return(Ok(new OperationAdapter().ConvertOperationListToOperationDtoList(operationService.SimpleSearchOperations(dto)))); }
/// <summary> This method is getting list of filtered <c>DoctorAppointment</c> of one patient by appointment type. </summary> /// /// <param name="appointments"><c>appointments</c> is List of appointments that matches search fields. /// </param> /// <param name="appointmentSearchDto"><c>appointmentSearchDto</c> is Data Transfer Object that is being used to filter operations. /// </param> /// <returns> List of filtered patient's appointments. </returns> private List <DoctorAppointment> SearchForAppointmentType(List <DoctorAppointment> appointments, AppointmentReportSearchDto appointmentSearchDto) { if (UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.AppointmentType) || CheckIfAppointment(appointmentSearchDto.AppointmentType)) { return(appointments); } return(new List <DoctorAppointment>()); }
/// <summary> This method is getting list of filtered <c>DoctorAppointment</c> of one patient by date. </summary> /// /// <param name="appointments"><c>appointments</c> is List of appointments that matches search fields. /// </param> /// <param name="appointmentReportSearchDto"><c>appointmentReportSearchDto</c> is Data Transfer Object of a <c>Operation</c> that is being used to filter operations. /// </param> /// <returns> List of filtered patient's appointments. </returns> private List <DoctorAppointment> SearchForDate(List <DoctorAppointment> appointments, AppointmentReportSearchDto appointmentSearchDto) { if (!UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.Start) && !UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.End)) { appointments = GetAppointmentsBetweenDates(appointmentSearchDto.Start, appointmentSearchDto.End, appointments); } else if (UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.Start) && !UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.End)) { appointments = GetAppointmentsBeforeDate(appointmentSearchDto.End, appointments); } else if (!UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.Start) && UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.End)) { appointments = GetAppointmentsAfterDate(appointmentSearchDto.Start, appointments); } return(appointments); }
/// <summary> This method is getting list of filtered <c>DoctorAppointment</c> of one patient by doctor's name and surname. </summary> /// /// <param name="appointments"><c>appointments</c> is List of appointments that matches search fields. /// </param> /// <param name="appointmentReportSearchDto"><c>appointmentReportSearchDto</c> is Data Transfer Object of a <c>Operation</c> that is being used to filter operations. /// </param> /// <returns> List of filtered patient's appointments. </returns> private List <DoctorAppointment> SearchForDoctorNameAndSurname(List <DoctorAppointment> appointments, AppointmentReportSearchDto appointmentSearchDto) { if (!UtilityMethods.CheckIfStringIsEmpty(appointmentSearchDto.DoctorNameAndSurname)) { appointments = appointments.FindAll(appointment => appointment.Doctor.firstName.Contains(appointmentSearchDto.DoctorNameAndSurname) || appointment.Doctor.secondName.Contains(appointmentSearchDto.DoctorNameAndSurname)); } return(appointments); }