// 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)); }
public void Get_all_returns_data() { doctorRepository.GetAll().Returns(this.GetListOfDoctors()); List <IdentifiableDTO <DoctorDTO> > returnedList = doctorService.GetAll().ToList(); Assert.Equal(2, returnedList.Count); }
public IEnumerable <Prescription> GetAllEager() { IEnumerable <Prescription> prescriptions = GetAll(); IEnumerable <Medicine> medicines = _medicineRepository.GetAll(); IEnumerable <Doctor> doctors = _doctorRepository.GetAll(); Bind(prescriptions); return(prescriptions); }
public IActionResult GetAll() { try { var doctors = _doctorRepository.GetAll(); return(Json(doctors)); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
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); }
// 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())); }
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); } }
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); }
// GET: Doctors public IActionResult Index() { var doctors = _doctorRepository.GetAll() .Include(d => d.Speciality) .OrderBy(d => d.FullName); return(View(doctors)); }
public IEnumerable <StatsDoctor> GetAllEager() { IEnumerable <StatsDoctor> allStats = GetAll(); IEnumerable <Doctor> doctors = _doctorRepository.GetAll(); BindStatisticsWithDoctors(allStats, doctors); return(allStats); }
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)); }
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); }
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)); }
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)); }
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); }); }
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()); }
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; } }
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)); }
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); }
// 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)); }
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(); } }
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)); }
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); } }
public IEnumerable <DoctorViewModel> GetAll() { return(_doctorRepository.GetAll().ProjectTo <DoctorViewModel>()); }
public List <Doctor> GetAll() { return(_doctorRepository.GetAll()); }
public IActionResult Index() { return(View(db.GetAll())); }
public async Task <IActionResult> GetList() { return(Ok(await doctorRepository.GetAll())); }
public override List <DoctorUser> GetAll() { return(_doctorRepository.GetAll()); }
public IEnumerable <Doctor> GetAll() => _doctorRepository.GetAll();
// GET: api/Doctor public HttpResponseMessage GetAll() { var result = _doctorRepo.GetAll().ToList(); return(Request.CreateResponse(HttpStatusCode.Accepted, result)); }