public EditPatientView(CombinedPatientViewModel originalModel,
                        CombinedPatientViewModel patientModel,
                        PatientService patientService,
                        PersonService personService,
                        WardService wardService,
                        BedService bedService,
                        VisitService visitService,
                        TreatmentService treatmentService,
                        ProcedureService procedureService,
                        PhysicianService physicianService,
                        DiagnosisService diagnosisService,
                        ConditionService conditionService,
                        VitalRecordService vitalRecordService,
                        EmployeeService nurseService,
                        OrderServiceLayer orderServiceLayer,
                        OrderServiceService orderServiceService,
                        PatientOrderService patientOrderService,
                        OrderItemService orderItemService)
 {
     InitializeComponent();
     InfoTab.Content = new PatientInfoView(originalModel, patientModel, patientService, personService, wardService,
                                           bedService, visitService);
     TreatmentTab.Content = new TreatmentView(treatmentService, originalModel.PatientModel.PersonId, procedureService, physicianService);
     DiagnosisTab.Content = new DiagnosisView(diagnosisService, originalModel.PatientModel.PersonId,
                                              conditionService, physicianService);
     VitalRecordTab.Content =
         new VitalRecordView(vitalRecordService, originalModel.PatientModel.PersonId, nurseService);
     OrderTab.Content = new OrderView(orderServiceLayer, originalModel.PatientModel.PersonId, orderServiceService,
                                      physicianService);
     PatientOrderTab.Content = new PatientOrderView(patientOrderService, originalModel.PatientModel.PersonId, orderItemService);
 }
 public AddPatientView(PatientListViewModel patientListViewModel,
                       PatientService patientService,
                       DiagnosisService diagnosisService,
                       PersonService personService,
                       EmployeeService employeeService,
                       WardService wardService,
                       BedService bedService,
                       PhysicianService physicianService,
                       VitalRecordService vitalRecordService,
                       ConditionService conditionService)
 {
     _toAddPatient = new AddPatientViewModel(patientListViewModel,
                                             patientService,
                                             personService,
                                             diagnosisService,
                                             physicianService,
                                             employeeService,
                                             wardService,
                                             bedService,
                                             vitalRecordService,
                                             conditionService);
     DataContext = _toAddPatient;
     InitializeComponent();
     InsuranceCheckBox.IsChecked = true;
 }
        public void AddBedTest()
        {
            var serv = new BedService(new MVCHContext());

            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000001"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "2",
                WorkUnitId = "WKS-000001"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000002"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000003"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000004"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000005"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000006"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000007"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000008"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000009"
            });
            serv.AddBed(new Bed
            {
                RoomNumber = "1",
                WorkUnitId = "WKS-000010"
            });
        }
示例#4
0
        public async Task GetBedById_Failed_Id_InValid()
        {
            //arrange
            var Bed = PrepareBeds().First();

            BedRepoMock.Setup(p => p.GetByIdAsync(It.IsAny <int>())).ReturnsAsync(Bed);

            //act
            var service = new BedService(RepoHelperMock.Object, MapperMock.Object);
            var result  = await service.GetBedById(0);

            //Assert
            Assert.IsFalse(result.IsSuccess);
        }
示例#5
0
        public async Task GetBedByOutletTest()
        {
            //arrange
            var listBeds = PrepareBeds();

            BedRepoMock.Setup(p => p.GetBedIncludeRoomByOutletID(It.IsAny <int>())).ReturnsAsync(listBeds);

            //act
            var service = new BedService(RepoHelperMock.Object, MapperMock.Object);
            var result  = await service.GetBedByOutlet(1);

            //Assert
            Assert.IsTrue(result.IsSuccess);
        }
示例#6
0
        public AddPatientViewModel(PatientListViewModel patientListViewModel,
                                   PatientService patientService,
                                   PersonService personService,
                                   DiagnosisService diagnosisService,
                                   PhysicianService physicianService,
                                   EmployeeService employeeService,
                                   WardService wardService,
                                   BedService bedService,
                                   VitalRecordService vitalRecordService,
                                   ConditionService conditionService)
        {
            _patientListViewModel = patientListViewModel;
            _patientService       = patientService;
            _personService        = personService;
            _diagnosisService     = diagnosisService;
            _physicianService     = physicianService;
            _employeeService      = employeeService;
            _wardService          = wardService;
            _bedService           = bedService;
            _vitalRecordService   = vitalRecordService;
            _conditionService     = conditionService;

            ContactPersons = new ObservableCollection <Person>(_personService.GetPersons()
                                                               .Where(c => c.Discriminator == "Person"));

            SubscriberPersons = new ObservableCollection <Person>(_personService.GetPersons()
                                                                  .Where(c => c.Discriminator == "Person"));

            Nurses = new ObservableCollection <Nurse>(_employeeService.GetNurses());

            Physicians = new ObservableCollection <Physician>(_physicianService.GetPhysicians());

            Wards = new ObservableCollection <Ward>(_wardService.GetWards()
                                                    .Include(c => c.FacilityLink));

            Beds = new ObservableCollection <Bed>(_bedService.GetBeds()
                                                  .Include(c => c.WorkUnitLink));

            Conditions                   = new ObservableCollection <Condition>(_conditionService.GetConditions());
            PatientModel.BirthDate       = DateTime.Now;
            PatientModel.DateOfContact   = DateTime.Now;
            InpatientModel.DateAdmitted  = DateTime.Now;
            InpatientModel.DischargeDate = DateTime.Now;
        }
示例#7
0
 public PatientInfoView(CombinedPatientViewModel originalModel,
                        CombinedPatientViewModel editPatient,
                        PatientService patientService,
                        PersonService personService,
                        WardService wardService,
                        BedService bedService,
                        VisitService visitService)
 {
     InitializeComponent();
     _originalModel  = originalModel;
     _editPatient    = editPatient;
     _patientService = patientService;
     _personService  = personService;
     _wardService    = wardService;
     _bedService     = bedService;
     _visitService   = visitService;
     _toEditPatient  = new EditPatientViewModel(_originalModel, _editPatient, _patientService, _personService, _wardService, _bedService, _visitService);
     DataContext     = _toEditPatient;
     MakeAllEditableFieldsReadOnly();
     SetupWindow();
 }
示例#8
0
 public PatientView()
 {
     _patientService       = new PatientService(new MVCHContext());
     _patientListViewModel = new PatientListViewModel(_patientService);
     _diagnosisService     = new DiagnosisService(new MVCHContext());
     _personService        = new PersonService(new MVCHContext());
     _employeeService      = new EmployeeService(new MVCHContext());
     _wardService          = new WardService(new MVCHContext());
     _bedService           = new BedService(new MVCHContext());
     _physicianService     = new PhysicianService(new MVCHContext());
     _vitalRecordService   = new VitalRecordService(new MVCHContext());
     _conditionService     = new ConditionService(new MVCHContext());
     _visitService         = new VisitService(new MVCHContext());
     _treatmentService     = new TreatmentService(new MVCHContext());
     _procedureService     = new ProcedureService(new MVCHContext());
     _orderServiceLayer    = new OrderServiceLayer(new MVCHContext());
     _orderServiceService  = new OrderServiceService(new MVCHContext());
     _patientOrderService  = new PatientOrderService(new MVCHContext());
     _orderItemService     = new OrderItemService(new MVCHContext());
     DataContext           = _patientListViewModel;
     InitializeComponent();
 }
        public EditPatientViewModel(CombinedPatientViewModel originalModel,
                                    CombinedPatientViewModel duplicateModel,
                                    PatientService patientService,
                                    PersonService personService,
                                    WardService wardService,
                                    BedService bedService,
                                    VisitService visitService)
        {
            AssociatedPatientModel  = duplicateModel;
            _originalModel          = originalModel;
            OriginalPatientModel    = _originalModel.PatientModel;
            OriginalInpatientModel  = _originalModel.InpatientModel;
            OriginalOutpatientModel = _originalModel.OutpatientModel;
            _patientService         = patientService;
            _personService          = personService;
            _wardService            = wardService;
            _bedService             = bedService;
            _visitService           = visitService;
            ContactPersons          = new ObservableCollection <Person>(_personService.GetPersons()
                                                                        .Where(c => c.Discriminator == "Person").ToList());
            SubscriberPersons = new ObservableCollection <Person>(_personService.GetPersons()
                                                                  .Where(c => c.Discriminator == "Person").ToList());
            Wards = new ObservableCollection <Ward>(_wardService.GetWards()
                                                    .Include(c => c.FacilityLink));
            Beds = new ObservableCollection <Bed>(_bedService.GetBeds()
                                                  .Include(c => c.WorkUnitLink));
            if (!AssociatedPatientModel.IsOutpatient)
            {
                if (AssociatedPatientModel.InpatientModel.BedId != null)
                {
                    SelectedBed = Beds.First(c => c.BedId == AssociatedPatientModel.InpatientModel.BedId);
                    OriginalBed = SelectedBed;
                }
                if (AssociatedPatientModel.InpatientModel.ContactPersonId != null)
                {
                    SelectedContactPerson = ContactPersons.First(c =>
                                                                 c.PersonId == AssociatedPatientModel.InpatientModel.ContactPersonId);
                    OriginalContact = SelectedContactPerson;
                }
                if (AssociatedPatientModel.InpatientModel.SubscriberPersonId != null)
                {
                    SelectedSubscriber = SubscriberPersons.First(c =>
                                                                 c.PersonId == AssociatedPatientModel.InpatientModel.SubscriberPersonId);
                    OriginalSubscriber = SelectedSubscriber;
                }
                SelectedWard   = Wards.First(c => c.WardId == AssociatedPatientModel.InpatientModel.WardId);
                OriginalWard   = SelectedWard;
                PatientModel   = AssociatedPatientModel.PatientModel;
                InpatientModel = AssociatedPatientModel.InpatientModel;
            }
            else
            {
                if (AssociatedPatientModel.OutpatientModel.ContactPersonId != null)
                {
                    SelectedContactPerson = ContactPersons.First(c =>
                                                                 c.PersonId == AssociatedPatientModel.OutpatientModel.ContactPersonId);
                    OriginalContact = SelectedContactPerson;
                }

                if (AssociatedPatientModel.OutpatientModel.SubscriberPersonId != null)
                {
                    SelectedSubscriber = SubscriberPersons.First(c =>
                                                                 c.PersonId == AssociatedPatientModel.OutpatientModel.SubscriberPersonId);
                    OriginalSubscriber = SelectedSubscriber;
                }

                Visits = new ObservableCollection <Visit>(_visitService.GetVisits()
                                                          .Where(c => c.OutpatientId == AssociatedPatientModel.OutpatientModel.PersonId));
                PatientModel    = AssociatedPatientModel.PatientModel;
                OutpatientModel = AssociatedPatientModel.OutpatientModel;
            }
        }
示例#10
0
        public App()
        {
            var medicationRepository           = new MedicationRepository(new Stream <Medication>(MEDICATION_FILE));
            var diagnosisRepository            = new DiagnosisRepository(new Stream <Diagnosis>(DIAGNOSIS_FILE));
            var allergenRepository             = new AllergensRepository(new Stream <Allergens>(ALLERGEN_FILE));
            var categoryRepository             = new MedicationCategoryRepository(new Stream <MedicationCategory>(CATEGORY_FILE));
            var symptomsRepository             = new SymptomsRepository(new Stream <Symptoms>(SYMPTOMS_FILE));
            var ingredientsRepository          = new MedicationIngredientRepository(new Stream <MedicationIngredient>(INGREDIENTS_FILE));
            var specializationRepository       = new SpecializationRepository(new Stream <Specialization>(SPECIALIZATION_FILE));
            var cityRepository                 = new CityRepository(new Stream <City>(CITY_FILE));
            var addressRepository              = new AddressRepository(new Stream <Address>(ADDRESS_FILE), cityRepository);
            var stateRepository                = new StateRepository(new Stream <State>(STATE_FILE));
            var hospitalRepository             = new HospitalRepository(new Stream <Hospital>(HOSPITAL_FILE));
            var departmentRepository           = new DepartmentRepository(hospitalRepository, new Stream <Department>(DEPARTMENT_FILE));
            var roomRepository                 = new RoomRepository(departmentRepository, new Stream <Room>(ROOM_FILE));
            var userRepository                 = new UserRepository(new Stream <RegisteredUser>(USER_FILE), cityRepository, addressRepository, departmentRepository, roomRepository);
            var renovationRepository           = new RenovationRepository(roomRepository, new Stream <Renovation>(RENOVATION_FILE));
            var medicalRecordRepository        = new MedicalRecordRepository(new Stream <MedicalRecord>(RECORD_FILE), diagnosisRepository, medicationRepository, userRepository);
            var bedRepository                  = new BedRepository(roomRepository, medicalRecordRepository, new Stream <Bed>(BED_FILE));
            var equipmentTypeRepository        = new EquipmentTypeRepository(new Stream <EquipmentType>(EQUIPMENT_TYPE_FILE));
            var equipmentRepository            = new HospitalEquipmentRepository(new Stream <HospitalEquipment>(EQUIPMENT_FILE));
            var treatmentsRepository           = new TreatmentRepository(medicationRepository, departmentRepository, new Stream <Treatment>(TREATMENTS_FILE));
            var examinationSurgeryRepository   = new ExaminationSurgeryRepository(treatmentsRepository, medicalRecordRepository, userRepository, new Stream <ExaminationSurgery>(EXAMINATION_SURGERY_FILE));
            var emergencyRequestRepository     = new EmergencyRequestRepository(medicalRecordRepository, new Stream <EmergencyRequest>(EMERGENCY_REQUEST_FILE));
            var vaccinesRepository             = new VaccinesRepository(new Stream <Vaccines>(VACCINES_FILE));
            var notificationRepository         = new NotificationRepository(userRepository, new Stream <Notification>(NOTIFICATION_FILE));
            var articleRepository              = new ArticleRepository(userRepository, new Stream <Article>(ARTICLE_FILE));
            var questionRepository             = new QuestionRepository(userRepository, new Stream <Question>(QUESTIONS_FILE));
            var doctorReviewsRepository        = new DoctorReviewRepository(userRepository, new Stream <DoctorReview>(DOCTOR_REVIEWS_FILE));
            var feedbackRepository             = new FeedbackRepository(userRepository, new Stream <Feedback>(FEEDBACK_FILE));
            var surveyRepository               = new SurveyRepository(userRepository, new Stream <Survey>(SURVEY_FILE));
            var appointmentsRepository         = new AppointmentRepository(userRepository, medicalRecordRepository, roomRepository, new Stream <Appointment>(APPOINTMENTS_FILE));
            var workDayRepository              = new WorkDayRepository(userRepository, new Stream <WorkDay>(WORK_DAY_FILE));
            var vacationRequestRepository      = new VacationRequestRepository(userRepository, new Stream <VacationRequest>(VACATION_REQUEST_FILE));
            var reportsRepository              = new ReportRepository(new Stream <Report>(REPORTS_FILE));
            var labTestTypeRepository          = new LabTestTypeRepository(new Stream <LabTestType>(LAB_TEST_TYPE_FILE));
            var validationMedicationRepository = new ValidationMedicationRepository(new Stream <ValidationMed>(VALIDATION_FILE), userRepository, medicationRepository);

            var equipmentTypeService        = new EquipmentTypeService(equipmentTypeRepository);
            var medicationService           = new MedicationService(medicationRepository, validationMedicationRepository);
            var diagnosisService            = new DiagnosisService(diagnosisRepository);
            var allergenService             = new AllergensService(allergenRepository);
            var categoryService             = new MedicationCategoryService(categoryRepository);
            var symptomsService             = new SymptomsService(symptomsRepository);
            var ingredientsService          = new MedicationIngredientService(ingredientsRepository);
            var specializationService       = new SpecializationService(specializationRepository);
            var cityService                 = new CityService(cityRepository);
            var stateService                = new StateService(stateRepository);
            var addressService              = new AddressService(addressRepository);
            var notificationService         = new NotificationService(notificationRepository, userRepository, medicalRecordRepository);
            var validationMedicationService = new ValidationMedicationService(validationMedicationRepository, notificationService);
            var hospitalService             = new HospitalService(hospitalRepository);
            var departmentService           = new DepartmentService(departmentRepository);
            var bedService                = new BedService(bedRepository);
            var medicalRecordService      = new MedicalRecordService(medicalRecordRepository);
            var treatmentService          = new TreatmentService(treatmentsRepository, notificationService);
            var examiantionSurgeryService = new ExaminationSurgeryService(examinationSurgeryRepository);
            var emergencyRequestService   = new EmergencyRequestService(emergencyRequestRepository, notificationService);
            var vaccinesService           = new VaccinesService(vaccinesRepository);
            var articleService            = new ArticleService(articleRepository);
            var questionService           = new QuestionService(questionRepository, notificationService);
            var doctorsReviewService      = new DoctorReviewService(doctorReviewsRepository);
            var feedbackService           = new FeedbackService(feedbackRepository);
            var surveyService             = new SurveyService(surveyRepository);
            var userService               = new UserService(userRepository, medicalRecordService);
            var workDayService            = new WorkDayService(workDayRepository, MAX_HOURS_PER_WEEK);
            var appointmentService        = new AppointmentService(appointmentsRepository, workDayService, notificationService, VALID_HOURS_FOR_SCHEDULING, APPOINTMENT_LENGTH_IN_MINUTES,
                                                                   SURGERY_LENGTH_IN_MINUTES, START_WORKING_HOURS, END_WORKING_HOURS);
            var vacationRequestService      = new VacationRequestService(vacationRequestRepository, notificationService, NUMBER_OF_ALLOWED_VACAY_REQUESTS);
            var reportsService              = new ReportService(reportsRepository, treatmentsRepository, medicationRepository, examinationSurgeryRepository, roomRepository);
            var labTestTypeService          = new LabTestTypeService(labTestTypeRepository);
            var roomService                 = new RoomService(roomRepository, appointmentsRepository);
            var hospitalEquipmentService    = new HospitalEquipmentService(equipmentRepository);
            var renovationService           = new RenovationService(renovationRepository, roomService, appointmentsRepository, hospitalEquipmentService, notificationService, RENOVATION_DAYS_RESTRICTION, RENOVATION_DAYS_RESTRICTION);
            var availableAppointmentService = new AvailableAppointmentService(appointmentsRepository, workDayService, VALID_HOURS_FOR_SCHEDULING,
                                                                              APPOINTMENT_LENGTH_IN_MINUTES, SURGERY_LENGTH_IN_MINUTES, START_WORKING_HOURS, END_WORKING_HOURS);

            equipmentTypeController        = new EquipmentTypeController(equipmentTypeService);
            medicationController           = new MedicationController(medicationService);
            userController                 = new UserController(userService);
            diagnosisController            = new DiagnosisController(diagnosisService);
            symptomsController             = new SymptomsController(symptomsService);
            categoryController             = new MedicationCategoryController(categoryService);
            allergensController            = new AllergensController(allergenService);
            vaccinesController             = new VaccinesController(vaccinesService);
            labTestTypeController          = new LabTestTypeController(labTestTypeService);
            medicationIngredientController = new MedicationIngredientController(ingredientsService);
            cityController                 = new CityController(cityService);
            specializationController       = new SpecializationController(specializationService);
            addressController              = new AddressController(addressService);
            stateController                = new StateController(stateService);
            departmentController           = new DepartmentController(departmentService);
            hospitalController             = new HospitalController(hospitalService);
            roomController                 = new RoomController(roomService);
            renovationController           = new RenovationController(renovationService);
            hospitalEquipmentController    = new HospitalEquipmentController(hospitalEquipmentService);
            medicalRecordController        = new MedicalRecordController(medicalRecordService);
            treatmentController            = new TreatmentController(treatmentService);
            examinationSurgeryController   = new ExaminationSurgeryController(examiantionSurgeryService);
            articleController              = new ArticleController(articleService);
            questionController             = new QuestionController(questionService);
            doctorReviewController         = new DoctorReviewController(doctorsReviewService);
            surveyController               = new SurveyController(surveyService);
            feedbackController             = new FeedbackController(feedbackService);
            workDayController              = new WorkDayController(workDayService);
            reportController               = new ReportController(reportsService);
            validationMedicationController = new ValidationMedicationController(validationMedicationService);
            vacationRequestController      = new VacationRequestController(vacationRequestService);
            bedController = new BedController(bedService);
            emergencyRequestController     = new EmergencyRequestController(emergencyRequestService);
            appointmentController          = new AppointmentController(appointmentService);
            notificationController         = new NotificationController(notificationService);
            availableAppointmentController = new AvailableAppointmentController(availableAppointmentService);

            validations = new Validations(UNDERAGE_RESTRICTION);
        }
 public BedController(BedService bedService)
 {
     this.bedService = bedService;
 }