public ActionResult DiseasesDemographicReport(DiseaseDate diseaseDate) { if (!ModelState.IsValid) { return(View(diseaseDate)); } var DiseaseWiseReport = headManager.GetDiseaseWiseReports(diseaseDate); var diseaseList = headManager.GetDiseaseList(); ViewBag.DiseaseList = new SelectList(diseaseList, "Id", "Name"); ArrayList headerData = new ArrayList { "District Name", "No of Patient", "CS" }; ArrayList data = new ArrayList(); data.Add(headerData); foreach (var d in DiseaseWiseReport) { ArrayList data1 = new ArrayList { d.DistrictName, d.TotalPatients, d.TotalPatients }; data.Add(data1); } string datastr = JsonConvert.SerializeObject(data, Formatting.None); ViewBag.Data = new HtmlString(datastr); return(View()); }
public ActionResult DiseaseBarChartReport(DiseaseDate diseaseDate) { if (!ModelState.IsValid) { return(View(diseaseDate)); } var districtWiseReport = headManager.GetPatientOfDiseaseIndisease(diseaseDate.DiseaseId, diseaseDate.BeginDateTime, diseaseDate.EndDateTime); var districtList = headManager.GetDistrictList(); ViewBag.DistrictList = new SelectList(districtList, "Id", "Name"); ArrayList headerData = new ArrayList { "Disease Name", "No of Patient" }; ArrayList data = new ArrayList(); data.Add(headerData); foreach (var d in districtWiseReport) { ArrayList data1 = new ArrayList { d.DiseaseName, d.Patient }; data.Add(data1); } string datastr = JsonConvert.SerializeObject(data, Formatting.None); ViewBag.Data = new HtmlString(datastr); return(View()); }
public ActionResult DiseaseWiseReport(DiseaseDate diseaseDate) { var diseaseList = headManager.GetDiseaseList(); ViewBag.DiseaseList = new SelectList(diseaseList, "Id", "Name"); if (!ModelState.IsValid) { return(View(diseaseDate)); } ViewBag.DiseaseWiseReport = headManager.GetDiseaseWiseReports(diseaseDate); return(View()); }
public List <PatientInDistrict> GetDistrictWiseReports(DiseaseDate diseaseDate) { List <PatientInDistrict> patientInDistricts = new List <PatientInDistrict>(); List <int> centerList = headGateway.GetCenterListByDistrictId(diseaseDate.DiseaseId); List <int> diseaseList = headGateway.GetDiseaseIdList(); foreach (int d in diseaseList) { List <Treatment> treatments = new List <Treatment>(); foreach (int i in centerList) { List <Treatment> newTreatments = headGateway.GetTreatmentListByCenterId(i, d, diseaseDate.BeginDateTime, diseaseDate.EndDateTime); treatments.AddRange(newTreatments); } PatientInDistrict patientInDistrict = new PatientInDistrict(); patientInDistrict.DiseaseId = d; patientInDistrict.DiseaseName = GetDiseaseNamebyId(d).Name; patientInDistrict.Patient = treatments.GroupBy(x => x.VoterIdNo).Select(x => x.First()).Count(); patientInDistricts.Add(patientInDistrict); } return(patientInDistricts); }
public List <DiseaseWiseReport> GetDiseaseWiseReports(DiseaseDate diseaseDate) { List <District> districts = headGateway.GetDistrictList(); List <DiseaseWiseReport> diseaseWiseReports = new List <DiseaseWiseReport>(); foreach (District district in districts) { List <Treatment> treatments = new List <Treatment>(); List <int> centerList = headGateway.GetCenterListByDistrictId(district.Id); foreach (int i in centerList) { List <Treatment> newTreatments = headGateway.GetTreatmentListByCenterId(i, diseaseDate.DiseaseId, diseaseDate.BeginDateTime, diseaseDate.EndDateTime); treatments.AddRange(newTreatments); } DiseaseWiseReport diseaseWiseReport = new DiseaseWiseReport(); diseaseWiseReport.DistrictId = district.Id; diseaseWiseReport.DistrictName = district.Name; diseaseWiseReport.TotalPatients = treatments.GroupBy(x => x.VoterIdNo).Select(x => x.First()).Count(); diseaseWiseReport.PercentageOfPopulation = ((double)diseaseWiseReport.TotalPatients * 100 / (double)district.Population); diseaseWiseReports.Add(diseaseWiseReport); } return(diseaseWiseReports); }