Ejemplo n.º 1
0
        //Black out everything except the dates with appointments
        private void SetupBlackoutDates()
        {
            PatientInfoViewModel vm = GetModel();

            if (vm == null || vm.AppointmentDates == null)
            {
                return;
            }

            //black out dates in between appointments
            //If there is an appointment beyond the max display date, increase max display date
            DateTime lastAppointmentDate = vm.AppointmentDates[vm.AppointmentDates.Count - 1].Date;

            if (lastAppointmentDate >= MaxCalendarDisplayDate)
            {
                MaxCalendarDisplayDate = lastAppointmentDate.AddDays(1);
            }
            DateTime start = DateTime.Today;

            foreach (DateTime dt in vm.AppointmentDates)
            {
                if (start == dt)
                {
                    start = dt.AddDays(1);
                    continue;
                }
                PatientCalendar.BlackoutDates.Add(new CalendarDateRange(start, dt.AddDays(-1)));
                start = dt.AddDays(1);
            }
            //Black out future dates
            PatientCalendar.BlackoutDates.Add(new CalendarDateRange(start, MaxCalendarDisplayDate));
            AreBlackoutDatesSetUp = true;
        }
Ejemplo n.º 2
0
        public PatientInfoPage()
        {
            InitializeComponent();
            BindingContextChanged += Page_BindingContextChanged;
            BindingContext         = new PatientInfoViewModel(Navigation);

            void Page_BindingContextChanged(object sender, EventArgs e)
            {
                ViewModel.ErrorsChanged += ViewModel_ErrorsChanged;
            }

            void ViewModel_ErrorsChanged(object sender, DataErrorsChangedEventArgs e)
            {
                var propHasErrors = (ViewModel.GetErrors(e.PropertyName) as List <string>)?.Any() == true;

                switch (e.PropertyName)
                {
                case nameof(ViewModel.FirstName):
                    firstNameField.TextColor = propHasErrors ? Color.Red : Color.Black;
                    break;

                case nameof(ViewModel.LastName):
                    lastNameField.TextColor = propHasErrors ? Color.Red : Color.Black;
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Index(string id)
        {
            string patientId = id;

            ViewData["GoogleMapsApiKey"] = _googleApiSetting.MapsJavaScriptApiKey;

            var patient = await _azureApiForFhirService.GetPatientInfoAsync(patientId);

            var conditions = await _azureApiForFhirService.GetPatientConditionsAsync(patientId);

            var encounters = await _azureApiForFhirService.GetPatientEncountersAsync(patientId);

            var observations = await _azureApiForFhirService.GetPatientObservationsAsync(patientId);

            var patientInfoViewModel = new PatientInfoViewModel
            {
                IsSuccessful = patient.IsSuccessful && conditions.IsSuccessful && encounters.IsSuccessful && observations.IsSuccessful,
                Message      = (patient.Message + " " + conditions.Message + " " + encounters.Message + " " + observations.Message).Trim(),
                Patient      = patient,
                Conditions   = conditions.Conditions,
                Encounters   = encounters.Encounters,
                Observations = observations.Observations
            };

            return(View(patientInfoViewModel));
        }
        private PatientInfoViewModel GetModel()
        {
            if (model != null)
                return model;
            else
            {
                AppViewModel appVM = DataContext as AppViewModel;
                if (appVM == null)
                    return null;

                PatientInfoViewModel vm = appVM.CurrentViewModel as PatientInfoViewModel;
                model = vm;
                return model;
            }
        }
Ejemplo n.º 5
0
        private PatientInfoViewModel GetModel()
        {
            if (model != null)
            {
                return(model);
            }
            else
            {
                AppViewModel appVM = DataContext as AppViewModel;
                if (appVM == null)
                {
                    return(null);
                }

                PatientInfoViewModel vm = appVM.CurrentViewModel as PatientInfoViewModel;
                model = vm;
                return(model);
            }
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> GetPatientInfoByPapmiNo(string papmiNo, string status)
        {
            var result = new PatientInfoViewModel();

            if (status.ToLower() == "active")
            {
                result = await _patientInfoService.GetPatientInfoByPapmiNoAsync(papmiNo, DoctorPanelEnum.Active);
            }
            else
            {
                result = await _patientInfoService.GetPatientInfoByPapmiNoAsync(papmiNo, DoctorPanelEnum.InActice);
            }

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }
Ejemplo n.º 7
0
        public IActionResult Patients(PatientInfoViewModel model)
        {
            var patientInfo = _context.ApplicationUser
                              .Join(
                _context.PatientModel,
                user => user.Id,
                patient => patient.UserId,
                (user, patient) => new PatientInfoViewModel
            {
                Id        = patient.Id,
                FirstName = user.FirstName,
                LastName  = user.LastName
            }
                )
                              .OrderBy(s => s.LastName)
                              .OrderBy(s => s.FirstName)
                              .ToList();

            return(View(patientInfo));
        }
Ejemplo n.º 8
0
        public async Task <PatientInfoViewModel> GetPatientInfoByPapmiNoAsync(string papmiNo, DoctorPanelEnum doctorPanelEnum)
        {
            var patient = await _patientAdmissionRepository.GetPatientMasterByPapmiNoAsync(papmiNo);

            if (patient == null)
            {
                return(null);
            }

            var person = await _patientAdmissionRepository.GetPersonByPapmiRowIdAsync(patient.PAPMI_RowId1);

            var ptAdms = await _patientAdmissionRepository.GetPatientAdmissionsByPapmiRowIdAsync(patient.PAPMI_RowId1);

            var documentVMs = (await _medicalRecordService.GetDocumentsVMByPapmiRowIdAsync(patient.PAPMI_RowId1)).ToList();
            //var documentFilters = (await _medicalRecordService.GetDocumentFilterAsync(patient.PAPMI_RowId1)).ToList();

            var patientInfo = new PatientInfo()
            {
                PAPMI_RowId1 = patient.PAPMI_RowId1,
                PAPMI_No     = patient.PAPMI_No,
                PAPER_ID     = person.PAPER_ID,
                TTL_Desc     = person.TTL_Desc,
                PAPER_Name   = person.PAPER_Name,
                PAPER_Name2  = person.PAPER_Name2,
                CTSEX_Desc   = person.CTSEX_Desc,
                PAPMI_DOB    = person.PAPMI_DOB,
                PAPER_AgeYr  = person.PAPER_AgeYr,
                PAPER_AgeMth = person.PAPER_AgeMth,
                PAPER_AgeDay = person.PAPER_AgeDay
            };

            var episodes = new List <EpisodeTreeViewModel>();

            foreach (var item in ptAdms)
            {
                var doctorPanel = new DoctorPanelViewModel();

                if (doctorPanelEnum == DoctorPanelEnum.Active)
                {
                    doctorPanel = await _eprService.GetDoctorPanelByEpiRowIdAsync(item.PAADM_RowID);
                }

                // var documentsEpi = scanDocuments.Where(d => d.PAADM_RowID == item.PAADM_RowID).ToList();
                var doucmentsFilterEpi = documentVMs.Where(d => d.PAADM_ADMNo == item.PAADM_ADMNo).FirstOrDefault();


                var episodeTree = new EpisodeTreeViewModel()
                {
                    PAADM_RowID       = item.PAADM_RowID,
                    PAADM_ADMNo       = item.PAADM_ADMNo,
                    PAADM_AdmDate     = item.PAADM_AdmDate,
                    PAADM_AdmTime     = item.PAADM_AdmTime,
                    CTLOC_Desc        = item.CTLOC_Desc,
                    CTPCP_Desc        = item.CTPCP_Desc,
                    PAADM_Type        = item.PAADM_Type,
                    PAADM_VisitStatus = item.PAADM_VisitStatus,
                    PAADM_DischgDate  = item.PAADM_DischgDate,
                    PAADM_DischgTime  = item.PAADM_DischgTime,
                    PAADM_Remark      = item.PAADM_Remark,
                    DoctorPanel       = doctorPanel,
                    // Documents = documentsEpi,
                    DocumentFilter = doucmentsFilterEpi
                };

                episodes.Add(episodeTree);
            }

            // sort list
            episodes = episodes.OrderByDescending(e => e.PAADM_AdmDate).ThenByDescending(e => e.PAADM_AdmTime).ToList();

            var result = new PatientInfoViewModel()
            {
                PatientInfo = patientInfo,
                EpisodeTree = episodes,
            };

            return(result);
        }
Ejemplo n.º 9
0
 public PatientInfoPage()
 {
     InitializeComponent();
     BindingContext = new PatientInfoViewModel();
 }