Esempio n. 1
0
        private void LoadFloChecAbiFindings(HtmlDocument doc, StandardFinding <decimal> finding, IEnumerable <StandardFinding <decimal> > standardFindingList, long findingIdForLongDescription = 0, bool isTestPurchased = true,
                                            UnableScreenReason unableScreenReason = null)
        {
            if (standardFindingList == null)
            {
                standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal>((int)TestType.FloChecABI);
            }

            standardFindingList = standardFindingList.OrderBy(f => f.Id).ToList();
            StandardFinding <decimal> findingForLongDescription = null;

            if (findingIdForLongDescription > 0)
            {
                findingForLongDescription = standardFindingList.SingleOrDefault(sf => sf.Id == findingIdForLongDescription);
            }

            if (finding != null)
            {
                var stdFinding = standardFindingList.Single(f => f.Id == finding.Id);

                var selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='FloChecAbi-rpp-resultspan']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = stdFinding.Label;
                }

                //todo: docletter-abi
                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='docletter-abi']");
                if (stdFinding.ResultInterpretation != null && stdFinding.ResultInterpretation.Value != (long)ResultInterpretation.Normal && selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }
            }

            _resultPdfHelper.SetSummaryFindings(doc, finding, standardFindingList, "FindingsFloChecAbiDiv", "longdescription-FloChecAbi", findingForLongDescription, isTestPurchased, unableScreenReason);
            _resultPdfHelper.SetFindingsVertical(doc, finding, standardFindingList, "FloChecAbiFinding");
        }
Esempio n. 2
0
        public void SetSummaryFindings <T>(HtmlDocument doc, StandardFinding <T> findingInDb, IEnumerable <StandardFinding <T> > findingsCollection, string containerId, string descriptionboxid = "", StandardFinding <T> findingForLongDescription = null, bool isTestPurchased = true, UnableScreenReason unableScreenReason = null, bool showAdditionalImagesNeeded = false, bool showConsiderOtherModalities = false)
        {
            string htmlRows        = "";
            string longdescription = "";

            foreach (var standardFinding in findingsCollection)
            {
                string rowString = "<input type='checkbox' /> " + standardFinding.Label;
                if (findingInDb != null && findingInDb.Id == standardFinding.Id)
                {
                    rowString       = "<input type='checkbox' checked='checked' /> " + standardFinding.Label;
                    longdescription = standardFinding.LongDescription;
                }
                htmlRows = htmlRows + rowString;
            }

            var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='" + containerId + "']");

            if (selectedNode != null)
            {
                selectedNode.InnerHtml = htmlRows;
            }

            if (showAdditionalImagesNeeded)
            {
                longdescription = "<i>" + LongDescriptionAdditionalImagesNeeded + "</i>";
            }
            else if (showConsiderOtherModalities)
            {
                longdescription = "<i>" + LongDescriptionConsiderOtherModalities + "</i>";
            }
            else if (unableScreenReason != null)
            {
                longdescription = string.IsNullOrEmpty(unableScreenReason.Description) ? "<i>" + LongDescriptionFortestnotScreened + "</i>" : unableScreenReason.Description;
            }
            else if (findingForLongDescription != null && !string.IsNullOrEmpty(findingForLongDescription.LongDescription))
            {
                longdescription = findingForLongDescription.LongDescription;
            }
            else if (!isTestPurchased)
            {
                longdescription = "<i>" + LongDescriptionFortestnotPurchased + "</i>";
            }

            if (!string.IsNullOrEmpty(descriptionboxid) && !string.IsNullOrEmpty(longdescription))
            {
                selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='" + descriptionboxid + "']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = longdescription;
                }
            }
        }
Esempio n. 3
0
        private void LoadLipidFinding(HtmlDocument doc, LipidTestResult testResult, bool isMale)
        {
            var hdlFinding       = _standardFindingRepository.GetAllStandardFindings <string>((int)TestType.Lipid, (int)ReadingLabels.HDL);
            var ldlFinding       = _standardFindingRepository.GetAllStandardFindings <int?>((int)TestType.Lipid, (int)ReadingLabels.LDL);
            var glucoseFinding   = _standardFindingRepository.GetAllStandardFindings <int?>((int)TestType.Lipid, (int)ReadingLabels.Glucose);
            var trigFinding      = _standardFindingRepository.GetAllStandardFindings <string>((int)TestType.Lipid, (int)ReadingLabels.TriGlycerides);
            var totalCholFinding = _standardFindingRepository.GetAllStandardFindings <string>((int)TestType.Lipid, (int)ReadingLabels.TotalCholestrol);
            var tcHdlFinding     = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.Lipid, (int)ReadingLabels.TCHDLRatio);

            hdlFinding = FilterMaleFemalRecordsontheGenderBasis(hdlFinding, isMale).ToList();

            UnableScreenReason unableScreenReason = null;

            if (testResult != null && testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0)
            {
                unableScreenReason = testResult.UnableScreenReason.First();
            }

            StandardFinding <string> hdlFindingForLongDescription = null;
            int t = 0;

            if (testResult != null && testResult.HDL != null && !string.IsNullOrEmpty(testResult.HDL.Reading) && int.TryParse(testResult.HDL.Reading, out t))
            {
                var findingIds = _testResultService.GetMultipleCalculatedStandardFinding(t, (int)TestType.Lipid, (int)ReadingLabels.HDL);
                if (findingIds != null && findingIds.Count() > 0)
                {
                    hdlFindingForLongDescription = hdlFinding.Where(fd => findingIds.Contains(fd.Id)).SingleOrDefault();
                }
            }
            _resultPdfHelper.SetSummaryFindings(doc, testResult != null && testResult.HDL != null ? testResult.HDL.Finding : null, hdlFinding, "FindingsHdlDiv", "longdescription-hdl", hdlFindingForLongDescription, testResult != null, unableScreenReason);
            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.HDL != null ? testResult.HDL.Finding : null, hdlFinding, "hdlFinding");



            StandardFinding <int?> ldlFindingForLongDescription = null;

            if (testResult != null && testResult.LDL != null && testResult.LDL.Reading.HasValue)
            {
                var findingId = _testResultService.GetCalculatedStandardFinding(testResult.LDL.Reading, (int)TestType.Lipid, (int)ReadingLabels.LDL);
                if (findingId > 0)
                {
                    ldlFindingForLongDescription = ldlFinding.Where(fd => findingId == fd.Id).SingleOrDefault();
                }
            }
            _resultPdfHelper.SetSummaryFindings(doc, testResult != null && testResult.LDL != null ? testResult.LDL.Finding : null, ldlFinding, "FindingsLdlDiv", "longdescription-ldl", ldlFindingForLongDescription, testResult != null, unableScreenReason);
            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.LDL != null ? testResult.LDL.Finding : null, ldlFinding, "ldlFinding");


            StandardFinding <int?> glucoseFindingForLongDescription = null;

            if (testResult != null && testResult.Glucose != null && testResult.Glucose.Reading.HasValue)
            {
                var findingId = _testResultService.GetCalculatedStandardFinding(testResult.Glucose.Reading, (int)TestType.Lipid, (int)ReadingLabels.Glucose);
                if (findingId > 0)
                {
                    glucoseFindingForLongDescription = glucoseFinding.Where(fd => findingId == fd.Id).SingleOrDefault();
                }
            }
            _resultPdfHelper.SetSummaryFindings(doc, testResult != null && testResult.Glucose != null ? testResult.Glucose.Finding : null, glucoseFinding, "FindingsGlucoseDiv", "longdescription-glucose", glucoseFindingForLongDescription, testResult != null, unableScreenReason);
            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.Glucose != null ? testResult.Glucose.Finding : null, glucoseFinding, "glucoseFinding");

            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.TriGlycerides != null ? testResult.TriGlycerides.Finding : null, trigFinding, "triglyceridesFinding");
            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.TotalCholestrol != null ? testResult.TotalCholestrol.Finding : null, totalCholFinding, "totalCholestrolFinding");
            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.TCHDLRatio != null ? testResult.TCHDLRatio.Finding : null, tcHdlFinding, "tchdlRatioFinding");
        }
Esempio n. 4
0
        private void LoadAwvEkgFindings(HtmlDocument doc, StandardFinding <int?> finding, bool isTestPurchased = true, UnableScreenReason unableScreenReason = null)
        {
            var standardFindingList = _standardFindingRepository.GetAllStandardFindings <int?>(Convert.ToInt32(TestType.AwvEkg));

            if (finding != null)
            {
                var stdFinding = standardFindingList.Single(f => f.Id == finding.Id);

                var selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='AwvEkg-rpp-resultspan']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = stdFinding.Label;
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='docletter-AwvEkg']");
                if (stdFinding.ResultInterpretation != null && stdFinding.ResultInterpretation.Value != (long)ResultInterpretation.Normal && selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }
            }

            _resultPdfHelper.SetSummaryFindings(doc, finding, standardFindingList, "FindingsAwvEkgDiv", "longdescription-AwvEkg", null, isTestPurchased, unableScreenReason);
            _resultPdfHelper.SetFindingsHorizontal(doc, finding, standardFindingList, "AwvEkgFinding");
        }
Esempio n. 5
0
        private void LoadLeadFindings(HtmlDocument doc, LeadTestResult testResult, bool isTestPurchased = true)
        {
            var standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal>((int)TestType.Lead, (int)ReadingLabels.Left);

            StandardFinding <decimal> leftFinding  = null;
            StandardFinding <decimal> rightFinding = null;

            if (testResult != null)
            {
                if (testResult.LeftResultReadings != null && testResult.LeftResultReadings.Finding != null)
                {
                    leftFinding = testResult.LeftResultReadings.Finding;
                }
                if (testResult.RightResultReadings != null && testResult.RightResultReadings.Finding != null)
                {
                    rightFinding = testResult.RightResultReadings.Finding;
                }
            }

            StandardFinding <decimal> finding = leftFinding != null && rightFinding != null
                                          ? (leftFinding.Id > rightFinding.Id ? leftFinding : rightFinding)
                                          : (leftFinding ?? rightFinding);

            UnableScreenReason unableScreenReason = null;

            //TODO: This is a hack for U Screen Text on Stroke Summary
            if (testResult != null && testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 && testResult.UnableScreenReason.Where(us => us.Reason == UnableToScreenReason.TechnicallyLimitedImages).Count() < 1)
            {
                unableScreenReason = testResult.UnableScreenReason.First();
            }

            _resultPdfHelper.SetSummaryFindings(doc, finding, standardFindingList, "FindingsLeadDiv", "long-description-lead", null, isTestPurchased, unableScreenReason);

            HtmlNode selectedNode;

            if (finding != null)
            {
                var stdFinding = standardFindingList.Where(f => f.Id == finding.Id).Single();

                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='lead-rpp-resultspan']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = stdFinding.Label;
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='docletter-lead']");
                if (stdFinding.ResultInterpretation != null && stdFinding.ResultInterpretation.Value != (long)ResultInterpretation.Normal && selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }
            }

            string htmlRows          = "";
            string strokeDescription = "<fieldset><legend>STENOSIS RANGE</legend><Table>";

            foreach (var standardFinding in standardFindingList)
            {
                string rowString = "<tr>";
                strokeDescription += "<tr>";
                if (rightFinding != null && rightFinding.Id == standardFinding.Id)
                {
                    rowString += "<td> <input type='checkbox' checked='checked' /> </td>";
                }
                else
                {
                    rowString += "<td> <input type='checkbox' /> </td>";
                }

                if (leftFinding != null && leftFinding.Id == standardFinding.Id)
                {
                    rowString += "<td> <input type='checkbox' checked='checked' /> </td>";
                }
                else
                {
                    rowString += "<td> <input type='checkbox' /> </td>";
                }

                rowString += "<td> " + standardFinding.Label + " " + standardFinding.Description + "</td></tr>";

                htmlRows = htmlRows + rowString;
            }

            strokeDescription += "</Table></fieldset>";

            selectedNode = doc.DocumentNode.SelectSingleNode("//table[@id='leadFinding']");
            if (selectedNode != null)
            {
                selectedNode.InnerHtml += htmlRows;
            }

            selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='leadFindingDescriptionDiv']");
            if (selectedNode != null)
            {
                selectedNode.InnerHtml += strokeDescription;
            }

            if (leftFinding != null)
            {
                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='lead-at-a-glance-finding-left']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = leftFinding.Label;
                }
            }

            if (rightFinding != null)
            {
                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='lead-at-a-glance-finding-right']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = rightFinding.Label;
                }
            }

            if (finding != null)
            {
                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='lead-at-a-glance-result']");
                if (selectedNode != null && testResult.ResultInterpretation.HasValue)
                {
                    selectedNode.InnerHtml = ((ResultInterpretation)testResult.ResultInterpretation).ToString();
                }
            }
        }
Esempio n. 6
0
        private void LoadAwvAaaFindings(HtmlDocument doc, long eventId, long customerId, StandardFinding <decimal?> finding = null, IEnumerable <StandardFinding <int> > aortaRangeSaggitalView = null, IEnumerable <StandardFinding <int> > aortaRangeTransverseView = null, decimal?maxAortaSize = null, bool isTestPurchased = true, UnableScreenReason unableScreenReason = null, IEnumerable <StandardFinding <int> > peakSystolicVelocityStandardFindings = null)
        {
            List <StandardFinding <decimal?> > standardFindingList;

            if (_settings.AwvAaaFindingChangeDate.HasValue)
            {
                var eventCustomerResult = _eventCustomerResultRepository.GetByCustomerIdAndEventId(customerId, eventId);
                if (eventCustomerResult != null && eventCustomerResult.DataRecorderMetaData.DateCreated < _settings.AwvAaaFindingChangeDate.Value)
                {
                    standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaSize, _settings.AwvAaaFindingChangeDate.Value, true);
                }
                else
                {
                    standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaSize, _settings.AwvAaaFindingChangeDate.Value, false);
                }
            }
            else
            {
                standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaSize);
            }


            StandardFinding <decimal?> findingForLongDescription = null;

            if (maxAortaSize.HasValue)
            {
                var findingId = _testResultService.GetCalculatedStandardFinding(eventId, customerId, maxAortaSize, (int)TestType.AwvAAA, (int)ReadingLabels.AortaSize);
                if (findingId > 0)
                {
                    findingForLongDescription = standardFindingList.SingleOrDefault(sf => sf.Id == findingId);
                }
            }

            _resultPdfHelper.SetSummaryFindings(doc, finding, standardFindingList, "FindingsAwvAaaDiv", "long-description-AwvAaa", findingForLongDescription, isTestPurchased, unableScreenReason);
            _resultPdfHelper.SetFindingsVertical(doc, finding, standardFindingList, "AwvAaaFinding");

            if (finding != null)
            {
                var stdFinding = standardFindingList.Single(f => f.Id == finding.Id);

                var selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='AwvAaa-rpp-resultspan']");
                if (selectedNode != null)
                {
                    selectedNode.InnerHtml = stdFinding.Label;
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='docletter-AwvAaa']");
                if (stdFinding.ResultInterpretation != null && stdFinding.ResultInterpretation.Value != (long)ResultInterpretation.Normal && selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }
            }

            var sViewStandardFindingList = _standardFindingRepository.GetAllStandardFindings <int>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeSaggitalView);

            _resultPdfHelper.SetFindingsHorizontal(doc, aortaRangeSaggitalView, sViewStandardFindingList, "AwvAaaSagitalView");

            var tViewStandardFindingList = _standardFindingRepository.GetAllStandardFindings <int>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeTransverseView);

            _resultPdfHelper.SetFindingsHorizontal(doc, aortaRangeTransverseView, tViewStandardFindingList, "AwvAaaTransverseView");

            var peakSystolicVelocityStandardFindingsList = _standardFindingRepository.GetAllStandardFindings <int>((int)TestType.AwvAAA, (int)ReadingLabels.PeakSystolicVelocitySaggitalView);

            _resultPdfHelper.SetFindingsHorizontal(doc, peakSystolicVelocityStandardFindings, peakSystolicVelocityStandardFindingsList, "AwvAaaPeakSystolicVelocityStandardFindings");
        }