예제 #1
0
        public void OnGet()
        {
            Deaths    = diagnosisService.Deaths();
            Recovered = diagnosisService.Recovered();
            Diagnoses = diagnosisService.GetDiagnosesWithCorona();
            var newDiagnosis = Diagnoses.GroupBy(d => d.Patient.Hospital.Name);

            foreach (var item in newDiagnosis)
            {
                HospitalPatients.Add(new StatisticsCore
                {
                    Hospital      = item.Key,
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
            var patientDeath = Deaths.GroupBy(d => d.Patient.Hospital.Name);

            foreach (var item in patientDeath)
            {
                PatientDeath.Add(new StatisticsCore
                {
                    Hospital      = item.Key,
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
        }
예제 #2
0
        public void OnGet()
        {
            Deaths    = diagnosisService.Deaths();
            Recovered = diagnosisService.Recovered();
            Diagnoses = diagnosisService.GetDiagnosesWithCorona();
            var Ddiagnoses = Diagnoses.GroupBy(x => 10 * ((DateTime.Now.Year - x.Patient.BirthDate.Year) / 10));

            foreach (var item in Ddiagnoses.OrderBy(i => i.Key))
            {
                AgeGroup.Add(new StatisticsCore
                {
                    Age           = item.Key.ToString() + "-" + $"{item.Key + 9}",
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });;
            }
            var patientDeath = Deaths.GroupBy(x => 10 * ((DateTime.Now.Year - x.Patient.BirthDate.Year) / 10));

            foreach (var item in patientDeath)
            {
                PatientDeath.Add(new StatisticsCore
                {
                    Age           = item.Key.ToString() + "-" + $"{item.Key + 9}",
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
        }
예제 #3
0
        public void OnGet()
        {
            Deaths    = diagnosisService.Deaths();
            Recovered = diagnosisService.Recovered();
            Diagnoses = diagnosisService.GetDiagnosesWithCorona();
            var Ddiagnoses = Diagnoses.GroupBy(x => x.Patient.City);

            foreach (var item in Ddiagnoses)
            {
                RegionPatients.Add(new StatisticsCore
                {
                    Region        = item.Key,
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
            var patientDeath = Deaths.GroupBy(x => x.Patient.City);

            foreach (var item in patientDeath)
            {
                PatientDeath.Add(new StatisticsCore
                {
                    Region        = item.Key,
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
        }
예제 #4
0
        public void OnGet()
        {
            Deaths    = diagnosisService.Deaths();
            Recovered = diagnosisService.Recovered();
            Diagnoses = diagnosisService.GetDiagnosesWithCorona();
            var Ddiagnoses = Diagnoses.GroupBy(x => x.DateOfTest);

            foreach (var item in Ddiagnoses)
            {
                ByDate.Add(new StatisticsCore
                {
                    DateTime      = item.Key,
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
        }
예제 #5
0
        public void OnGet()
        {
            Deaths    = diagnosisService.Deaths();
            Recovered = diagnosisService.Recovered();
            Diagnoses = diagnosisService.GetDiagnosesWithCorona();
            var newDiagnosis = Diagnoses
                               .Where(x => (x.Death == true && x.Recovered == true) || (x.Death == true && x.Recovered == false) || (x.Death == false && x.Recovered == true))
                               .GroupBy(d => d.Recovered);

            foreach (var item in newDiagnosis)
            {
                RecoveryRate.Add(new StatisticsCore
                {
                    Recovered = item.Key == true ?
                                "Recovered " + String.Format("{0:0.00}", ((double)item.Count() / (Deaths.Count() + Recovered.Count())) * 100) + "%"
                    : "Deaths " + String.Format("{0:0.00}", ((double)item.Count() / (Deaths.Count() + Recovered.Count())) * 100) + "%",
                    TotalPatients = item.GroupBy(x => x.Patient.Name).Count()
                });
            }
        }
예제 #6
0
 public void OnGet()
 {
     Deaths    = diagnosisService.Deaths();
     Recovered = diagnosisService.Recovered();
     Diagnoses = diagnosisService.GetDiagnosesWithCorona();
 }