コード例 #1
0
        // GET: Journal/Create
        public ActionResult Create()
        {
            var doctors = _doctorRepository.GetAll().Select(x => new DoctorViewModel
            {
                DoctorId   = x.DoctorId,
                FirstName  = x.FirstName,
                SecondName = x.SecondName
            });
            var medRecord = _medRecordRepository.GetAll().Select(x => new MedRecordViewModel
            {
                MedRecordId = x.MedRecordId,
                DOB         = x.DOB,
                FirstName   = x.FirstName,
                SecondName  = x.SecondName
            });
            var procedures = _procedureRepository.GetAll().Select(x => new ProcedureViewModel
            {
                ProcedureId = x.ProcedureId,
                Name        = x.Name
            });

            var addJournalViewModel = new AddJournalViewModel
            {
                Doctors    = doctors,
                MedRecords = medRecord,
                Procedures = procedures
            };

            return(View(addJournalViewModel));
        }
コード例 #2
0
        public void Get_all_returns_data()
        {
            doctorRepository.GetAll().Returns(this.GetListOfDoctors());

            List <IdentifiableDTO <DoctorDTO> > returnedList = doctorService.GetAll().ToList();

            Assert.Equal(2, returnedList.Count);
        }
コード例 #3
0
        public IEnumerable <Prescription> GetAllEager()
        {
            IEnumerable <Prescription> prescriptions = GetAll();

            IEnumerable <Medicine> medicines = _medicineRepository.GetAll();
            IEnumerable <Doctor>   doctors   = _doctorRepository.GetAll();

            Bind(prescriptions);

            return(prescriptions);
        }
コード例 #4
0
 public IActionResult GetAll()
 {
     try
     {
         var doctors = _doctorRepository.GetAll();
         return(Json(doctors));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }
コード例 #5
0
        private bool UniqueName(string name)
        {
            if (!string.IsNullOrEmpty(name))
            {
                var category = _doctorRepository.GetAll(x => x.Name.ToLower() == name.ToLower()).FirstOrDefault();
                if (category == null)
                {
                    return(true);
                }
                return(false);
            }

            return(true);
        }
コード例 #6
0
        // GET: api/Doctor
        public HttpResponseMessage doctorbypatient(string ClientID)
        {
            var result = from a in _appointmentRepo.GetAll()
                         join
                         d in _getDoctorList.GetAll() on a.DoctorId equals d.DoctorId
                         where a.ClientId == ClientID && a.Status.ToLower() == "booked"
                         select new
            {
                Name  = d.FirstName + " " + d.FirstName + "_" + d.Degree,
                Value = d.DoctorId
            };

            return(Request.CreateResponse(HttpStatusCode.Accepted, result.Distinct()));
        }
コード例 #7
0
        public List <string> AtocompleteData(string searchtype, string autosearchtext)
        {
            List <string> autodatalist = new List <string>();

            if (searchtype == "1")
            {
                var hospitals = from h in _hospitaldetailsRepo.GetAll().Where(x => x.HospitalName.ToLower().Contains(autosearchtext.ToLower()))
                                select new { Name = h.HospitalName.ToString() + "( " + h.HospitalId + "-" + h.Address + ")" };
                List <AutocompleteData> autocompleteData = new List <AutocompleteData>();
                foreach (var item in hospitals)
                {
                    autodatalist.Add(item.Name);
                }
                return(autodatalist);
            }
            else
            {
                var doctors = from d in _doctorRepo.GetAll()
                              join h in _hospitaldetailsRepo.GetAll() on d.HospitalId equals h.HospitalId
                              where d.FirstName.ToLower().Contains(autosearchtext.ToLower()) || d.LastName.ToLower().Contains(autosearchtext.ToLower())
                              select new { Name = d.FirstName + " " + d.LastName + "(" + d.DoctorId + ") " + h.HospitalName };
                List <AutocompleteData> autocompleteData = new List <AutocompleteData>();
                foreach (var item in doctors)
                {
                    autodatalist.Add(item.Name);
                }
                return(autodatalist);
            }
        }
コード例 #8
0
        public User GetCurrentUserWithPrescriptions(Guid id)
        {
            var newUser = new User();
            var user    = userRepo.GetById(id);
            var pres    = preRepo.GetAll();
            var doc     = docRepo.GetAll();
            var drug    = drugRepo.GetAll();

            newUser.FirstName = user.FirstName;
            newUser.LastName  = user.LastName;
            newUser.UserName  = user.UserName;
            newUser.Email     = user.Email;
            newUser.Id        = user.Id;
            var prescription = pres.FirstOrDefault(a => a.UserId == newUser.Id);

            prescription.Doctor = doc.FirstOrDefault(d => d.Id == prescription.DoctorId);
            var drugs = drug.Where(drug1 => drug1.PrescriptionId == prescription.Id);


            prescription.Drugs = drugs.ToList();
            newUser.Prescriptions.Add(prescription);


            return(newUser);
        }
コード例 #9
0
        // GET: Doctors
        public IActionResult Index()
        {
            var doctors = _doctorRepository.GetAll()
                          .Include(d => d.Speciality)
                          .OrderBy(d => d.FullName);

            return(View(doctors));
        }
コード例 #10
0
        public IEnumerable <StatsDoctor> GetAllEager()
        {
            IEnumerable <StatsDoctor> allStats = GetAll();
            IEnumerable <Doctor>      doctors  = _doctorRepository.GetAll();

            BindStatisticsWithDoctors(allStats, doctors);

            return(allStats);
        }
コード例 #11
0
        private void BindArticlesWithAuthors(IEnumerable <Article> articles)
        {
            IEnumerable <Employee> doctors     = _doctorRepository.GetAll();
            IEnumerable <Employee> managers    = _managerRepository.GetAll();
            IEnumerable <Employee> secretaries = _secretaryRepository.GetAll();
            IEnumerable <Employee> employees   = doctors.Concat(managers).Concat(secretaries);

            articles.ToList().ForEach(a => a.Author = GetEmployeeById(employees, a.Author));
        }
コード例 #12
0
        public bool Authenticate(string username, string password, bool AdminUser = false)
        {
            if (!AdminUser)
            {
                var doctorUserCredentialDto = _mapper.Map <DoctorUserCredentialDto>(_doctorRepository.GetAll().FirstOrDefault(d => d.EmailAddress == username));

                if (doctorUserCredentialDto is null)
                {
                    return(false);
                }

                if (_passwordEncyptionUtill.Decrypt(doctorUserCredentialDto.EncryptedPassword) != password)
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #13
0
        private void BindNotificationsWithUser(IEnumerable <Notification> notifications)
        {
            IEnumerable <User> patients    = _patientRepository.GetAll();
            IEnumerable <User> doctors     = _doctorRepository.GetAll();
            IEnumerable <User> managers    = _managerRepository.GetAll();
            IEnumerable <User> secretaries = _secretaryRepository.GetAll();
            IEnumerable <User> users       = patients.Concat(doctors).Concat(managers).Concat(secretaries);

            notifications.ToList().ForEach(n => n.Recipient = GetUserById(users, n.Recipient));
        }
コード例 #14
0
        private void BindFeedbackWithUsers(IEnumerable <Feedback> feedbacks)
        {
            IEnumerable <User> patients    = _patientRepository.GetAll();
            IEnumerable <User> doctors     = _doctorRepository.GetAll();
            IEnumerable <User> managers    = _managerRepository.GetAll();
            IEnumerable <User> secretaries = _secretaryRepository.GetAll();
            IEnumerable <User> users       = patients.Concat(doctors).Concat(managers).Concat(secretaries);

            feedbacks.ToList().ForEach(f => f.User = GetUserById(users, f.User));
        }
コード例 #15
0
        public void BindMessagesWithUsers(IEnumerable <Message> messages)
        {
            IEnumerable <User> patients    = _patientRepository.GetAll();
            IEnumerable <User> doctors     = _doctorRepository.GetAll();
            IEnumerable <User> managers    = _managerRepository.GetAll();
            IEnumerable <User> secretaries = _secretaryRepository.GetAll();
            IEnumerable <User> users       = patients.Concat(doctors).Concat(managers).Concat(secretaries);

            messages.ToList().ForEach(m => { m.Recipient = GetUserById(users, m.Recipient); m.Sender = GetUserById(users, m.Sender); });
        }
コード例 #16
0
        public List <DoctorGetAllDto> GetAll()
        {
            var result = _doctorRepository.GetAll().Select(a => new DoctorGetAllDto {
                Id       = a.Id,
                Name     = a.Name,
                Phone    = a.Phone,
                Services = a.DoctorServices.Select(a => a.Service)
            });

            return(result.ToList());
        }
コード例 #17
0
        public List <DoctorViewModel> Filter(int page, int pageSize, out int total, int[] specialistIds, string search = null)
        {
            try
            {
                List <DoctorViewModel> doctors = new List <DoctorViewModel>();
                if (!specialistIds.IsNullOrEmpty())
                {
                    doctors = _doctorSpecialistRepository.GetAll()
                              .Include(x => x.MEDoctor)
                              .Where(x => specialistIds.Any(y => y == x.FK_MESpecialistID))
                              .Where(x => (search == null || search.Trim() == string.Empty) || x.MEDoctor.MEDoctorName.ToLower().Contains(search.ToLower()))
                              .ToList()
                              .OrderBy(x => x.MEDoctor.MEDoctorName)
                              .Skip(page - 1 * pageSize)
                              .Take(pageSize)
                              .Select(x => x.ToDoctorViewModel(_specialistService.GetSpecialistsByDoctor(x.FK_MEDoctorID.GetValueOrDefault()).ToArray()))
                              .ToList();
                }
                else
                {
                    doctors = _doctorRepository.GetAll()
                              .Where(x => (search == null || search.Trim() == string.Empty) || x.MEDoctorName.ToLower().Contains(search.ToLower()))
                              .ToList()
                              .OrderBy(x => x.MEDoctorName)
                              .Skip((page - 1) * pageSize)
                              .Take(pageSize)
                              .Select(x => x.ToDoctorViewModel(_specialistService.GetSpecialistsByDoctor(x.MEDoctorID).ToArray()))
                              .ToList();
                }

                total = doctors.Count();
                return(doctors);
            }
            catch (Exception ex)
            {
                _logService.Create(ex);
                throw ex;
            }
        }
コード例 #18
0
        public HttpResponseMessage getAllPrescription(string patientId)
        {
            var disease = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();
            var patientPrescriptions = from p in _prescriptionRepo.GetAll()
                                       join d in _doctorRepo.GetAll() on p.DoctorId equals d.DoctorId
                                       join h in _hospitaldetailsRepo.GetAll() on d.HospitalId equals h.HospitalId
                                       where (p.PatientId == patientId)
                                       select new
            {
                HospitalName     = h.HospitalName,
                HospitalNCNumber = h.HospitalId,
                DoctorName       = d.FirstName + " " + d.LastName,
                DoctorNCNumber   = d.DoctorId,
                Prescription     = p.Prescription,
                Report           = p.Report,
                PrescriptionDate = p.DateEntered,
                PrescriptionId   = p.Id,
                Specialization   = getSpecialization(d.Specialization, disease),
                //Doctors = getDoctorDetailByDoctorId(d.DoctorId)
            };

            return(Request.CreateResponse(HttpStatusCode.Accepted, patientPrescriptions));
        }
コード例 #19
0
        public Doctor FindDoctor(String username, String password)
        {
            List <Doctor> doctors = _doctorFileRepository.GetAll();

            foreach (Doctor doctor in doctors)
            {
                if (username.Equals(doctor.Username) && password.Equals(doctor.Password))
                {
                    return(doctor);
                }
            }

            return(null);
        }
コード例 #20
0
        // GET: DoctorController
        public ActionResult List()
        {
            IEnumerable <User> doctors = _doctorRepository.GetAll();
            var list = doctors.Select(x => new DoctorListViewModel()
            {
                ClinicId             = x.ClinicId,
                Clinic               = x.Clinic,
                Email                = x.Email,
                EmailConfirmed       = x.EmailConfirmed,
                EmailConfirmedString = x.EmailConfirmed ? "Yes" : "No",
                Id = x.Id
            });

            return(View(list));
        }
コード例 #21
0
ファイル: DoctorService.cs プロジェクト: NikoLa437/MQuince
 public IEnumerable <IdentifiableDTO <DoctorDTO> > GetAll()
 {
     try
     {
         return(_doctorRepository.GetAll().Select(c => DoctorMapper.MapDoctorEntityToIdentifierDoctorDTO(c)));
     }
     catch (ArgumentNullException e)
     {
         throw new NotFoundEntityException();
     }
     catch (Exception e)
     {
         throw new InternalServerErrorException();
     }
 }
コード例 #22
0
        public HttpResponseMessage PatientPrescription(string ClientId, string DoctorId)
        {
            Dictionary <string, int> PrescriptionFeedbackCount = new Dictionary <string, int>();
            var feedbackCount = _feedbackRepo.GetAll().Where(x => x.ClientID == ClientId && x.PageId == DoctorId).ToList();

            PrescriptionFeedbackCount.Add("FeedBackCount", feedbackCount.Count);

            var result = from a in _appointmentRepo.GetAll()
                         join
                         d in _doctorRepo.GetAll() on a.DoctorId equals d.DoctorId
                         join pp in _patientPrescriptionRepo.GetAll() on a.ClientId equals pp.PatientId
                         where a.ClientId == ClientId && a.Status == "Booked" && a.DoctorId == DoctorId
                         select pp;

            PrescriptionFeedbackCount.Add("PrescriptionCount", result.ToList().Count);
            return(Request.CreateResponse(HttpStatusCode.Accepted, PrescriptionFeedbackCount));
        }
コード例 #23
0
 public List <DoctorDTO> GetAllDoctors()
 {
     try
     {
         List <DoctorDTO>     doctorDTOList = new List <DoctorDTO>();
         IEnumerable <Doctor> doctorDTO     = _doctorRepository.GetAll();
         foreach (var doctor in doctorDTO)
         {
             var objdoctorDTO = ConvertTODTO(doctor);
             doctorDTOList.Add(objdoctorDTO);
         }
         return(doctorDTOList);
     }
     catch (Exception ex)
     {
         log.ErrorFormat("Exception occured while retrieving List of Doctor Information Ex:{0}", ex.Message);
         return(null);
     }
 }
コード例 #24
0
ファイル: DoctorAppService.cs プロジェクト: peleverton/gore
 public IEnumerable <DoctorViewModel> GetAll()
 {
     return(_doctorRepository.GetAll().ProjectTo <DoctorViewModel>());
 }
コード例 #25
0
 public List <Doctor> GetAll()
 {
     return(_doctorRepository.GetAll());
 }
コード例 #26
0
 public IActionResult Index()
 {
     return(View(db.GetAll()));
 }
コード例 #27
0
ファイル: DoctorController.cs プロジェクト: s13648/Cw11
 public async Task <IActionResult> GetList()
 {
     return(Ok(await doctorRepository.GetAll()));
 }
コード例 #28
0
ファイル: DoctorService.cs プロジェクト: ProbaFirma10/Proba
 public override List <DoctorUser> GetAll()
 {
     return(_doctorRepository.GetAll());
 }
コード例 #29
0
 public IEnumerable <Doctor> GetAll()
 => _doctorRepository.GetAll();
コード例 #30
0
        // GET: api/Doctor
        public HttpResponseMessage GetAll()
        {
            var result = _doctorRepo.GetAll().ToList();

            return(Request.CreateResponse(HttpStatusCode.Accepted, result));
        }