Example #1
0
 public PatientDetails(int primarykey)
 {
     InitializeComponent();
     objviewmodel     = new PatientDetailsViewModel(primarykey);
     this.DataContext = objviewmodel;
     //FillAutoFill();
 }
Example #2
0
 public PatientDetails()
 {
     InitializeComponent();
     objviewmodel     = new PatientDetailsViewModel();
     this.DataContext = objviewmodel;
     FillAutoFill();
 }
Example #3
0
        public ActionResult CreatePatientProfile(PatientDetailsViewModel patientDetails)
        {
            if (!ModelState.IsValid)
            {
                patientDetails.GenderDictionary = _patientServices.GetGenderDictionary();

                return(View(patientDetails));
            }

            DateTime dateofBirth = new DateTime(patientDetails.yearint, patientDetails.monthint, patientDetails.dateint);

            var patient = new Patient()
            {
                Pat_Id        = Utilities.GeneratePatientId(),
                Firstname     = patientDetails.Firstname,
                Lastname      = patientDetails.Lastname,
                Middle        = patientDetails.Middle,
                DoB           = dateofBirth,
                DateRegister  = DateTime.Now,
                AddStreetBrgy = patientDetails.AddStreetBrgy,
                Muncity       = patientDetails.Municipality,
                Province      = patientDetails.Province,
                Gender        = patientDetails.Gender,
                ContactCell   = patientDetails.ContactCell
            };

            _patientServices.InsertPatient(patient);
            _unitofwork.Commit();

            var patId = patient.Pat_Id;

            // var url = @Url.Action("ViewProfile", "Patient");
            return(Json(new { success = true, patId }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        public PatientDetailsViewModel GetPatientDetails(string userId)
        {
            var patient        = this.db.Users.Find(userId);
            var аddressDetails = "Няма въведен адрес";

            if (patient != null)
            {
                if (patient.Address != null)
                {
                    аddressDetails = string.Concat("ул. ", patient.Address?.Street, ", ",
                                                   "№ ", patient.Address?.StreetNumber, ", ",
                                                   "Вход: ", patient.Address?.Entrance, ", ",
                                                   "Етаж: ", patient.Address?.Floor, ", ",
                                                   "Апартамент: ", patient.Address?.Apartment, ", ",
                                                   "Град: ", patient.Address?.City, ", ",
                                                   "Държава: ", patient.Address?.Country.Name, ".");
                }
                ;

                var patienDetails = new PatientDetailsViewModel
                {
                    BirthDate   = patient.BirthDate,
                    PIN         = CleanPIN(patient.PIN),
                    FullAddress = аddressDetails,
                    CountryCode = patient.Address?.Country?.Code
                };

                return(patienDetails);
            }
            return(null);
        }
        public async Task <IActionResult> Search(SearchPatientFormModel model)
        {
            var patient = await this.patient.FindPatientMedicalProfileAsync(model.SearchBox);

            if (patient != null)
            {
                var today = DateTime.Today;

                var age = today.Year - patient.BirthDate.Year;
                if (patient.BirthDate > today.AddYears(-age))
                {
                    age--;
                }

                var isPatientCurrentlyRegistered = patient.DeregistrationDate == null ? true : false;

                var viewModel = new PatientDetailsViewModel
                {
                    Patient = patient,
                    IsPatientCurrentlyRegistered = isPatientCurrentlyRegistered,
                    Age = age
                };

                return(View(viewModel));
            }
            else
            {
                return(View(new PatientDetailsViewModel()));
            }
        }
        public PatientDetails()
        {
            InitializeComponent();
            viewModel      = new PatientDetailsViewModel();
            BindingContext = viewModel;

            viewModel.ButtonEvent += BeginAnimation;
        }
Example #7
0
        public async Task <byte[]> GenerateDetailsPdf(int id, string sgrqChart, PatientDetailsViewModel patientDetailsViewModel)
        {
            ProcessSGRQChart(id, sgrqChart, patientDetailsViewModel);
            ProcessIgCharts(patientDetailsViewModel);
            string htmlView = await _htmlRenderService.RenderToStringAsync("/Views/Patients/PdfDetails.cshtml", patientDetailsViewModel);

            return(GeneratePdfFromHtml(htmlView));
        }
 public PatientDetails()
 {
     InitializeComponent();
     objviewmodel             = new PatientDetailsViewModel();
     objviewmodel.ScreenWidth = (System.Windows.SystemParameters.PrimaryScreenWidth / 2) - 50;
     this.DataContext         = objviewmodel;
     //FillAutoFill();
 }
Example #9
0
 public IActionResult Details(int id)
 {
     
     var patientdtails = new PatientDetailsViewModel
     {
         Patient = _unitOfWork.Patient.GetPatientById(id),
     };
     return View(patientdtails);
 }
Example #10
0
        public ActionResult CreatePatientProfile()
        {
            var patientModel = new PatientDetailsViewModel
            {
                GenderDictionary = _patientServices.GetGenderDictionary()
            };


            return(View(patientModel));
        }
Example #11
0
        protected async Task <PatientDetailsViewModel> GetExportViewModel(int id)
        {
            var crfManager = new CaseReportFormManager(_context);
            var patient    = await _patientManager.FindPatientWithRelationsByIdAsync(id);

            var patientDetailsViewModel = PatientDetailsViewModel.BuildPatientViewModel(_context, patient, crfManager);

            SetItemsToShowInExport(patientDetailsViewModel);
            return(patientDetailsViewModel);
        }
        public ActionResult Details()
        {
            var                  patient   = (Patient)TempData["patient"];
            PatientModel         Model     = new PatientModel();
            List <MedicineTimes> medicines = new List <MedicineTimes>(Model.GetMedicines(patient));
            //Model.GetMedicinesByName(medicines);
            PatientDetailsViewModel viewModel = new PatientDetailsViewModel(patient, medicines);

            return(View(viewModel));
        }
Example #13
0
 private static void AddDrugLevelsIfDrugsChecked(PatientDetailsViewModel patientDetailsViewModel)
 {
     if (patientDetailsViewModel.ShowDrugs)
     {
         patientDetailsViewModel.ShowDrugLevels = true;
     }
     else
     {
         patientDetailsViewModel.ShowDrugLevels = false;
     }
 }
Example #14
0
 private void ProcessIgCharts(PatientDetailsViewModel patientDetailsViewModel)
 {
     if (patientDetailsViewModel.IgCharts == null)
     {
         return;
     }
     foreach (var igChart in patientDetailsViewModel.IgCharts)
     {
         SavePNGChart(igChart.PngImage, igChart.FileName);
     }
 }
 public PatientDetailsExcelChartGenerator(byte[] documentByteArray,
                                          List <string> chartNames,
                                          PatientDetailsViewModel patientDetailsViewModel)
 {
     _spreadsheetToAppendChart = documentByteArray;
     _chartNames                = chartNames;
     _patientDetailsVM          = patientDetailsViewModel;
     _lastSGRQChartDataRowIndex = patientDetailsViewModel.STGQuestionnaires.Count + 1;
     SGRQChartName              = chartNames.Where(n => n.Contains("SGRQ")).FirstOrDefault();
     IgChartName                = chartNames.Where(n => n.Contains("Ig")).FirstOrDefault();
 }
Example #16
0
        public async Task <IActionResult> Details(int id)
        {
            PatientDetailsViewModel patientDetailsVM = await GetExportViewModel(id);

            patientDetailsVM.STGQuestionnaires = patientDetailsVM.STGQuestionnaires.OrderBy((q => q.DateTaken)).ToList();
            bool isAnonymous = User.IsInRole("Anonymous Role") && !User.IsInRole("Read Role");
            var  exporter    = new PatientDetailsExcelExporter(patientDetailsVM,
                                                               DetailsDisplayControlProperties(), Request.Form,
                                                               _context, isAnonymous);

            return(GetFileContentResult(exporter.ToOutputBytes(), ".xlsx", EXCEL_2007_CONTENT_TYPE));
        }
Example #17
0
 public PatientDetailsExcelExporter(PatientDetailsViewModel patientDetailsViewModel,
                                    List <PropertyInfo> controlDisplayProperties,
                                    IFormCollection form,
                                    AspergillosisContext context,
                                    bool isAnonymous = false)
 {
     _outputWorkbook           = new XSSFWorkbook();
     _patientDetailsVM         = patientDetailsViewModel;
     _controlDisplayProperties = controlDisplayProperties;
     _form       = form;
     IsAnonymous = isAnonymous;
     _context    = context;
 }
Example #18
0
        public async Task <IActionResult> OnGetAsync(Guid id)
        {
            try
            {
                this.PatientModel = await this.patientsService.GetDetailsAsync(id.ToString());
            }
            catch (Exception)
            {
                this.AddDangerMessage("Unable to get patient details");
            }

            return(this.Page());
        }
Example #19
0
        private void ProcessSGRQChart(int id, string sgrqChart, PatientDetailsViewModel patientDetailsViewModel)
        {
            if (sgrqChart == null)
            {
                return;
            }
            var sgrqChartFileName = "SGRQ_Chart_" + id.ToString() + "_";

            patientDetailsViewModel.ShowButtons = false;
            string base64String = sgrqChart.Replace("data:image/png;base64,", String.Empty);

            SavePNGChart(base64String, sgrqChartFileName);
            patientDetailsViewModel.SgrqImageChartFile = sgrqChartFileName;
        }
        public async Task <IActionResult> Details(int id, string sgrqChart, int igChartsLength)
        {
            var user = await _userManager.GetUserAsync(HttpContext.User);

            var rolesCount = _userManager.GetRolesAsync(user).Result.Count;
            PatientDetailsViewModel patientDetailsViewModel = await GetExportViewModel(id);

            patientDetailsViewModel.ShowDetails = rolesCount > 1;
            if (igChartsLength > 0)
            {
                AddIgChartsToPatientVM(patientDetailsViewModel, igChartsLength);
            }
            var pdfBytes = _pdfConverter.GenerateDetailsPdf(id, sgrqChart, patientDetailsViewModel);

            return(GetFileContentResult(pdfBytes.Result, ".pdf", "application/pdf"));
        }
        private void AddIgChartsToPatientVM(PatientDetailsViewModel patientDetailsViewModel, int chartsCount)
        {
            var igCharts = new List <PatientIgChart>();

            for (var cursor = 0; cursor < chartsCount; cursor++)
            {
                var igChart = new PatientIgChart();
                igChart.PngImage = Request.Form["PatientCharts[" + cursor + "].Image"].ToString().
                                   Replace("data:image/png;base64,", String.Empty);
                if (igChart.PngImage.Length < 25)
                {
                    continue;
                }
                igChart.FileName = "Ig_Chart_" + cursor + "_" + patientDetailsViewModel.Patient.ID.ToString() + "_";
                igCharts.Add(igChart);
            }
            patientDetailsViewModel.IgCharts = igCharts;
        }
Example #22
0
        public ActionResult Details(int id)
        {
            var patient = this.patients.GetById(id);
            var tootStatusForPatient = this.toothStatus.GetAllByPatientId(id).ToList();
            var model = new PatientDetailsViewModel
            {
                FirstName   = patient.FirstName,
                LastName    = patient.LastName,
                Age         = patient.Age,
                Address     = patient.Address,
                Tel         = patient.Tel,
                Profession  = patient.Profession,
                ToothStatus = tootStatusForPatient
            };

            this.TempData["PatientId"] = id;

            return(this.View(model));
        }
        public async Task <IActionResult> PdfDetails(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var patient = await _patientManager.FindPatientWithRelationsByIdAsync(id);

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

            var patientDetailsViewModel = PatientDetailsViewModel.BuildPatientViewModel(_context, patient, _caseReportFormManager);

            return(View(patientDetailsViewModel));
        }
Example #24
0
        public IActionResult Index()
        {
            var userId = this.User.FindFirst(ClaimTypes.NameIdentifier).Value;

            if (_doctorServices.CheckCurrentDoctorRegisterComplete(userId) == false)
            {
                return(Register(userId));
            }
            else
            {
                List <CDCDataModel>     data    = _GetData.GetCDCData();
                DoctorViewModel         doctor  = new DoctorViewModel();
                PatientDetailsViewModel patient = new PatientDetailsViewModel();
                var buildingPk = _context.Doctors.Where(d => d.UserId == userId).Select(d => d.DoctorHospitalBuildingKey).FirstOrDefault();

                doctor.DoctorBuildingPK = buildingPk;
                doctor.DoctorId         = userId;
                doctor.PatientDetails   = _doctorServices.GetDefaultPatients(userId, data);

                return(View(doctor));
            }
        }
Example #25
0
        public List <PatientDetailsViewModel> GetDefaultPatients(string docId, List <CDCDataModel> data)
        {
            List <PatientDetailsViewModel> patients = new List <PatientDetailsViewModel>();

            PatientDetailsViewModel patientOne = new PatientDetailsViewModel {
                DoctorId = docId, PatientAge = "45", PatientGender = "Male", PatientRace = "White"
            };
            DoctorViewModel docModel = new DoctorViewModel {
                PatientConditionOne = "Obesity", PatientConditionTwo = "Asthma", PatientConditionThree = "Asbestosis",
                PatientAge          = patientOne.PatientAge, PatientRace = patientOne.PatientRace, PatientGender = patientOne.PatientGender,
                PatientSymptomOne   = "Chest Pain", PatientSymptomTwo = "Cough", PatientSymptomThree = "null"
            };

            var cause = data.Where(d => (d.Symptoms[0] == docModel.PatientSymptomOne) &&
                                   (d.Symptoms[1] == docModel.PatientSymptomTwo) &&
                                   (d.Symptoms[2] == docModel.PatientSymptomThree)).Select(d => d.Cause).FirstOrDefault();

            Dictionary <string, double> probability = new Dictionary <string, double>();
            Dictionary <string, double> CCList      = _GetData.GetCC(data, docModel);
            Dictionary <string, Dictionary <string, double> > IllCCList = new Dictionary <string, Dictionary <string, double> >();

            double        pVal = _GetData.GetMortalityProbability(docModel, data);
            List <string> possibleIllnesses = new List <string>();


            possibleIllnesses.Add(cause);

            probability.Add(cause, pVal);
            IllCCList.Add(cause, CCList);

            patientOne.PatientMortalityProbability = probability;
            patientOne.PatientPossibleIllness      = possibleIllnesses;
            patientOne.PatientCCList = IllCCList;

            patients.Add(patientOne);

            return(patients);
        }
Example #26
0
        protected void SetItemsToShowInExport(PatientDetailsViewModel patientDetailsViewModel)
        {
            var displayControlKeys = Request.Form.Keys.Where(k => k.Contains("Show")).ToList();

            if (displayControlKeys.Contains("ShowDrugs"))
            {
                displayControlKeys.Add("ShowDrugLevels");
            }
            foreach (var key in DetailsDisplayControlProperties())
            {
                var displayKeyValue = Request.Form[key.Name];
                var propertyInfo    = patientDetailsViewModel.GetType().GetProperty(key.Name);
                if (displayKeyValue == "on")
                {
                    propertyInfo.SetValue(patientDetailsViewModel, true);
                }
                else
                {
                    propertyInfo.SetValue(patientDetailsViewModel, false);
                }
            }
            AddDrugLevelsIfDrugsChecked(patientDetailsViewModel);
        }
Example #27
0
        public IActionResult PatientDisplay(string id)
        {
            var pracId             = TempData["PracId"];
            var monitorKey         = "Monitor" + pracId;
            var monitoredList      = _cache.GetObject <List <MonitorModel> >(monitorKey);
            var patientDetailModel = new PatientDetailsViewModel();

            for (int i = 0; i < monitoredList.Count; i++)
            {
                if (monitoredList[i].Id == id)
                {
                    patientDetailModel.Id        = monitoredList[i].Id;
                    patientDetailModel.Name      = monitoredList[i].Name;
                    patientDetailModel.Birthdate = monitoredList[i].Birthdate;
                    patientDetailModel.Gender    = monitoredList[i].Gender;
                    patientDetailModel.Address   = monitoredList[i].Address;
                    patientDetailModel.City      = monitoredList[i].City;
                    patientDetailModel.State     = monitoredList[i].State;
                    patientDetailModel.Country   = monitoredList[i].Country;
                }
            }
            return(View(patientDetailModel));
        }
 public PatientDetailsPage(PatientDetailsViewModel viewModel)
 {
     InitializeComponent();
     BindingContext = viewModel;
 }
Example #29
0
 public PatientDetailsView()
 {
     InitializeComponent();
     _viewModel     = new PatientDetailsViewModel();
     BindingContext = _viewModel;
 }
Example #30
0
 public SearchLetter()
 {
     InitializeComponent();
     objviewmodel     = new PatientDetailsViewModel();
     this.DataContext = objviewmodel;
 }