public async Task <IEnumerable <PatientQueryDto> > PatientsQueryAsync(PatientsQueryInput input)
        {
            IEnumerable <PatientProfile> queryPatients = await _patientrepository.Query(patients =>
                                                                                        patients.Include(p => p.Insurance)
                                                                                        .ThenInclude(i => i.InsuranceCompany)
                                                                                        .Where(p =>
                                                                                               (p.Id == input.PatientId || input.PatientId == 0) &&
                                                                                               (p.IdNumber.Contains(input.IdNumber) || string.IsNullOrEmpty(input.IdNumber)) &&
                                                                                               (p.Name.ToLower().Contains(input.Name.ToLower()) || string.IsNullOrEmpty(input.Name)) &&
                                                                                               (p.ProfileNumber.Contains(input.ProfileNumber) || string.IsNullOrEmpty(input.ProfileNumber)) &&
                                                                                               (p.PhoneNumber.Contains(input.PhoneNumber) || string.IsNullOrEmpty(input.PhoneNumber)) &&
                                                                                               (p.Email.Contains(input.Email) || string.IsNullOrEmpty(input.Email)) &&
                                                                                               (p.DoctorId == input.DoctorId || input.DoctorId == 0) &&
                                                                                               (p.Insurance.InsuranceCompanyId == input.InsuranceCompanyId || input.InsuranceCompanyId == 0) &&
                                                                                               (p.HasHealthInsurance == input.HasHealthInsurance || input.HasHealthInsurance == false)
                                                                                               )
                                                                                        .Skip(input.SkipCount)
                                                                                        .Take(input.MaxResultCount)
                                                                                        .ToListAsync()
                                                                                        );

            IEnumerable <PatientQueryDto> patientQueryDtos = _mapper.Map <IEnumerable <PatientQueryDto> >(queryPatients);

            return(patientQueryDtos);
        }
        public async Task <AppResponse <PatientsQueryOutput> > PatientsQueryAsync(PatientsQueryInput input)
        {
            input.TrimStringProperties();

            IEnumerable <PatientQueryDto> patients = await _patienManager.PatientsQueryAsync(input);

            return(new AppResponse <PatientsQueryOutput>
            {
                Data = new PatientsQueryOutput {
                    Patients = patients
                },
                IsSuccessful = true,
                StatusCode = StatusCodes.SUCCESS
            });
        }