예제 #1
0
        private void DiseaseReportsViewLv_ItemClick(object sender, SelectionChangedEventArgs e)
        {
            Disease_Report_View disease = DiseaseReportsViewLv.SelectedItem as Disease_Report_View;
            DiseaseReportDetail r       = new DiseaseReportDetail()
            {
                hw     = user,
                report = disease
            };

            this.Frame.Navigate(typeof(MyDiseaseReportDetailPage), r);
        }
        private async void loaddata()
        {
            try
            {
                user               = reportdetail.hw;
                report             = reportdetail.report;
                DescriptionTb.Text = report.description;
                DateTbl.Text       = report.occurred_time + "";

                var hw = await App.MobileService.GetTable <Health_Worker>().Where(r => r.id == report.hw_id).ToListAsync();

                var patient = await App.MobileService.GetTable <Patient>().Where(r => r.id == report.patient_id).ToListAsync();

                ShowHeightTbl.Text = patient[0].height + " cm.";
                ShowNameTbl.Text   = patient[0].name;
                ShowTelTbl.Text    = patient[0].telephone;
                ShowWeightTbl.Text = patient[0].weight + " kg.";
                int age = DateTime.Now.Year - patient[0].dob.Date.Year;
                if (patient[0].dob.Date.AddYears(age) > DateTime.Now)
                {
                    age--;
                }
                ShowAgeTbl.Text = age + "";
                if (patient[0].gender != null)
                {
                    if (patient[0].gender.Equals("F"))
                    {
                        AvatarImg.Source = new BitmapImage(new Uri("ms-appx:/Assets/female-external.png"));
                    }
                    else
                    {
                        AvatarImg.Source = new BitmapImage(new Uri("ms-appx:/Assets/male-external.png"));
                    }
                }
                else
                {
                    AvatarImg.Source = new BitmapImage(new Uri("ms-appx:/Assets/male-external.png"));
                }
                CholeraTbl.Text    = Math.Round((report.cholera * 100), 2) + " %";
                ShigellaTbl.Text   = Math.Round((report.shigella * 100), 2) + " %";
                SalmonellaTbl.Text = Math.Round((report.simolnelle * 100), 2) + " %";
                RotavirusTbl.Text  = Math.Round((report.rotavirus * 100), 2) + " %";
                OtherTbl.Text      = Math.Round((report.others * 100), 2) + " %";
                List <Reported_Symptom> s = new List <Reported_Symptom>();
                var symptoms = await App.MobileService.GetTable <Reported_Symptom>().Where(r => r.disease_report_id == report.id).ToListAsync();

                foreach (Reported_Symptom symptom in symptoms)
                {
                    if (symptom.symptom == "stool_frequncy_per_day")
                    {
                        if (symptom.intensity == "mt 4")
                        {
                            pooImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/poopoo_btn.png"));
                            pooTbl.Text     = "&gt; 4 times/day";
                        }
                        else if (symptom.intensity == "lt 4")
                        {
                            pooImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/poo_btn.png"));
                            pooTbl.Text     = "&lt; 4 times/day";
                        }
                    }
                    else if (symptom.symptom == "nature_of_stool")
                    {
                        if (symptom.intensity == "watery")
                        {
                            stoolNatureTbl.Text = "Watery";
                        }
                        else if (symptom.intensity == "loose")
                        {
                            stoolNatureTbl.Text = "Loose";
                        }
                    }
                    else if (symptom.symptom == "stool_type")
                    {
                        if (symptom.intensity == "normal")
                        {
                            stoolTypeTbl.Text = "normal";
                        }
                        else if (symptom.intensity == "mucus")
                        {
                            stoolTypeTbl.Text = "mucus";
                        }
                        else if (symptom.intensity == "blood")
                        {
                            stoolTypeTbl.Text = "blood";
                        }
                    }
                    else if (symptom.symptom == "urine_output")
                    {
                        if (symptom.intensity == "llt 1ml kg hr")
                        {
                            urineImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/reduced_urine_btn.png"));
                            urineTbl.Text     = ">> 1 ml/kg/hr";
                        }
                        else if (symptom.intensity == "lt 1ml kg hr")
                        {
                            urineImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/urine_btn.png"));
                            urineTbl.Text     = "> 1 ml/kg/hr";
                        }
                        s.Add(symptom);
                    }
                    else if (symptom.symptom == "decreased_skin_turgor")
                    {
                        if (symptom.intensity == "delay mt 5s")
                        {
                            skinTurgorImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/deskin_btn.png"));
                            skinTurgorTbl.Text     = "Delay > 5 sec";
                        }
                        else if (symptom.intensity == "delay 2 5s")
                        {
                            skinTurgorImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/skin_btn.png"));
                            skinTurgorTbl.Text     = "Delay 2-5 sec";
                        }
                        s.Add(symptom);
                    }
                    else if (symptom.symptom == "thirst")
                    {
                        if (symptom.intensity == "thirsty")
                        {
                            thirstyImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/thirst_btn.png"));
                            thirstyTbl.Text     = "Thirsty";
                        }
                        else if (symptom.intensity == "unable to drink")
                        {
                            thirstyImage.Source = new BitmapImage(new Uri("ms-appx:/Assets/unable_btn.png"));
                            thirstyTbl.Text     = "Unable to drink";
                        }
                        s.Add(symptom);
                    }
                    else
                    {
                        s.Add(symptom);
                    }
                }
                SymptomLv.ItemsSource = s;
            }
            catch (Exception e) { }
        }