Exemple #1
0
        public ActionResult Doctors(int hospitalId)
        {
            var model = new DoctorsViewModel
            {
                Hospital = _hospitalRepo.Get(hospitalId),
                Doctors  = _doctorRepo.GetDoctors().Where(d => d.HospitalID == hospitalId).ToList()
            };

            return(View(model));
        }
        public IEnumerable <PeriodPerformanceInfo> GetPeriodPerformanceReport()
        {
            var hospitals   = _hospitalRepository.Get().ToArray();
            var hospitalIds = hospitals.Select(hospital => hospital.Id);

            var allCompletedEvents = _completedEventRepository
                                     .Get(completedEvent =>
                                          hospitalIds.Contains(completedEvent.Clinician.Hospital.Id) &&
                                          completedEvent.Period.ShouldCountForBreaches,
                                          null, null,
                                          completedEvent => completedEvent.Period.CompletedEvents.Select(e => e.Name),
                                          completedEvent => completedEvent.Clinician.Hospital)
                                     .ToList();

            return(from hospitalId in hospitalIds
                   let completedEventsForHospital = allCompletedEvents
                                                    .Where(completedEventForHospital => completedEventForHospital.Clinician.Hospital.Id == hospitalId)
                                                    .ToList()
                                                    let periodBreachesCounter = _periodBreachesCounterReportService
                                                                                .GetPeriodBreachesCounterInfo(completedEventsForHospital, hospitals.Single(hospital => hospital.Id == hospitalId).Name, hospitalId.ToString(CultureInfo.InvariantCulture))
                                                                                where periodBreachesCounter != null
                                                                                select periodBreachesCounter);
        }
 public virtual IEnumerable <HospitalInfo> GetHospitals()
 {
     return(_hospitalRepository.Get(hospital => true).Select(hospital => _hospitalToHospitalInfoMapper.Map(hospital)));
 }
Exemple #4
0
 public Hospital Get(int id)
 {
     return(_hospitalRepository.Get(id));
 }
Exemple #5
0
 public async Task <IEnumerable <Hospital> > Get() => await _repository.Get();