コード例 #1
0
 /// <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);
 }
コード例 #2
0
 /// <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>());
 }
コード例 #3
0
 /// <summary> This method is getting list of filtered <c>DoctorAppointment</c> of logged patient by parameter <c>Doctor</c>. </summary>
 /// /// <param name="appointments"><c>appointments</c> is List of appointments that matches search fields.
 /// </param>
 /// <returns> List of filtered appointments. </returns>
 private List <DoctorAppointment> SearchForDoctorAdvanced(List <DoctorAppointment> appointments, String searchField)
 {
     if (!UtilityMethods.CheckIfStringIsEmpty(searchField))
     {
         appointments = appointments.FindAll(appointment => appointment.Doctor.firstName.Contains(searchField) || appointment.Doctor.secondName.Contains(searchField) || appointment.Doctor.DoctorFullName().Contains(searchField));
     }
     return(appointments);
 }
コード例 #4
0
 /// <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>());
 }
コード例 #5
0
 /// <summary> This method is getting list of filtered <c>DoctorAppointment</c> of logged patient by parameter <c>Room</c>. </summary>
 /// /// <param name="appointments"><c>appointments</c> is List of appointments that matches search fields.
 /// </param>
 /// <returns> List of filtered appointments. </returns>
 private List <DoctorAppointment> SearchForRoomAdvanced(List <DoctorAppointment> appointments, String searchField)
 {
     if (!UtilityMethods.CheckIfStringIsEmpty(searchField))
     {
         appointments = appointments.FindAll(appointment => appointment.RoomId.Contains(searchField));
     }
     return(appointments);
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 /// <summary> This method is getting list of filtered <c>DoctorAppointment</c> of logged patient by parameter <c>Date</c>. </summary>
 /// /// <param name="appointments"><c>appointments</c> is List of appointments that matches search fields.
 /// </param>
 /// <returns> List of filtered appointments. </returns>
 private List <DoctorAppointment> SearchForDateAdvanced(List <DoctorAppointment> appointments, String searchField)
 {
     if (!UtilityMethods.CheckIfStringIsEmpty(searchField))
     {
         appointments = appointments.FindAll(appointment => appointment.Date.ToString().Equals(searchField));
     }
     return(appointments);
 }
コード例 #8
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>Comment</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="searchField"><c>searchField</c> is field that contains comment and is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForCommentsAdvanced(List <Prescription> prescriptions, String searchField)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(searchField))
            {
                prescriptions = prescriptions.FindAll(prescription => prescription.comment.Contains(searchField));
            }

            return(prescriptions);
        }
コード例 #9
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>Messages</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="prescriptionSearchDto"><c>prescriptionSearchDto</c> is Data Transfer Object of a <c>Prescription</c> that is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForMedicines(List <Prescription> prescriptions, PrescriptionSearchDto prescriptionSearchDto)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(prescriptionSearchDto.Medicines))
            {
                prescriptions = prescriptions.Where(prescription => prescription.Medicines.Any(medicine => medicine.name.Contains(prescriptionSearchDto.Medicines))).ToList();
            }

            return(prescriptions);
        }
コード例 #10
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>Comment</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="prescriptionSearchDto"><c>prescriptionSearchDto</c> is Data Transfer Object of a <c>Prescription</c> that is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForComments(List <Prescription> prescriptions, PrescriptionSearchDto prescriptionSearchDto)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(prescriptionSearchDto.Comment))
            {
                prescriptions = prescriptions.FindAll(prescription => prescription.comment.Contains(prescriptionSearchDto.Comment));
            }

            return(prescriptions);
        }
コード例 #11
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>IsUsed</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="prescriptionSearchDto"><c>prescriptionSearchDto</c> is Data Transfer Object of a <c>Prescription</c> that is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForUsed(List <Prescription> prescriptions, PrescriptionSearchDto prescriptionSearchDto)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(prescriptionSearchDto.IsUsed))
            {
                prescriptions = prescriptions.FindAll(prescription => prescription.isUsed.ToString().Contains(prescriptionSearchDto.IsUsed));
            }

            return(prescriptions);
        }
コード例 #12
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>Doctor</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="prescriptionSearchDto"><c>prescriptionSearchDto</c> is Data Transfer Object of a <c>Prescription</c> that is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForDoctor(List <Prescription> prescriptions, PrescriptionSearchDto prescriptionSearchDto)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(prescriptionSearchDto.Doctor))
            {
                prescriptions = prescriptions.FindAll(prescription => prescription.Doctor.firstName.Contains(prescriptionSearchDto.Doctor) || prescription.Doctor.secondName.Contains(prescriptionSearchDto.Doctor) || prescription.Doctor.DoctorFullName().Contains(prescriptionSearchDto.Doctor));
            }

            return(prescriptions);
        }
コード例 #13
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>Messages</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="searchField"><c>searchField</c> is field that contains medicine name and is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForMedicinesAdvanced(List <Prescription> prescriptions, String searchField)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(searchField))
            {
                prescriptions = prescriptions.Where(prescription => prescription.Medicines.Any(medicine => medicine.name.Contains(searchField))).ToList();
            }

            return(prescriptions);
        }
コード例 #14
0
        /// <summary> This method is getting list of filtered <c>Prescription</c> of logged patient by parameter <c>Doctor</c>. </summary>
        /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
        /// </param>
        /// /// <param name="searchField"><c>searchField</c> is field that contains doctors name or surname and is being used to filter precriptions.
        /// </param>
        /// <returns> List of filtered patient prescriptions. </returns>
        private List <Prescription> SearchForDoctorAdvanced(List <Prescription> prescriptions, String searchField)
        {
            if (!UtilityMethods.CheckIfStringIsEmpty(searchField))
            {
                prescriptions = prescriptions.FindAll(prescription => prescription.Doctor.firstName.Contains(searchField) || prescription.Doctor.secondName.Contains(searchField) || prescription.Doctor.DoctorFullName().Contains(searchField));
            }

            return(prescriptions);
        }
コード例 #15
0
 public AppointmentReportSearchValidator()
 {
     When(f => !UtilityMethods.CheckIfStringIsEmpty(f.Start), () =>
     {
         RuleFor(f => UtilityMethods.TryParseDateInCorrectFormat(f.Start)).Equal(true);
     });
     When(f => !UtilityMethods.CheckIfStringIsEmpty(f.End), () => {
         RuleFor(f => UtilityMethods.TryParseDateInCorrectFormat(f.End)).Equal(true);
     });
 }
コード例 #16
0
 /// <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);
 }
コード例 #17
0
 /// <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);
 }
コード例 #18
0
 /// <summary> This method is calling function for getting list of filtered <c>Prescription</c> of logged patient by sent parameter. </summary>
 /// /// <param name="prescriptions"><c>prescriptions</c> is List of presciptions that matches search fields.
 /// </param>
 /// /// <param name="dto"><c>PrescriptionAdvancedSearchDto</c> is Data Transfer Object of <c>Prescription</c> and is being used to filter precriptions depending on sent value.
 /// </param>
 /// <returns> List of filtered patient prescriptions. </returns>
 private List <Prescription> SearchForFirstParameter(List <Prescription> prescriptions, PrescriptionAdvancedSearchDto dto)
 {
     return(dto.FirstRole.Equals("medicines") || UtilityMethods.CheckIfStringIsEmpty(dto.FirstRole) ? SearchForMedicinesAdvanced(prescriptions, dto.First) :
            dto.FirstRole.Equals("comment") ? SearchForCommentsAdvanced(prescriptions, dto.First) :
            dto.FirstRole.Equals("isUsed") ? SearchForUsedAdvanced(prescriptions, dto.First) : SearchForDoctorAdvanced(prescriptions, dto.First));
 }
コード例 #19
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));
 }