Exemplo n.º 1
0
        public Patients()
        {
            MaterialControls control = new MaterialControls();

            BindingContext = new PatientsViewModel();
            InitializeComponent();
        }
        public PatientsPage()
        {
            //var vm = new PatientsViewModel();
            //this.BindingContext = vm;
            InitializeComponent();
            BindingContext = _viewModel = new PatientsViewModel();
            _viewModel.DisplayClientAlreadyRegisteredPrompt += () => DisplayAlert("Error", "The Patient is Aready Registered", "OK");
            _viewModel.DisplayRegistrationSuccessPrompt     += () => DisplayAlert("Success", "The Patient has been registered successfully", "OK");
            _viewModel.DisplayRegistrationFailedPrompt      += () => DisplayAlert("Error", "User registration failed, Please try again", "OK");
            _viewModel.DisplayRequiredFieldPrompt           += () => DisplayAlert("Error", "OPD Number, First Name, Last Name and Village Fields are required", "OK");
            _viewModel.activity = activity;

            Opdnumber.Completed += (object sender, EventArgs e) =>
            {
                Firstname.Focus();
            };

            Firstname.Completed += (object sender, EventArgs e) =>
            {
                Lastname.Focus();
            };
            Housenumber.Completed += (object sender, EventArgs e) =>
            {
                Village.Focus();
            };
            Village.Completed += (object sender, EventArgs e) =>
            {
                Phonenumber.Focus();
            };
            Phonenumber.Completed += (object sender, EventArgs e) =>
            {
                _viewModel.SubmitCommand.Execute(null);
            };
        }
 public void ShowSearchResult(PatientsViewModel patients)
 {
     foreach (PatientViewModel patient in patients.Patients)
     {
         AddPatientToGrid(patient);
     }
 }
Exemplo n.º 4
0
        public async Task <IActionResult> AllPatients()
        {
            if (TempData["message"] != null)
            {
                ModelState.AddModelError("info", _localizer[TempData["message"].ToString()]);
            }
            try
            {
                var model = new PatientsViewModel();
                model.Patients = await _cacheService.GetPatientsAsync();

                if (model.Patients == null)
                {
                    model.Patients = await _client.SendRequestAsync <List <Patient> >(HttpMethod.Get, "Patients");

                    _cacheService.SetPatientsAsync(model.Patients);
                }

                return(View(model));
            }
            catch (HttpRequestException)
            {
                throw new ServerConnectionException();
            }
        }
Exemplo n.º 5
0
        public async Task OnGetAsync(int?pageIndex)
        {
            var tmp = await _context.Patient.Include(u => u.User).Include(p => p.Picture).AsNoTracking().ToListAsync();

            var patList = new List <PatientsViewModel>();

            foreach (var item in tmp)
            {
                var temp = new PatientsViewModel
                {
                    Id        = item.Id,
                    FirstName = item.User.FirstName,
                    LastName  = item.User.LastName,
                    Phone     = item.User.PhoneNumber,
                    Email     = item.User.Email,
                };

                if (item.Picture.ImageData != null)
                {
                    temp.Base64 = Convert.ToBase64String(item.Picture.ImageData);
                }
                patList.Add(temp);
            }
            int pageSize = 4;

            patients = PaginatedList <PatientsViewModel> .CreateAsync(patList, pageIndex ?? 1, pageSize);
        }
Exemplo n.º 6
0
        public MainViewModel()
        {
            DoctorsVM     = new DoctorsViewModel();
            SpecialtyesVM = new SpecialtyesViewModel();
            PatientsVM    = new PatientsViewModel();
            ReceptionsVM  = new ReceptionsViewModel();

            CurrentView = ReceptionsVM;

            DoctorsViewCommand = new RelayCommand(o =>
            {
                CurrentView = DoctorsVM;
            });

            SpecialtyesViewCommand = new RelayCommand(o =>
            {
                CurrentView = SpecialtyesVM;
            });

            PatientsViewCommand = new RelayCommand(o =>
            {
                CurrentView = PatientsVM;
            });

            ReceptionsViewCommand = new RelayCommand(o =>
            {
                CurrentView = ReceptionsVM;
            });
        }
Exemplo n.º 7
0
        public IActionResult DokterDashboard()
        {
            List <Patient>    patients = new List <Patient>();
            PatientsViewModel model    = new PatientsViewModel(patients);

            return(View(model));
        }
Exemplo n.º 8
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            patientRepository = new PatientRepository(data);
            var viewModel = new PatientsViewModel(patientRepository);

            patientRepository.EventAddElement += viewModel.UpdateViewModel;
            DataContext = viewModel;
        }
Exemplo n.º 9
0
        public PatientsPage()
        {
            InitializeComponent();

            _patientsViewModel            = new PatientsViewModel();
            Patients_DataGrid.ItemsSource = _patientsViewModel.Patients;
            _patientsViewModel.UpdatePatientsAsync().ConfigureAwait(false);
        }
Exemplo n.º 10
0
        ////Id v.d. patiënt, wordt uiteindelijk meegegeven vanuit een andere view.
        //string idP = "27f36d8b-6661-4a99-954f-b8c1522852f8";

        public ActionResult Dashboard()
        {
            List <Patient>    patients = new List <Patient>();
            PatientsViewModel model    = new PatientsViewModel(patients);

            model.DoctorId = idD;
            return(View(model));
        }
        public IActionResult Index()
        {
            var model = new PatientsViewModel()
            {
                Patients            = _patientClient.GetPatients(),
                AddPatientViewModel = new AddPatientViewModel()
            };

            return(View(model));
        }
Exemplo n.º 12
0
        public ActionResult Index()
        {
            var patients = _patientRepository.Patients.ToList();
            var model    = new PatientsViewModel()
            {
                AllPatients = patients
            };

            return(View(model));
        }
Exemplo n.º 13
0
        //Delete
        private void ExecuteDeletePatientsCommand()
        {
            MessageBoxResult res = MessageBox.Show("Are you sure want to delete?", "Confirmation!",
                                                   MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (res == MessageBoxResult.Yes)
            {
                _dataService.DeletePatient(Selected);
                PatientsViewModel.UpdatePatients();
            }
        }
        private void OnButtonArchived(object sender, EventArgs e)
        {
            lblFiled.FontAttributes  = FontAttributes.Bold;
            lblAll.FontAttributes    = FontAttributes.None;
            lblActive.FontAttributes = FontAttributes.None;

            LineAll.IsVisible    = false;
            LineActive.IsVisible = false;
            LineFiled.IsVisible  = true;

            BindingContext = new PatientsViewModel("Arquivados");
        }
Exemplo n.º 15
0
        public ActionResult Create(PatientsViewModel model, string redirectUrl)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var patient = model.Map <Patients>();

            Patient.Create(patient);

            return(RedirectToLocal(redirectUrl));
        }
Exemplo n.º 16
0
        public ActionResult Edit(PatientsViewModel model, string redirectUrl)
        {
            var patient = Patient.GetById(model.PatientsId);

            if (patient != null)
            {
                Mapper.Map(model, patient);
                Patient.Update(patient);
            }

            return(RedirectToLocal(redirectUrl));
        }
Exemplo n.º 17
0
        public PatientsPage()
        {
            InitializeComponent();
            NavigationCacheMode = NavigationCacheMode.Enabled;

            navigationHelper            = new NavigationHelper(this);
            navigationHelper.LoadState += NavigationHelper_LoadState;
            navigationHelper.SaveState += NavigationHelper_SaveState;

            VM             = DataContext as PatientsViewModel;
            VM.ApiSettings = App.ApiSettings;
        }
Exemplo n.º 18
0
        public PatientsPage()
        {
            var TheViewModel = new PatientsViewModel();

            BindingContext = TheViewModel;

            InitializeComponent();
            var task = Task.Run(async() => await _dataServices.GetGenders().ConfigureAwait(false));

            _Genders = task.Result;
            var task2 = Task.Run(async() => await _dataServices.GetBloodGroup().ConfigureAwait(false));

            _BloodGroups = task2.Result;
        }
        public PatientsPage()
        {
            var TheViewModel = new PatientsViewModel();

            BindingContext = TheViewModel;

            //BloodGroupsListView.ItemsSource = TheViewModel._patientsList.ToList();

            InitializeComponent();
            //var task = Task.Run(async () => await _dataServices.GetGenders().ConfigureAwait(false));
            //var task2 = Task.Run(async () => await _dataServices.GetBloodGroup().ConfigureAwait(false));


            //_Genders = TheViewModel._GendersList;
            //_BloodGroups = TheViewModel._BloodGroupsList;
        }
Exemplo n.º 20
0
        public PatientsPage()
        {
            try
            {
                ViewModel = Resolver.Resolve <PatientsViewModel>();
            }
            catch (Exception ex)
            {
                throw ex;
            }


            BindingContext = ViewModel;

            InitializeComponent();
        }
Exemplo n.º 21
0
        public ActionResult Patients()
        {
            var usertable = new UserTable <AppMember>(Context);
            var patients  = usertable.GetUserByRole("Patient")
                            .Select(p => new PatientViewModel {
                Name              = toUpperCase(p.UserName), DateBirth = p.DateBirth,
                Address           = p.Address, Email = p.Email.ToLower(), PhoneNumber = p.PhoneNumber, Id = p.Id,
                CommunicationType = p.CommunicationType
            });

            var patientsModel = new PatientsViewModel();

            patientsModel.Patients = patients;

            return(View(patientsModel));
        }
Exemplo n.º 22
0
        public IActionResult test()
        {
            Patient           bob       = new Patient("Bob", "bobson", "10", "test");
            Patient           herman    = new Patient("herman", "hermanson", "42", "groen");
            Patient           julius    = new Patient("julius", "De vries", "42", "groen");
            Patient           Tony      = new Patient("Tony", "Zhou", "42", "groen");
            Patient           Ruud      = new Patient("Ruud", "Willems", "42", "groen");
            Patient           Julian    = new Patient("Julian", "Tekstra", "42", "groen");
            Patient           Rens      = new Patient("Rens", "van Lieshout", "42", "groen");
            Patient           Hendrieka = new Patient("Hendrieka", "Hendriks", "42", "groen");
            PatientsViewModel model     = new PatientsViewModel(new List <Patient>
            {
                bob, herman, julius, Tony, Ruud, Julian, Rens, Hendrieka
            });

            return(View(model));
        }
Exemplo n.º 23
0
        public PatientsViewModel ReadOnePatient(int _id)
        {
            PatientsEntity    _patient  = new PatientsRepository().ReadOne(_id);
            PatientsViewModel doctor_vm = new PatientsViewModel();

            doctor_vm = new PatientsViewModel
            {
                Id        = _patient.Id,
                PatientNS = _patient.Person.Name + ' ' + _patient.Person.Surname,
                DoctorNS  = _patient.Doctor.Person.Name + ' ' + _patient.Doctor.Person.Surname,
                Address   = _patient.Person.Address,
                Phone     = _patient.Person.Phone,
                Removed   = _patient.Removed
            };

            return(doctor_vm);
        }
Exemplo n.º 24
0
        public void Execute(object parameter)
        {
            // wyciągnięcie danych z tabeli - patients
            getter          = new PatientsViewModel(); //Deklarujemy zmienną typu PatientsView
            selectedPatient = getter.InfoPatientGetter();
            //SelectedIDPatient = selectedPatient[1];
            MessageBoxResult result = MessageBox.Show("Czy na pewno chcesz usunąć pacjenta " + selectedPatient[1] + " " + selectedPatient[2], "Potwierdź usunięcie użytkownika", MessageBoxButton.OKCancel, MessageBoxImage.Warning);

            switch (result)
            {
            case MessageBoxResult.OK:
                vm.Delete();
                break;

            case MessageBoxResult.Cancel:

                break;
            }
        }
Exemplo n.º 25
0
        private async Task <ActionResult> ViewPatients(CancellationToken ct)
        {
            var cache = new ResponseCache <AgeBounds>(false, DefaultCacheTime.Long, _settings.ResponseCacheEnabled,
                                                      _settings.ResponseCacheDefaultShortTimeInMinutes, _settings.ResponseCacheDefaultLongTimeInMinutes);
            var ageBounds = cache.GetValue(Request);

            if (ageBounds == null)
            {
                ageBounds = await _glanceDa.GetAgeBoundsAsync(_credentials, ct);

                cache.SetValue(Request, ageBounds);
            }

            var model = new PatientsViewModel
            {
                AgeMax = Math.Ceiling(ageBounds.Max).ToString(System.Globalization.CultureInfo.InvariantCulture),
                AgeMin = Math.Floor(ageBounds.Min).ToString(System.Globalization.CultureInfo.InvariantCulture),
            };

            return(View(model));
        }
Exemplo n.º 26
0
        private async Task <ActionResult> ViewPatients(CancellationToken ct)
        {
            var cache = new ResponseCache <AgeBounds>(false, DefaultCacheTime.Long, _settings.ResponseCacheEnabled,
                                                      _settings.ResponseCacheDefaultShortTimeInMinutes, _settings.ResponseCacheDefaultLongTimeInMinutes);
            var ageBounds = cache.GetValue(Request);

            if (ageBounds == null)
            {
                ageBounds = await _glanceDa.GetAgeBoundsAsync(_credentials, ct);

                cache.SetValue(Request, ageBounds);
            }

            var model = new PatientsViewModel
            {
                AgeMax = ageBounds.Max,
                AgeMin = ageBounds.Min,
            };

            return(View(model));
        }
        public IActionResult Index(string searchParams = "")
        {
            var patientsModel = new PatientsViewModel();

            patientsModel.Patients = new List <PatientViewModel>();

            foreach (var patient in _patientLogic.GetByName(searchParams, false).Where(patient => patient.IsApproved))
            {
                patientsModel.Patients.Add(new PatientViewModel
                {
                    Id      = patient.Id,
                    Name    = patient.Name,
                    Age     = patient.Age,
                    Disease = new DiseaseViewModel
                    {
                        Id = patient.Disease.Id
                    }
                });
            }

            return(View(patientsModel));
        }
Exemplo n.º 28
0
        public IActionResult All()
        {
            var allActivePatients = this._patientService
                                    .GetAllActivePatients();

            var patientsViewModel = new PatientsViewModel
            {
                Patients = allActivePatients
                           .Select(
                    p => new PatientViewModel
                {
                    Id            = p.Id,
                    FirstName     = p.FirstName,
                    LastName      = p.LastName,
                    SSN           = p.SSN,
                    AverageRating = this._ratingService
                                    .GetAveragePatientRating(p.Id),
                })
                           .ToArray()
            };

            return(View(patientsViewModel));
        }
Exemplo n.º 29
0
 public IActionResult Delete(PatientsViewModel patient)
 {
     new PatientsManager().DeletePatients(patient.Id);
     return(RedirectToAction("Index"));
 }
Exemplo n.º 30
0
        public ViewResult Edit(int?_id)
        {
            PatientsViewModel patient = _patientsManager.ReadOnePatient((int)_id);

            return(View(patient));
        }
Exemplo n.º 31
0
        private async Task<ActionResult> ViewPatients(CancellationToken ct)
        {
            var cache = new ResponseCache<AgeBounds>(false, DefaultCacheTime.Long, _settings.ResponseCacheEnabled,
                _settings.ResponseCacheDefaultShortTimeInMinutes, _settings.ResponseCacheDefaultLongTimeInMinutes);
            var ageBounds = cache.GetValue(Request);
            if (ageBounds == null)
            {
                ageBounds = await _glanceDa.GetAgeBoundsAsync(_credentials, ct);
                cache.SetValue(Request, ageBounds);
            }

            var model = new PatientsViewModel
            {
                AgeMax = Math.Ceiling(ageBounds.Max).ToString(System.Globalization.CultureInfo.InvariantCulture),
                AgeMin = Math.Floor(ageBounds.Min).ToString(System.Globalization.CultureInfo.InvariantCulture),
            };
            return View(model);
        }