public DoctorViewModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;
            Messenger.Default.Register <Doctor>(this, "Doctor", doctor =>
            {
                Doctor = doctor;
                RaisePropertyChanged(nameof(Doctor));
            });
            GetPatientCommand = new RelayCommand(async() =>
            {
                ObservableCollection <Pacient> tmp = null;
                do
                {
                    tmp = await DoctorUtilities.GetPatients(Doctor);
                } while (tmp == null);

                Patients = tmp;
                RaisePropertyChanged(nameof(Patients));
            });
            AddPatient = new RelayCommand(() =>
            {
                Messenger.Default.Send <Doctor>(Doctor, "Doctor");
                _navigationService.NavigateTo("NewPatient");
                Messenger.Default.Register <Pacient>(this, "Patient", pat =>
                {
                    Patients.Add(pat);
                });
            });
            DeletePatient = new RelayCommand(() =>
            {
                Tuple <Doctor, ObservableCollection <Pacient> > tup = new Tuple <Doctor, ObservableCollection <Pacient> >(Doctor, Patients);
                Messenger.Default.Send <ObservableCollection <Pacient> >(Patients, "DoctorPatients");
            });
        }
Exemplo n.º 2
0
 void WardNode_PatientAdded(object sender, Patient e)
 {
     Patients.Add(new PatientViewModel(e)
     {
         RoomNumber = _roomNumber++
     });
 }
Exemplo n.º 3
0
        private Prescription AddPrescriptionEntities1()
        {
            var doctor = new Doctor()
            {
                //IdDoctor = 1,
                FirstName = "Arnold",
                LastName  = "Brzeczukiewicz",
                Email     = "*****@*****.**"
            };
            var patient = new Patient()
            {
                //IdPatient = 1,
                FirstName = "Larry",
                LastName  = "Brandenberg",
                BirthDate = new DateTime()
            };
            var prescription = new Prescription()
            {
                //IdPrescription = 1,
                Date    = new DateTime(),
                DueDate = new DateTime(),
                Doctor  = doctor,
                Patient = patient
            };

            Patients.Add(patient);
            Doctors.Add(doctor);
            Prescriptions.Add(prescription);
            return(prescription);
        }
Exemplo n.º 4
0
 private void InitializeData(ActivityNode controller)
 {
     foreach (var pat in controller.Users.Values.OfType <Patient>())
     {
         Patients.Add(pat);
     }
 }
        /// <summary>
        /// Adds the selected admission data to the IMS.
        /// </summary>
        /// <param name="admissionObj"></param>
        /// <returns></returns>
        public async Task <AdmittedPatient> AddAdmissionToImsAsync(object admissionObj)
        {
            Admission admission = admissionObj as Admission;

            IsLoading = true;

            try
            {
                AdmittedPatient patient = Patients.First(ap => ap.Admission.ID == admission.ID);
                IsLoading = false;
                return(patient);
            }
            catch (InvalidOperationException)
            {
                try
                {
                    var admittedPatient = await imsSvc.AddAdmissionDataAsync(admission);

                    Patients.Add(admittedPatient);
                    IsLoading = false;
                    return(admittedPatient);
                }
                catch (Exception)
                {
                    IsLoading = false;
                    throw;
                }
            }
        }
Exemplo n.º 6
0
        private Prescription AddPrescriptionEntities2()
        {
            var doctor = new Doctor()
            {
                //IdDoctor = 2,
                FirstName = "Ferdynand",
                LastName  = "Roche",
                Email     = "*****@*****.**"
            };
            var patient = new Patient()
            {
                //IdPatient = 2,
                FirstName = "Lawrenze",
                LastName  = "Muller",
                BirthDate = new DateTime()
            };
            var prescription = new Prescription()
            {
                //IdPrescription = 1,
                Date    = new DateTime(),
                DueDate = new DateTime(),
                Doctor  = doctor,
                Patient = patient
            };

            Patients.Add(patient);
            Doctors.Add(doctor);
            Prescriptions.Add(prescription);
            return(prescription);
        }
Exemplo n.º 7
0
        async Task ExecuteLoadPatientsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Patients.Clear();
                var patients = await DataStore.GetPatientsAsync(true);

                foreach (var patient in patients)
                {
                    Patients.Add(patient);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 8
0
        protected override async Task ExecuteLoadItems()
        {
            if (IsBusy)
            {
                return;
            }

            await HandleAPICall(async() =>
            {
                IsBusy = true;

                var items = await _inpatientBookingService.GetMyPatients(User.NurseId, User.ClinicianId, _settingsService.AuthAccessToken);
                await Task.Delay(500);

                if (items != null)
                {
                    Patients.Clear();

                    foreach (var item in items)
                    {
                        Patients.Add(item);
                    }
                }
            });

            IsBusy = false;
        }
Exemplo n.º 9
0
        private void SetPatients()
        {
            var p = new Patient
            {
                Id                = 1,
                Birthdate         = DateTime.Parse("23.03.1984"),
                CardNumber        = "2345",
                FirstName         = "Ирина",
                LastName          = "Мухина",
                MiddleName        = "Анатольевна",
                PassportDepCode   = "880-013",
                PassportIssueDate = DateTime.Parse("11.12.1995"),
                PassportNumber    = "832986",
                PassportSeries    = "44-17",
                PassportUFMS      = "ТП №13 отдела УФМС России",
                RegistrationDate  = DateTime.Parse("13.05.2005"),
                Residence         = "ул. Соборная, дом 29б, кв.23",
                Sex               = "Женский"
            };

            Patients.Add(p);

            p = new Patient
            {
                Id                = 2,
                Birthdate         = DateTime.Parse("01.08.1982"),
                CardNumber        = "2376",
                FirstName         = "Кирилл",
                LastName          = "Петров",
                MiddleName        = "Геннадьевич",
                PassportDepCode   = "280-002",
                PassportIssueDate = DateTime.Parse("10.01.1993"),
                PassportNumber    = "324655",
                PassportSeries    = "39-13",
                PassportUFMS      = "ТП №24 отдела УФМС России",
                RegistrationDate  = DateTime.Parse("10.07.2001"),
                Residence         = "ул. Морская, дом 15, корп. 2, кв.23",
                Sex               = "Мужской"
            };
            Patients.Add(p);

            p = new Patient
            {
                Id                = 3,
                Birthdate         = DateTime.Parse("13.11.1989"),
                CardNumber        = "3456",
                FirstName         = "Станислав",
                LastName          = "Кузнецов",
                MiddleName        = "Иванович",
                PassportDepCode   = "110-001",
                PassportIssueDate = DateTime.Parse("11.12.1997"),
                PassportNumber    = "567231",
                PassportSeries    = "24-15",
                PassportUFMS      = "ТП №10 отдела УФМС России",
                RegistrationDate  = DateTime.Parse("03.05.2002"),
                Residence         = "ул. Лукьянова, дом 45, кв.123",
                Sex               = "Мужской"
            };
            Patients.Add(p);
        }
Exemplo n.º 10
0
 public void CancelSearch()
 {
     Patients.Clear();
     foreach (var item in refferenceList)
     {
         Patients.Add(item);
     }
 }
Exemplo n.º 11
0
 public static int InsertPatient(Patient patient)
 {
     if (patient.Id == 0)
     {
         patient.Id = GetNewPatientId();
         Patients.Add(patient);
     }
     return(patient.Id);
 }
Exemplo n.º 12
0
        public static void InitializePatients()
        {
            List <Patient> patientList = HospitalDB.FetchPatients();

            foreach (Patient patient in patientList)
            {
                // Assigning Patient's Doctors
                List <String> doctorsIDs = HospitalDB.FetchPatientDoctors(patient.ID);
                foreach (String doctorID in doctorsIDs)
                {
                    patient.assignDoctor((Doctor)Employees[doctorID]);
                    ((Doctor)Employees[doctorID]).addPatient(patient);
                }

                if (patient.GetType() == typeof(ResidentPatient))
                {
                    // Fetching Patient's Department
                    String departmentID = HospitalDB.FetchPersonDepartment(patient.ID);
                    if (Departments.ContainsKey(departmentID))
                    {
                        ((ResidentPatient)patient).Department = Departments[departmentID];
                        Departments[departmentID].Patients.Add(patient.ID, patient);
                    }

                    // Fetching Patient's Room from Database
                    String roomID = HospitalDB.FetchPatientRoom(patient.ID);

                    if (Rooms.ContainsKey(roomID))
                    {
                        Rooms[roomID].addPatient(patient);
                        ((ResidentPatient)patient).Room = Rooms[roomID];

                        // Assigning Patients to Nurses in the Same Room
                        foreach (Nurse nurse in Rooms[roomID].Nurses.Values)
                        {
                            nurse.addPatient(patient);
                        }
                    }


                    // Fetching Patient's Medicine from Database
                    List <Medicine> medicineList = HospitalDB.FetchMedicine(patient.ID);
                    foreach (Medicine medicine in medicineList)
                    {
                        ((ResidentPatient)patient).addMedicine(new Medicine
                        {
                            ID           = medicine.ID,
                            Name         = medicine.Name,
                            StartingDate = medicine.StartingDate,
                            EndingDate   = medicine.EndingDate
                        });
                    }
                }

                Patients.Add(patient.ID, patient);
            }
        }
        public void PopulatePatients()
        {
            foreach (var patient in patientService.GetPatients())
            {
                Patients.Add(patient);
            }

            initialPatientsCount = patients.Count;
        }
Exemplo n.º 14
0
        //Method to displayAllPatients
        public void DisplayAllPatients()
        {
            var allPatients = PatientDB.GetAllPatients();

            foreach (var item in allPatients)
            {
                Patients.Add(item);
            }
        }
Exemplo n.º 15
0
 public void Search(string value)
 {
     Patients.Clear();
     foreach (var item in refferenceList.Where(v => v.LastName.ToLower().Contains(value.ToLower()) ||
                                               v.FirstName.ToLower().Contains(value.ToLower()) ||
                                               v.HomeAddress.ToLower().Contains(value.ToLower())))
     {
         Patients.Add(item);
     }
 }
Exemplo n.º 16
0
        //Method to call the searchpatient instance from the PatientDB.
        //This method will be attached to the button 'Search' command.
        private void SearchPatient()
        {
            Patients.Clear();
            var search = PatientDB.SearchPatient(SearchInput);

            foreach (var item in search)
            {
                Patients.Add(item);
            }
        }
Exemplo n.º 17
0
        public async Task <IActionResult> Create([Bind("ConcentrationCode")] ConcentrationUnit concentrationUnit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(concentrationUnit);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(concentrationUnit));
        }
        public async Task GetPatients()
        {
            Patients.Clear();
            var db       = LocalDatabase.DatabaseInstance.Database;
            var patients = await db.GetPatientContacts();

            foreach (var patient in patients)
            {
                Patients.Add(patient);
            }
        }
Exemplo n.º 19
0
        public async Task <IActionResult> Create([Bind("Id,Name")] DiagnosisCategory diagnosisCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(diagnosisCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(diagnosisCategory));
        }
Exemplo n.º 20
0
        private void AddPatient()
        {
            var window      = new PatientAddEditView();
            var dataContext = new PatientAddEditViewModel();

            window.DataContext = dataContext;
            if (window.ShowDialog() == true && dataContext.Model != null)
            {
                Patients.Add(dataContext.Model);
            }
        }
        public async Task <IActionResult> Create([Bind("MedicationTypeId,Name")] MedicationType medicationType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(medicationType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(medicationType));
        }
Exemplo n.º 22
0
        public async Task <IActionResult> Create([Bind("CountryCode,Name,PostalPattern,PhonePattern,FederalSalesTax")] Country country)
        {
            if (ModelState.IsValid)
            {
                _context.Add(country);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(country));
        }
        public async Task <IActionResult> Create([Bind("DispensingCode")] DispensingUnit dispensingUnit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dispensingUnit);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(dispensingUnit));
        }
 public void PlacePatient(Patient patient)
 {
     foreach (var room in Rooms)
     {
         if (room.IsFull == false)
         {
             room.AddPatient(patient);
             Patients.Add(patient);
             break;
         }
     }
 }
        public void AddPatient(Patient patient)
        {
            /*Adds patient */

            OccupiedBeds++;
            Patients.Add(patient);

            if (checkFull())
            {
                IsFull = true;
            }
        }
Exemplo n.º 26
0
        public virtual Patient GetPatientOrCreateByCode(Patient patient)
        {
            var pat = Patients.FirstOrDefault(p => p.PassportCode.Equals(patient.PassportCode));

            if (pat == null)
            {
                pat = Patients.Add(patient);

                this.SaveChanges();
            }

            return(pat);
        }
        private void FilterPatients()
        {
            if (string.IsNullOrEmpty(FilterText))
            {
                return;
            }

            _patients = Patients.Where(p => p.FullName.StartsWith(FilterText, true, null)).ToList();
            Patients.Clear();
            foreach (var patient in _patients)
            {
                Patients.Add(patient);
            }
        }
Exemplo n.º 28
0
        void node_UserAdded(object sender, UserEventArgs e)
        {
            Application.Current.Dispatcher.Invoke(() =>
            {
                var patient = e.User as Patient;

                if (patient != null)
                {
                    Patients.Add(patient);

                    OnPatientAdded(patient);
                }
            });
        }
Exemplo n.º 29
0
        void IDoctor.TakePatient(Patient patient)
        {
            Patients.Add(patient);

            string query = "INSERT OR REPLACE INTO Doctor_Patient (doctor_id, patient_id) VALUES (@docId, @patId)";

            Dictionary <string, object> parameters = new Dictionary <string, object>
            {
                { "docId", Id },
                { "patId", patient.Id }
            };

            DBConnector.queryExecuteSingleResult(query, parameters);
        }
Exemplo n.º 30
0
        public void DisplayList1()
        {
            List <Patient> patients = patientManager.DisplayPatientList();

            foreach (var item in patients)
            {
                Patients.Add(item);
            }

            if (patients.Count < 1)
            {
                MessageBox.Show("No Patient record exists !");
            }
        }