Example #1
0
        public void to_add_a_hospital_sucessfully()
        {
            var hospital = new Hospital();

            _account.AddHospital(hospital);

            Contract.Assert(_account.Hospital == hospital);
        }
        public virtual void DoSearchPeriodicCharge(Hospital hospital)
        {
            Assertion.NotNull(hospital, "Banco não informado.").Validate();

            ClearPatient();
            Patients = GetPatientsService.GetPatientsPeriodicCharge(hospital);
            ValidateCPFPatient();
            ValidadeBirthday();
        }
        public virtual void Save(Hospital hospital)
        {
            var service = new GetPatientsService();
            var serviceLucene = new SavePatientsLuceneService(ConfigurationManager.AppSettings["PatientIndexPath"]);

            var patients = service.GetPatientsDbFor();

            serviceLucene.SavePatientsLucene(patients.ToList());
        }
        public virtual void DoSearch(Hospital hospital, IPatient patientDTO)
        {
            Assertion.NotNull(hospital, "Banco não informado.").Validate();
            Assertion.NotNull(patientDTO, "Paciente não informado.").Validate();

            ClearPatient();
            Patients = GetPatientsService.GetPatients(hospital, patientDTO);
            ValidateCPFPatient();
            ValidadeBirthday();
        }
        public virtual IList<ITreatment> GetTreatments(Hospital hospital)
        {
            ClearPatient();

            TreatmentRepository = new TreatmentRepository(FactorryNhibernate.GetSession(hospital.Database));

            var treatment = TreatmentRepository.GetAll();
            TreatmentConverter(treatment, hospital);

            return Treatments;
        }
        public virtual IList<IPatient> GetPatients(Hospital hospital, IPatient patient)
        {
            ClearPatient();

            using (var repository = new PatientDTORepository(FactorryNhibernate.GetSession(hospital.Database)))
            {
                var patients = repository.GetPatientsBy(patient);
                PatientConverter(patients, hospital);
            }

            return PatientsDTO;
        }
Example #7
0
 public virtual IList<IPatient> Todos(IPatient patient, Hospital hospital)
 {
     IList<IPatient> patients = new List<IPatient>();
     using (IObjectServer server = Db4oClientServer.OpenServer("E://Projetos//EHR//PatientsHospital", 0))
     {
         using (IObjectContainer db = server.OpenClient())
         {
             var iobject = db.Query<IPatient>(p => p.Name.Contains(patient.Name) && p.Hospital == hospital);
             patients = iobject.Cast<IPatient>().ToList();
         }
     }
     return patients;
 }
        private void TreatmentConverter(IList<EHRIntegracao.Domain.Domain.Treatment> treatment, Hospital hospital)
        {
            foreach (var t in treatment)
            {
                if (t == null)
                    continue;
                var tratmentDto = new Treatment()
                {
                    Id = t.Id,
                    CheckOutDate = t.CheckOutDate,
                    EntryDate = t.EntryDate,
                    Hospital = hospital
                };

                Treatments.Add(tratmentDto);
            }
        }
Example #9
0
        private Account CreateAccount(string firstName, string lastName, GenderEnum gender, ProfessionalRegistrationTypeEnum professionalResgistrationType,
            string professionalResgistrationNumber, string email, string password, DateTime birthday, Hospital hospital)
        {
            var professionalResgistration = new ProfessionalRegistration
                                                {
                                                    Number = professionalResgistrationNumber,
                                                    State = hospital.State,
                                                    Type = professionalResgistrationType
                                                };

            var account = new Account(false);
            account.ToApprove(false);
            account.ToRefuse(false);
            account.AddProfessionalRegistration(professionalResgistration);
            account.ToEnterFirstName(firstName);
            account.ToEnterLastName(lastName);
            account.ToEnterGender(gender);
            account.ToEnterEmail(email);
            account.ToEnterPassword(password);
            account.ToEnterBirthday(birthday);

            account.AddHospital(hospital);

            return account;
        }
 private void DoSearchPatients(IPatient patientDTO, Hospital hospital)
 {
     InitialChargeByHospitalFillPatientService.DoSearch(hospital, patientDTO);
     Patients.AddRange(initialChargeByHospitalFillPatientService.Patients);
 }
 private void DoSearchPatients(Hospital hospital)
 {
     InitialChargeByHospitalFillPatientService.DoSearchPeriodicCharge(hospital);
     Patients.AddRange(initialChargeByHospitalFillPatientService.Patients);
 }
 public void AlterFactory(Hospital hospital)
 {
     Factory = FactorryNhibernate.GetSession(hospital.Database);
     _session = null;
 }
        public virtual IList<IPatient> GetPatientsDbFor(Hospital hospital, IPatient patient)
        {
            ClearPatient();

            PatientsDTO = PatientRepositoryDbFor.Todos(patient, hospital);

            return PatientsDTO;
        }
 private void PatientConverter(IList<PatientDTO> patients, Hospital hospital)
 {
     foreach (var patient in patients)
     {
         var patientDto = new Patient
                              {
                                  Id = patient.Id,
                                  CPF =
                                      patient.Cpf == null
                                          ? null
                                          : Regex.Replace(patient.Cpf, "[^0-9]", string.Empty),
                                  DateBirthday = patient.DateBirthday,
                                  Identity = patient.Identity,
                                  Name = patient.Name,
                                  Genre = patient.Genre,
                                  Hospital = hospital,
                                  Records = new List<Record>()
                              };
         PatientsDTO.Add(patientDto);
     }
 }
 private void DoSearchTreatmentsPeriodic(Hospital hospital)
 {
     var treatment = GetTreatmentService.GetPeriodicTreatments(hospital);
     Treatments.AddRange(treatment);
 }