public IList<IPatient> GetAll(IPatient patient)
        {
            Assertion.NotNull(patient, "Paticiente não informado.").Validate();

            if (patient.Hospital != null)
            {
                var patients = GetPatientsService.GetPatients(patient.Hospital, patient);
                return patients;
            }

            var repository = new Hospitals();
            var hospitals = repository.All<Hospital>();

            foreach (var item in hospitals)
            {
                var hospital = item;
                if (item.Key.Equals("Sumario"))
                    continue;

                //TODO Acessar query com filtro de 6 dias de Range.
                var patients = GetPatientsService.GetPatients(hospital, patient);

                if (patients != null)
                    Patients.ToList().AddRange(patients);
            }

            return Patients;
        }
示例#2
0
 public void a_Verify_if_get_all_hospitals_return_object()
 {
     var repository = new Hospitals();
     var hospitals = repository.All<Hospital>();
     Assert.IsNotNull(hospitals, "Lista de hospitais nula");
 }
示例#3
0
 public void b_Verify_if_get_all_hospitals_return_itens()
 {
     var repository = new Hospitals();
     var hospitals = repository.All<Hospital>();
     Assert.Greater(hospitals.Count, 0, "Lista de hospitais vazia");
 }
 public virtual IList<Hospital> GetValues()
 {
     var repository = new Hospitals();
     return repository.All<Hospital>();
 }