Exemple #1
0
 private PatientScoreRangeData GetData(PatientScoreRangeParameters parameters)
 {
     using (var connection = _connectionFactory.CreateConnection())
     {
         var reportDtos = connection.Query <PatientScoreRangeDto>(GetQuery(parameters)).ToList();
         if (!reportDtos.Any())
         {
             return(null);
         }
         var returnData = new PatientScoreRangeData();
         var data       = reportDtos.Select(
             reportDto => new PatientScoreRangeDataObject
         {
             Age                   = reportDto.PatientAge,
             AssessmentDate        = reportDto.ScoreDate.ToShortDateString(),
             Change                = reportDto.ScoreChange,
             Gender                = reportDto.PatientGender,
             PatientName           = reportDto.PatientFirstName + " " + reportDto.PatientLastName,
             Score                 = reportDto.AssessmentScore,
             PatientKey            = reportDto.PatientKey,
             AssessmentInstanceKey = reportDto.AssessmentInstanceKey,
             AssessmentName        = reportDto.AssessmentName
         }).ToList();
         returnData.Data = data;
         return(returnData);
     }
 }
Exemple #2
0
        private void SetStrings(PatientScoreRangeData data, PatientScoreRangeParameters reportParams, string reportName)
        {
            if (reportParams == null || data == null)
            {
                return;
            }
            var start     = reportParams.StartDate;
            var end       = reportParams.EndDate;
            var dateRange = start.GetValueOrDefault().ToShortDateString() + " - " + end.GetValueOrDefault().ToShortDateString();

            if (reportParams.TimePeriod != null)
            {
                reportParams.TimePeriod.GetRange(out start, out end);
                dateRange = reportParams.TimePeriod.DisplayName;
            }
            var ageRange = _resourcesManager.GetResourceManagerByName(reportName).GetString("NA");

            if (reportParams.AgeRangeLow != null && reportParams.AgeRangeHigh != null)
            {
                ageRange = reportParams.AgeRangeLow + " - " + reportParams.AgeRangeHigh;
            }
            var gender = _resourcesManager.GetResourceManagerByName(reportName).GetString("NA");

            if (!string.IsNullOrWhiteSpace(reportParams.Gender))
            {
                gender = reportParams.Gender;
            }
            data.AssessmentParameter   = _resourcesManager.GetResourceManagerByName(reportName).GetString("Assessment") + ": " + reportParams.AssessmentName;
            data.DateRangeParameter    = _resourcesManager.GetResourceManagerByName(reportName).GetString("DateRange") + ": " + dateRange;
            data.RiskCategoryParameter = _resourcesManager.GetResourceManagerByName(reportName).GetString("RiskCategory") + ": " + GetScoreTypeValue(reportParams);
            data.AgeGroupParameter     = _resourcesManager.GetResourceManagerByName(reportName).GetString("AgeGroup") + ": " + ageRange;
            data.GenderParameter       = _resourcesManager.GetResourceManagerByName(reportName).GetString("Gender") + ": " + gender;

            data.ReportName           = _resourcesManager.GetResourceManagerByName(reportName).GetString("ReportName");
            data.HeaderName           = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderName");
            data.HeaderAge            = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderAge");
            data.HeaderGender         = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderGender");
            data.HeaderScore          = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderScore");
            data.HeaderChart          = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderChart");
            data.HeaderChange         = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderChange");
            data.HeaderDate           = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderDate");
            data.HeaderViewAssessment = _resourcesManager.GetResourceManagerByName(reportName).GetString("HeaderViewAssessment");
        }
Exemple #3
0
        private XRTableRow GetHeaderRow(PatientScoreRangeData source)
        {
            var headerFont   = new Font("Times New Roman", 13F);
            var trHeader     = new XRTableRow();
            var tdNameHeader = new XRTableCell
            {
                Text          = source.HeaderName,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomLeft,
                Font          = headerFont,
                SizeF         = new Size(NameHeaderWidth, Height),
            };

            trHeader.Cells.Add(tdNameHeader);
            var tdAgeHeader = new XRTableCell
            {
                Text          = source.HeaderAge,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomCenter,
                Font          = headerFont
            };

            trHeader.Cells.Add(tdAgeHeader);
            var tdGenderHeader = new XRTableCell
            {
                Text          = source.HeaderGender,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomCenter,
                Font          = headerFont
            };

            trHeader.Cells.Add(tdGenderHeader);
            var tdScoreHeader = new XRTableCell
            {
                Text          = source.HeaderScore,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomCenter,
                Font          = headerFont
            };

            trHeader.Cells.Add(tdScoreHeader);
            var tdChangeHeader = new XRTableCell
            {
                Text          = source.HeaderChange,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomCenter,
                Font          = headerFont
            };

            trHeader.Cells.Add(tdChangeHeader);
            var tdDateHeader = new XRTableCell
            {
                Text          = source.HeaderDate,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomLeft,
                Font          = headerFont
            };

            trHeader.Cells.Add(tdDateHeader);
            var tdViewHeader = new XRTableCell
            {
                Text          = source.HeaderViewAssessment,
                CanGrow       = true,
                Borders       = BorderSide.Bottom,
                BorderWidth   = 3,
                BorderColor   = Color.DarkGray,
                TextAlignment = TextAlignment.BottomCenter,
                Font          = headerFont
            };

            trHeader.Cells.Add(tdViewHeader);
            return(trHeader);
        }