public AddStaffViewModel(StaffListViewModel staffListViewModel,
                                 EmployeeService employeeService,
                                 WardService wardService,
                                 WorkUnitService workUnitService,
                                 SpecialtyService specialtyService,
                                 JobClassService jobClassService,
                                 EmployeeSpecialtyService employeeSpecialtyService,
                                 WardEmployeeService wardEmployeeService,
                                 UnitEmployeeService unitEmployeeService)
        {
            _staffListViewModel       = staffListViewModel;
            _employeeService          = employeeService;
            _wardService              = wardService;
            _workUnitService          = workUnitService;
            _employeeSpecialtyService = employeeSpecialtyService;
            _specialtyService         = specialtyService;
            _wardEmployeeService      = wardEmployeeService;
            _unitEmployeeService      = unitEmployeeService;
            _jobClassService          = jobClassService;

            Specialties = new ObservableCollection <Specialty>(_specialtyService.GetSpecialties());
            Wards       = new ObservableCollection <Ward>(_wardService.GetWards());
            JobClasses  = new ObservableCollection <JobClass>(_jobClassService.GetJobClasses());
            WorkUnits   = new ObservableCollection <WorkUnit>(_workUnitService.GetWorkUnits());
        }
        public WardListViewModel(WardService wardService)
        {
            _wardService = wardService;

            WardList = new ObservableCollection <WardViewModel>(_wardService
                                                                .GetWards()
                                                                .Select(c => new WardViewModel(c)));
        }
예제 #3
0
        public async Task <IHttpActionResult> GetWards()
        {
            var ward = await WardService.GetWards();

            if (ward.Count > 0)
            {
                return(Ok(ward));
            }
            else
            {
                return(BadRequest("No Wards Found!"));
            }
        }
예제 #4
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;
        }
예제 #5
0
 public AddTechnicianViewModel(TechnicianListViewModel technicianListViewModel,
                               EmployeeService employeeService,
                               WardService wardService,
                               WorkUnitService workUnitService,
                               SpecialtyService specialtyService,
                               EmployeeSpecialtyService employeeSpecialtyService,
                               WardEmployeeService wardEmployeeService,
                               UnitEmployeeService unitEmployeeService)
 {
     _technicianListViewModel  = technicianListViewModel;
     _employeeService          = employeeService;
     _wardService              = wardService;
     _workUnitService          = workUnitService;
     _employeeSpecialtyService = employeeSpecialtyService;
     _specialtyService         = specialtyService;
     _wardEmployeeService      = wardEmployeeService;
     _unitEmployeeService      = unitEmployeeService;
     Specialties = new ObservableCollection <Specialty>(_specialtyService.GetSpecialties());
     Wards       = new ObservableCollection <Ward>(_wardService.GetWards());
     WorkUnits   = new ObservableCollection <WorkUnit>(_workUnitService.GetWorkUnits());
 }
        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;
            }
        }