Exemplo n.º 1
0
        public DataTable FacilityPerformanceReportDataTable(Guid measurementToolId, DateTime startDate, DateTime endDate, Guid facilityId, List <Guid> medicalSchemeIds, out string facilityName)
        {
            Entities.Facility facility = _facilityRepository.FindById(facilityId);
            facilityName = facility.Name;

            string measurementToolName = _listRepository.GetMeasurementTools().Single(x => x.Id == measurementToolId).Name;

            var data = FacilityPerformanceReportData(measurementToolId, startDate, endDate, facilityId, medicalSchemeIds);

            DataTable dataTable = new DataTable();

            for (int i = 0; i < 12; i++)
            {
                dataTable.Columns.Add("");
            }

            dataTable.Rows.Add("Facility Performance Report");
            dataTable.Rows.Add(facilityName);
            dataTable.Rows.Add(string.Format("{0} - {1}", startDate.ToString("dd MMMM yyyy"), endDate.ToString("dd MMMM yyyy")));
            dataTable.Rows.Add(string.Format("Number of patients: {0}", data.Count == 0 ? "0" : data.First().Value["TotalPatients"]));
            dataTable.Rows.Add(string.Format("Number of Completed Episodes of Care: {0}", data.Count == 0 ? "0" : data.First().Value["TotalEpisodesOfCare"]));
            dataTable.Rows.Add(measurementToolName);

            dataTable.Rows.Add("&nbsp;");
            dataTable.Rows.Add("&nbsp;");
            dataTable.Rows.Add("All columns display the average values, except \"Episodes of Care\" and \" % \"");
            dataTable.Rows.Add("Gain = Discharge score minus Admission score");
            dataTable.Rows.Add("LOS(days) = Length of Stay");
            dataTable.Rows.Add("Efficience = Gain divided by LOS");
            dataTable.Rows.Add("Onset Days = Number of days between Onset of episode and Admission to hospital");

            dataTable.Rows.Add("&nbsp;");
            dataTable.Rows.Add("Impairment Group", "Number of Completed Episodes of Care", "% of Total", "Age", "Admission Score", "Discharge Score", "Gain", "LOS(days)", "Efficiency", "Onset Days");
            dataTable.Rows.Add("&nbsp;");


            for (int i = 0; i < data.Keys.Count; i++)
            {
                Guid impairmentGroupId = data.Keys.ElementAt(i);
                dataTable.Rows.Add(data[impairmentGroupId]["ImpairmentGroup"], data[impairmentGroupId]["NumberOfCompletedEpisodesOfCare"], Math.Round(Convert.ToDouble(data[impairmentGroupId]["Percentage"]), 2), Math.Round(Convert.ToDouble(data[impairmentGroupId]["Age"]), 2), data[impairmentGroupId]["AverageAdmitScore"], data[impairmentGroupId]["AverageDischargeScore"], data[impairmentGroupId]["Delta"], data[impairmentGroupId]["AverageLOS"], Math.Round(Convert.ToDouble(data[impairmentGroupId]["Effiency"]), 2), Math.Round(Convert.ToDouble(data[impairmentGroupId]["OnsetDays"]), 2));
            }

            return(dataTable);
        }
Exemplo n.º 2
0
 public EntityViews.Facility.Facility Find(Guid id)
 {
     return(_facilityRepository.FindById(id));
 }
Exemplo n.º 3
0
 public Entities.Facility Get(Guid facilityId)
 {
     return(_facilityRepository.FindById(facilityId));
 }