Exemplo n.º 1
0
        public void SetPhysicianSignature(HtmlDocument doc, string priamryPhysicianContainerId, string overReadPhysicianControlId, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians,
                                          IEnumerable <EventPhysicianTest> eventPhysicianTests, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview)
        {
            if (physicians == null || physicians.Count() < 1)
            {
                return;
            }

            var physicianUrl = StringforContentDirectory + "/";

            if (eventPhysicianTests != null && eventPhysicianTests.Any())
            {
                try
                {
                    var eventPhysicianTest = eventPhysicianTests.First();

                    var physician    = physicians.First(p => p.PhysicianId == eventPhysicianTest.PhysicianId);
                    var selectedNode = doc.DocumentNode.SelectSingleNode("//td[@id='" + priamryPhysicianContainerId + "']");

                    if (selectedNode != null)
                    {
                        var htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + "</span>";

                        if (customerSkipReview != null)
                        {
                            htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + customerSkipReview.DateCreated.ToString("MM/dd/yyyy") + " at " + customerSkipReview.DateCreated.ToString("hh:mm tt") + "  </span>";
                        }
                        else
                        {
                            var evaluationTime = GetPhysicianEvaluationTime(eventCustomerPhysicianEvaluations, physician.PhysicianId);
                            if (evaluationTime != null)
                            {
                                htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + evaluationTime.Value.ToString("MM/dd/yyyy") + " at " + evaluationTime.Value.ToString("hh:mm tt") + "  </span>";
                            }
                        }


                        selectedNode.InnerHtml = htmlString;
                    }

                    eventPhysicianTest = eventPhysicianTests.ElementAtOrDefault(1);
                    if (eventPhysicianTest != null)
                    {
                        physician    = physicians.First(p => p.PhysicianId == eventPhysicianTest.PhysicianId);;
                        selectedNode = doc.DocumentNode.SelectSingleNode("//td[@id='" + overReadPhysicianControlId + "']");

                        if (selectedNode != null && physician != null)
                        {
                            var htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " </span>";

                            if (customerSkipReview != null)
                            {
                                htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + customerSkipReview.DateCreated.ToString("MM/dd/yyyy") + " at " + customerSkipReview.DateCreated.ToString("hh:mm tt") + "</span>";
                            }
                            else
                            {
                                var evaluationTime = GetPhysicianEvaluationTime(eventCustomerPhysicianEvaluations, physician.PhysicianId);
                                if (evaluationTime != null)
                                {
                                    htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + evaluationTime.Value.ToString("MM/dd/yyyy") + " at " + evaluationTime.Value.ToString("hh:mm tt") + "</span>";
                                }
                            }

                            selectedNode.InnerHtml = htmlString;
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                var physician    = physicians.First();
                var selectedNode = doc.DocumentNode.SelectSingleNode("//td[@id='" + priamryPhysicianContainerId + "']");

                if (selectedNode != null)
                {
                    var htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " </span>";;

                    if (customerSkipReview != null)
                    {
                        htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + customerSkipReview.DateCreated.ToString("MM/dd/yyyy") + " at " + customerSkipReview.DateCreated.ToString("hh:mm tt") + "</span>";
                    }
                    else
                    {
                        var evaluationTime = GetPhysicianEvaluationTime(eventCustomerPhysicianEvaluations, physician.PhysicianId);
                        if (evaluationTime != null)
                        {
                            htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + evaluationTime.Value.ToString("MM/dd/yyyy") + " at " + evaluationTime.Value.ToString("hh:mm tt") + "</span>";
                        }
                    }

                    selectedNode.InnerHtml = htmlString;
                }

                physician    = physicians.ElementAtOrDefault(1);
                selectedNode = doc.DocumentNode.SelectSingleNode("//td[@id='" + overReadPhysicianControlId + "']");
                if (selectedNode != null && physician != null)
                {
                    var htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " </span>";

                    if (customerSkipReview != null)
                    {
                        htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + customerSkipReview.DateCreated.ToString("MM/dd/yyyy") + " at " + customerSkipReview.DateCreated.ToString("hh:mm tt") + "</span>";
                    }
                    else
                    {
                        var evaluationTime = GetPhysicianEvaluationTime(eventCustomerPhysicianEvaluations, physician.PhysicianId);
                        if (evaluationTime != null)
                        {
                            htmlString = "<img src='" + physicianUrl + physician.PhysicianSignatureFilePath + "' style='width:200px; height:60px;' alt='' /> <span style='display:block;'> By: " + physician.PhysicianName + " On " + evaluationTime.Value.ToString("MM/dd/yyyy") + " at " + evaluationTime.Value.ToString("hh:mm tt") + "</span>";
                        }
                    }


                    selectedNode.InnerHtml = htmlString;
                }
            }
        }
Exemplo n.º 2
0
        public void LoadLipidResult(HtmlDocument doc, LipidTestResult testResult, bool isMale, List <OrderedPair <long, string> > technicianIdNamePairs, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians,
                                    IEnumerable <EventPhysicianTest> eventPhysicianTests, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview)
        {
            LoadLipidFinding(doc, testResult, isMale);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='lipid-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "lipid-primaryEvalPhysicianSign", "lipid-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview);

                _resultPdfHelper.SetInputBox(doc, "TotalCholestrolLipidInputText", testResult.TotalCholestrol);
                _resultPdfHelper.SetInputBox(doc, "TCHDLRatioLipidInputText", testResult.TCHDLRatio);
                _resultPdfHelper.SetInputBox(doc, "HDLLipidInputText", testResult.HDL);
                _resultPdfHelper.SetInputBox(doc, "LDLLipidInputText", testResult.LDL);
                _resultPdfHelper.SetInputBox(doc, "GlucoseLipidInputText", testResult.Glucose);
                _resultPdfHelper.SetInputBox(doc, "TriglyceridesLipidInputText", testResult.TriGlycerides);

                _resultPdfHelper.SetTechnician(doc, testResult, "techlipid", "technoteslipid", technicianIdNamePairs);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpLipid", "criticalLipid", "physicianRemarksLipid");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Lipid, "lipidUnableToScreen", testResult.UnableScreenReason);
            }
            else
            {
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Lipid, "lipidUnableToScreen", null);
            }
        }
Exemplo n.º 3
0
        public void LoadMyBioCheckResult(HtmlDocument doc, MyBioAssessmentTestResult testResult, bool isMale, List <OrderedPair <long, string> > technicianIdNamePairs, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians,
                                         IEnumerable <EventPhysicianTest> eventPhysicianTests, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview)
        {
            LoadMyBioCheckFinding(doc, testResult, isMale);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='mybiocheck-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "mybiocheck-primaryEvalPhysicianSign", "mybiocheck-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview);

                _resultPdfHelper.SetInputBox(doc, "mybiocheckTotalCholestrolInputText", testResult.TotalCholestrol);
                _resultPdfHelper.SetInputBox(doc, "mybiocheckTCHDLRatioInputText", testResult.TcHdlRatio);
                _resultPdfHelper.SetInputBox(doc, "mybiocheckHDLInputText", testResult.Hdl);
                _resultPdfHelper.SetInputBox(doc, "mybiocheckLDLInputText", testResult.Ldl);
                _resultPdfHelper.SetInputBox(doc, "mybiocheckGlucoseInputText", testResult.Glucose);
                _resultPdfHelper.SetInputBox(doc, "mybiocheckTriglyceridesInputText", testResult.TriGlycerides);

                _resultPdfHelper.SetTechnician(doc, testResult, "techmybiocheck", "technotesmybiocheck", technicianIdNamePairs);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpmybiocheck", "criticalmybiocheck", "physicianRemarksmybiocheck");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.MyBioCheckAssessment, "mybiocheckUnableToScreen", testResult.UnableScreenReason);
            }
            else
            {
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.MyBioCheckAssessment, "mybiocheckUnableToScreen", null);
            }
        }
Exemplo n.º 4
0
        public void LoadPadTestResults(HtmlDocument doc, PADTestResult testResult, bool removeLongDescription, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests,
                                       List <OrderedPair <long, string> > technicianIdNamePairs, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview)
        {
            var incidentalFindings = _incidentalFindingRepository.GetAllIncidentalFinding((int)TestType.PAD);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='pad-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='rpp-eus-pad-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "pad-primaryEvalPhysicianSign", "pad-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview);

                var     readings = new TestResultRepository().GetAllReadings((int)TestType.PAD);
                decimal?leftAbi  = null;
                decimal?rightAbi = null;

                foreach (var resultReading in readings)
                {
                    switch (resultReading.Label)
                    {
                    case ReadingLabels.LeftABI:
                        if (testResult.LeftResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "txtLeftAbi", testResult.LeftResultReadings.ABI);

                            if (testResult.LeftResultReadings.ABI != null && testResult.LeftResultReadings.ABI.Reading.HasValue)
                            {
                                leftAbi = testResult.LeftResultReadings.ABI.Reading;

                                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='pad-at-a-glance-finding-left']");
                                if (selectedNode != null)
                                {
                                    selectedNode.InnerHtml = testResult.LeftResultReadings.ABI.Reading.Value.ToString("0.00");
                                }
                            }
                        }
                        break;

                    case ReadingLabels.SystolicLArm:
                        if (testResult.LeftResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "txtSystolicLeftArm", testResult.LeftResultReadings.SystolicArm);
                        }
                        break;

                    case ReadingLabels.SystolicLAnkle:
                        if (testResult.LeftResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "txtSystolicLeftAnkle", testResult.LeftResultReadings.SystolicAnkle);
                        }
                        break;

                    case ReadingLabels.RightABI:
                        if (testResult.RightResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "txtRightAbi", testResult.RightResultReadings.ABI);
                            if (testResult.RightResultReadings.ABI != null && testResult.RightResultReadings.ABI.Reading.HasValue)
                            {
                                rightAbi = testResult.RightResultReadings.ABI.Reading;

                                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='pad-at-a-glance-finding-right']");
                                if (selectedNode != null)
                                {
                                    selectedNode.InnerHtml = testResult.RightResultReadings.ABI.Reading.Value.ToString("0.00");
                                }
                            }
                        }
                        break;

                    case ReadingLabels.SystolicRArm:
                        if (testResult.RightResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "txtSystolicRightArm", testResult.RightResultReadings.SystolicArm);
                        }
                        break;

                    case ReadingLabels.SystolicRAnkle:
                        if (testResult.RightResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "txtSystolicRightAnkle", testResult.RightResultReadings.SystolicAnkle);
                        }
                        break;

                    case ReadingLabels.SystolicHighestArm:
                        _resultPdfHelper.SetInputBox(doc, "systolicHighestArm", testResult.SystolicHighestArm);
                        break;

                    case ReadingLabels.RepeatStudy:
                        _resultPdfHelper.SetCheckBox(doc, "RepeatStudyPadInputCheck", testResult.RepeatStudy);
                        break;

                    case ReadingLabels.LeftUnabletoOcclude:
                        if (testResult.LeftResultReadings != null)
                        {
                            _resultPdfHelper.SetCheckBox(doc, "leftunabletoocclude-checkbox", testResult.LeftResultReadings.UnabletoOcclude);
                        }

                        break;

                    case ReadingLabels.RightUnabletoOcclude:
                        if (testResult.RightResultReadings != null)
                        {
                            _resultPdfHelper.SetCheckBox(doc, "rightunabletoocclude-checkbox", testResult.RightResultReadings.UnabletoOcclude);
                        }

                        break;
                    }
                }

                decimal?abi;
                long    leftFindingId = 0;
                if (leftAbi != null)
                {
                    leftFindingId = _testResultService.GetCalculatedStandardFinding(leftAbi.Value, (int)TestType.PAD, null);
                }

                long rightFindingId = 0;
                if (rightAbi != null)
                {
                    rightFindingId = _testResultService.GetCalculatedStandardFinding(rightAbi.Value, (int)TestType.PAD, null);
                }

                var standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal>((int)TestType.PAD);

                long findingId = 0;

                if (leftFindingId == rightFindingId)
                {
                    findingId = leftFindingId;
                }
                else if (leftFindingId > 0 && rightFindingId > 0)
                {
                    var lf = standardFindingList.Where(f => f.Id == leftFindingId).Single();
                    var rf = standardFindingList.Where(f => f.Id == rightFindingId).Single();

                    findingId = lf.WorstCaseOrder > rf.WorstCaseOrder ? lf.Id : rf.Id;
                }
                else
                {
                    findingId = leftFindingId > rightFindingId ? leftFindingId : rightFindingId;
                }

                if (findingId > 0 && findingId == leftFindingId)
                {
                    abi = leftAbi;
                }
                else
                {
                    abi = rightAbi;
                }

                _resultPdfHelper.SetInputBox(doc, "abi-pad-summary", new ResultReading <decimal?> {
                    Reading = abi
                });
                LoadPadFindings(doc, testResult.Finding, standardFindingList, findingId, true, (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 ? testResult.UnableScreenReason.First() : null));
                _resultPdfHelper.SetTechnician(doc, testResult, "techPad", "technotespad", technicianIdNamePairs);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, testResult.IncidentalFindings, "padIncidentalFinding");
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpPad", "criticalPad", "physicianRemarksPad");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.PAD, "padUnableToScreen", testResult.UnableScreenReason);

                if (testResult.IncidentalFindings != null && testResult.IncidentalFindings.Count() > 0)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='incidentalfinding-description-pad']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }
                if (testResult.Finding != null)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='pad-at-a-glance-result']");
                    if (selectedNode != null && testResult.ResultInterpretation.HasValue)
                    {
                        selectedNode.InnerHtml = ((ResultInterpretation)testResult.ResultInterpretation).ToString();
                    }


                    selectedNode = doc.DocumentNode.SelectSingleNode("//img[@id='pad-at-a-glance-findingImage']");
                    if (selectedNode != null)
                    {
                        if (testResult.Finding.Label.ToLower() == PadNormal.ToLower())
                        {
                            selectedNode.SetAttributeValue("src", StringforContentDirectory + "/NMMSV_N.png");
                        }
                        else if (testResult.Finding.Label.ToLower() == PadMild.ToLower())
                        {
                            selectedNode.SetAttributeValue("src", StringforContentDirectory + "/NMMSV_M.png");
                        }
                        else if (testResult.Finding.Label.ToLower() == PadModerate.ToLower())
                        {
                            selectedNode.SetAttributeValue("src", StringforContentDirectory + "/NMMSV_MD.png");
                        }
                        else if (testResult.Finding.Label.ToLower() == PadSevere.ToLower())
                        {
                            selectedNode.SetAttributeValue("src", StringforContentDirectory + "/NMMSV_S.png");
                        }
                        else
                        {
                            selectedNode.SetAttributeValue("src", StringforContentDirectory + "/NoIndication_NMMSV.png");
                        }
                    }
                }

                if (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='pad-at-a-glance-finding']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:none;");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='pad-at-a-glance-unabletoscreen']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='pad-at-a-glance-result']");
                    if (selectedNode != null)
                    {
                        selectedNode.InnerHtml = "N/A";
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//img[@id='pad-at-a-glance-findingImage']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("src", StringforContentDirectory + "/NoIndication_NMMSV.png");
                    }
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='pad-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }
            }
            else
            {
                LoadPadFindings(doc, null, null, 0, false);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.PAD, "padUnableToScreen", null);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, null, "padIncidentalFinding");
            }
        }
Exemplo n.º 5
0
        public void LoadFloChecAbiTestResults(HtmlDocument doc, FloChecABITestResult testResult, bool removeLongDescription, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests,
                                              List <OrderedPair <long, string> > technicianIdNamePairs, bool loadImages, bool showUnreadableTest, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview)
        {
            var incidentalFindings = _incidentalFindingRepository.GetAllIncidentalFinding((int)TestType.FloChecABI);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='FloChecAbi-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }


                _resultPdfHelper.SetPhysicianSignature(doc, "FloChecAbi-primaryEvalPhysicianSign", "FloChecAbi-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview);

                var     readings = new TestResultRepository().GetAllReadings((int)TestType.FloChecABI);
                decimal?leftAbi  = null;
                decimal?rightAbi = null;

                foreach (var resultReading in readings)
                {
                    switch (resultReading.Label)
                    {
                    case ReadingLabels.LeftABI:
                        if (testResult.LeftResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "FloChecAbitxtLeftFootdABI", testResult.LeftResultReadings.ABI);

                            if (testResult.LeftResultReadings.ABI != null && testResult.LeftResultReadings.ABI.Reading.HasValue)
                            {
                                leftAbi = testResult.LeftResultReadings.ABI.Reading;
                            }
                        }
                        break;

                    case ReadingLabels.LeftHandBFI:
                        if (testResult.LeftResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "FloChecAbitxtLeftHandBFI", testResult.LeftResultReadings.BFI);
                        }
                        break;

                    case ReadingLabels.RightABI:
                        if (testResult.RightResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "FloChecAbitxtRightFootdABI", testResult.RightResultReadings.ABI);

                            if (testResult.RightResultReadings.ABI != null && testResult.RightResultReadings.ABI.Reading.HasValue)
                            {
                                rightAbi = testResult.RightResultReadings.ABI.Reading;
                            }
                        }
                        break;

                    case ReadingLabels.RightHandBFI:
                        if (testResult.RightResultReadings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "FloChecAbitxtRightHandBFI", testResult.RightResultReadings.BFI);
                        }
                        break;

                    case ReadingLabels.RepeatStudy:
                        _resultPdfHelper.SetCheckBox(doc, "RepeatStudyFloChecAbiInputCheck", testResult.RepeatStudy);
                        break;
                    }
                }

                long leftFindingId = 0;
                if (leftAbi != null)
                {
                    leftFindingId = _testResultService.GetCalculatedStandardFinding(leftAbi.Value, (int)TestType.FloChecABI, null);
                }

                long rightFindingId = 0;
                if (rightAbi != null)
                {
                    rightFindingId = _testResultService.GetCalculatedStandardFinding(rightAbi.Value, (int)TestType.FloChecABI, null);
                }

                var standardFindingList = _standardFindingRepository.GetAllStandardFindings <decimal>((int)TestType.FloChecABI);

                long findingId = 0;

                if (leftFindingId == rightFindingId)
                {
                    findingId = leftFindingId;
                }
                else if (leftFindingId > 0 && rightFindingId > 0)
                {
                    var lf = standardFindingList.Single(f => f.Id == leftFindingId);
                    var rf = standardFindingList.Single(f => f.Id == rightFindingId);

                    findingId = lf.WorstCaseOrder > rf.WorstCaseOrder ? lf.Id : rf.Id;
                }
                else
                {
                    findingId = leftFindingId > rightFindingId ? leftFindingId : rightFindingId;
                }

                LoadFloChecAbiFindings(doc, testResult.Finding, standardFindingList, findingId, true, (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 ? testResult.UnableScreenReason.First() : null));
                _resultPdfHelper.SetTechnician(doc, testResult, "techFloChecAbi", "technotesFloChecAbi", technicianIdNamePairs);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, testResult.IncidentalFindings, "FloChecAbiIncidentalFinding");
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpFloChecAbi", "criticalFloChecAbi", "physicianRemarksFloChecAbi");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.FloChecABI, "FloChecAbiUnableToScreen", testResult.UnableScreenReason);

                if (testResult.IncidentalFindings != null && testResult.IncidentalFindings.Any())
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='incidentalfinding-description-FloChecAbi']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }

                if (testResult.ResultImage != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (showUnreadableTest || testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    _resultPdfHelper.LoadTestMedia(doc, new[] { testResult.ResultImage }, "testmedia-FloChecAbi", loadImages);
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='FloChecAbi-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }
            }
            else
            {
                LoadFloChecAbiFindings(doc, null, null, 0, false);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.FloChecABI, "FloChecAbiUnableToScreen", null);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, null, "FloChecAbiIncidentalFinding");
            }
        }
Exemplo n.º 6
0
        public void LoadHPyloriTestresults(HtmlDocument doc, HPyloriTestResult testResult, bool removeLongDescription, bool loadImages, List <OrderedPair <long, string> > technicianIdNamePairs,
                                           IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview)
        {
            var standardFindingList = _standardFindingRepository.GetAllStandardFindings <int>((int)TestType.HPylori);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='HPylori-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='rpp-eus-HPylori-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "HPylori-primaryEvalPhysicianSign", "HPylori-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview);

                _resultPdfHelper.SetCheckBox(doc, "TechnicallyLimitedbutReadableHPyloriInputCheck", testResult.TechnicallyLimitedbutReadable);
                _resultPdfHelper.SetCheckBox(doc, "RepeatStudyHPyloriInputCheck", testResult.RepeatStudy);

                _resultPdfHelper.SetTechnician(doc, testResult, "techHPylori", "technotesHPylori", technicianIdNamePairs);
                _resultPdfHelper.SetFindingsVertical(doc, testResult.Finding, standardFindingList, "HPyloriFinding");
                _resultPdfHelper.SetSummaryFindings(doc, testResult.Finding, standardFindingList, "finding-HPylori-div", "long-description-HPylori", null, true, (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 ? testResult.UnableScreenReason.First() : null));
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpHPylori", "criticalHPylori", "physicianRemarksHPylori");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.HPylori, "HPyloriUnableToScreen", testResult.UnableScreenReason);

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

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

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='HPylori-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }
            }
            else
            {
                _resultPdfHelper.SetFindingsVertical(doc, null, standardFindingList, "HPyloriFinding");
                _resultPdfHelper.SetSummaryFindings(doc, null, standardFindingList, "finding-HPylori-div", "longdescription-HPylori", null, false);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.HPylori, "HPyloriUnableToScreen", null);
            }
        }
Exemplo n.º 7
0
        public void LoadAwvEkgTestResults(HtmlDocument doc, AwvEkgTestResult testResult, bool removeLongDescription, List <OrderedPair <long, string> > technicianIdNamePairs,
                                          bool loadImages, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests,
                                          bool showUnreadableTest, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluation, CustomerSkipReview customerSkipReview, string stringforMediaDirectory)
        {
            var bbbFindings = _standardFindingRepository.GetAllStandardFindings <int>((Int32)TestType.AwvEkg, (Int32)ReadingLabels.BundleBranchBlock);
            var ipFindings  = _standardFindingRepository.GetAllStandardFindings <int>((Int32)TestType.AwvEkg, (Int32)ReadingLabels.InfarctionPattern);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvEkg-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='rpp-eus-AwvEkg-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "AwvEkg-primaryEvalPhysicianSign", "AwvEkg-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluation, customerSkipReview);

                LoadAwvEkgFindings(doc, testResult.Finding, true, (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 ? testResult.UnableScreenReason.First() : null));

                _resultPdfHelper.SetInputBox(doc, "AwvEkgprIntervalTextbox", testResult.PRInterval);
                _resultPdfHelper.SetInputBox(doc, "AwvEkgventRateTextbox", testResult.VentRate);
                _resultPdfHelper.SetInputBox(doc, "AwvEkgqrsDurationTextbox", testResult.QRSDuration);
                _resultPdfHelper.SetInputBox(doc, "AwvEkgqtIntervalTextbox", testResult.QTInterval);
                _resultPdfHelper.SetInputBox(doc, "AwvEkgqtcInterval", testResult.QTcInterval);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgReversedLeadInputCheck", testResult.ReversedLeads);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgRepeatStudyInputCheck", testResult.RepeatStudy);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgArtifactInputCheck", testResult.Artifact);
                _resultPdfHelper.SetCheckBox(doc, "ComparetoPrevAwvEkgInputCheck", testResult.ComparetoEkg);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSinusRythmInputCheck", testResult.SinusRythm);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSinusArrythmiaInputCheck", testResult.SinusArrythmia);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSinusBradycardiaInputCheck", testResult.SinusBradycardia);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgMarkedInputCheck", testResult.Marked);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSinusTachycardiaInputCheck", testResult.SinusTachycardia);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgAtrialFibrillationInputCheck", testResult.AtrialFibrillation);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgAtrialFlutterInputCheck", testResult.AtrialFlutter);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSupraventriculaCheckbox", testResult.SupraventricularArrythmia);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSvtInputCheck", testResult.SVT);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgPacInputCheck", testResult.PACs);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgPvcInputCheck", testResult.PVCs);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgPacerRythmCheckbox", testResult.PacerRythm);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgBundleBranchBlockCheckbox", testResult.BundleBranchBlock);

                _resultPdfHelper.SetFindingsHorizontal(doc, testResult.BundleBranchBlockFinding, bbbFindings, "AwvEkgBundleBranchBlockFinding", 3);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgQrsWideningInputCheck", testResult.QRSWidening);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLeftAxisInputCheck", testResult.LeftAxis);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgRightAxisInputCheck", testResult.RightAxis);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgAbnormalAxisInputCheck", testResult.AbnormalAxis);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLeftInputCheck", testResult.Left);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgRightInputCheck", testResult.Right);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLeftAnteriorfasicularBlockCheckbox", testResult.LeftAnteriorFasicularBlock);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgHeartBlockInputCheck", testResult.HeartBlock);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgFirstDegreeBlockInputCheck", testResult.FirstDegreeBlock);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgSecondDegreeBlockCheckbox", testResult.SecondDegreeBlock);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgTypeIIInputCheck", testResult.TypeII);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgThirdDegreeBlockInputCheck", testResult.ThirdDegreeCompleteHeartBlock);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgVentricularCheckbox", testResult.VentricularHypertrophy);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLeftVentricularCheckbox", testResult.LeftVentricularHypertrophy);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgRightVentricularCheckbox", testResult.RightVentricularHypertrophy);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgProlongedQTCheckbox", testResult.ProlongedQTInterval);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgISchemicSttCheckbox", testResult.IschemicSTTChanges);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgNonSpecificSttCheckbox", testResult.NonSpecificSTTChanges);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgPoorRWaveProgressionCheckbox", testResult.PoorRWaveProgression);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgInfarctionPatternCheckbox", testResult.InfarctionPattern);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgATypicalWaveCheckbox", testResult.AtypicalQWaveLead);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgAtrialEnlargementCheckbox", testResult.AtrialEnlargement);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLeftAtrialCheckbox", testResult.LeftAtrialEnlargement);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgRightAtrialCheckbox", testResult.RightAtrialEnlargement);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgRepolarizationCheckbox", testResult.RepolarizationVariant);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLowVoltageCheckbox", testResult.LowVoltage);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgLimbLeadsCheckbox", testResult.LimbLeads);
                _resultPdfHelper.SetCheckBox(doc, "AwvEkgPrecordialLeadsCheckbox", testResult.PrecordialLeads);

                _resultPdfHelper.SetCheckBox(doc, "AwvEkgShortPrIntervalCheckbox", testResult.ShortPrInterval);

                _resultPdfHelper.SetFindingsHorizontal(doc, testResult.InfarctionPatternFinding, ipFindings, "AwvEkgInfarctionPatternFinding", 2);

                if (testResult.ResultImage != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (showUnreadableTest || testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    _resultPdfHelper.LoadTestMedia(doc, new[] { testResult.ResultImage }, "testmedia-AwvEkg", loadImages);

                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvEkgReport']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block");
                    }
                    selectedNode = doc.DocumentNode.SelectSingleNode("//img[@id='AwvEkgGraph']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("src", stringforMediaDirectory + "/" + testResult.ResultImage.File.Path);
                    }
                }

                _resultPdfHelper.SetTechnician(doc, testResult, "techAwvEkg", "technotesAwvEkg", technicianIdNamePairs);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvEkg, "AwvEkgUnableToScreen", testResult.UnableScreenReason);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpAwvEkg", "criticalAwvEkg", "AwvEkgPhysicianNotesTextbox");

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvEkg-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }
            }
            else
            {
                LoadAwvEkgFindings(doc, null, false);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvEkg, "AwvEkgUnableToScreen", null);
                _resultPdfHelper.SetFindingsHorizontal(doc, new StandardFinding <int>(), bbbFindings, "AwvEkgBundleBranchBlockFinding", 3);
                _resultPdfHelper.SetFindingsHorizontal(doc, new StandardFinding <int>(), ipFindings, "AwvEkgInfarctionPatternFinding", 2);
            }
        }
Exemplo n.º 8
0
        public void LoadLeadTestresults(HtmlDocument doc, LeadTestResult testResult, bool removeLongDescription, List <OrderedPair <long, string> > technicianIdNamePairs,
                                        bool loadImages, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests,
                                        IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluation, CustomerSkipReview customerSkipReview, DateTime eventDate,
                                        bool isPhysicianPartnerCustomer)
        {
            var findingVelocityLeftList  = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.Lead, (int)ReadingLabels.LeftCFAPSV);
            var findingVelocityRightList = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.Lead, (int)ReadingLabels.RightCFAPSV);
            var incidentalFindings       = _incidentalFindingRepository.GetAllIncidentalFinding((int)TestType.Stroke);

            var selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='LowVelocityLeftLabel']");

            if (selectedNode != null)
            {
                selectedNode.InnerHtml = findingVelocityLeftList.FirstOrDefault().Label;
            }

            selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='LowVelocityRightLabel']");
            if (selectedNode != null)
            {
                selectedNode.InnerHtml = findingVelocityRightList.FirstOrDefault().Label;
            }

            var getAbsValue = new Func <ResultReading <decimal?>, ResultReading <decimal?> >(r =>
            {
                if (r != null && r.Reading != null && r.Reading.Value < 0)
                {
                    r.Reading = r.Reading.Value * -1;
                }

                return(r);
            });


            if (testResult != null)
            {
                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='lead-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='rpp-eus-lead-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "lead-primaryEvalPhysicianSign", "lead-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluation, customerSkipReview);

                var readings = new TestResultRepository().GetAllReadings((int)TestType.Lead);

                foreach (var resultReading in readings)
                {
                    switch (resultReading.Label)
                    {
                    case ReadingLabels.RightCFAPSV:
                        if (testResult.RightResultReadings != null)
                        {
                            testResult.RightResultReadings.CFAPSV = getAbsValue(testResult.RightResultReadings.CFAPSV);
                            _resultPdfHelper.SetInputBox(doc, "RightCFAPSVInputText", testResult.RightResultReadings.CFAPSV);
                        }
                        break;

                    case ReadingLabels.RightPSFAPSV:
                        if (testResult.RightResultReadings != null)
                        {
                            testResult.RightResultReadings.PSFAPSV = getAbsValue(testResult.RightResultReadings.PSFAPSV);
                            _resultPdfHelper.SetInputBox(doc, "RightPSFAPSVInputText", getAbsValue(testResult.RightResultReadings.PSFAPSV));
                        }
                        break;


                    case ReadingLabels.LeftCFAPSV:
                        if (testResult.LeftResultReadings != null)
                        {
                            testResult.LeftResultReadings.CFAPSV = getAbsValue(testResult.LeftResultReadings.CFAPSV);
                            _resultPdfHelper.SetInputBox(doc, "LeftCFAPSVInputText", getAbsValue(testResult.LeftResultReadings.CFAPSV));
                        }
                        break;

                    case ReadingLabels.LeftPSFAPSV:
                        if (testResult.LeftResultReadings != null)
                        {
                            testResult.LeftResultReadings.PSFAPSV = getAbsValue(testResult.LeftResultReadings.PSFAPSV);
                            _resultPdfHelper.SetInputBox(doc, "LeftPSFAPSVInputText", getAbsValue(testResult.LeftResultReadings.PSFAPSV));
                        }
                        break;

                    case ReadingLabels.TechnicallyLimitedbutReadable:
                        _resultPdfHelper.SetCheckBox(doc, "TechnicallyLimitedbutReadableLeadInputCheck", testResult.TechnicallyLimitedbutReadable);
                        break;

                    case ReadingLabels.RepeatStudy:
                        _resultPdfHelper.SetCheckBox(doc, "RepeatStudyLeadInputCheck", testResult.RepeatStudy);
                        break;
                    }
                }


                if (findingVelocityLeftList != null)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//input[@id='LowVelocityLeftCheckbox']");
                    if (selectedNode != null && testResult.LowVelocityLeft != null)
                    {
                        selectedNode.SetAttributeValue("checked", "checked");
                    }
                }

                if (findingVelocityLeftList != null)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//input[@id='LowVelocityRightCheckbox']");
                    if (selectedNode != null && testResult.LowVelocityRight != null)
                    {
                        selectedNode.SetAttributeValue("checked", "checked");
                    }
                }

                _resultPdfHelper.LoadTestMedia(doc, testResult.ResultImages, "testmedia-lead", loadImages);
                LoadLeadIncidentalFindings(doc, incidentalFindings, testResult.IncidentalFindings);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Lead, "leadUnableToScreen", testResult.UnableScreenReason);
                _resultPdfHelper.SetTechnician(doc, testResult, "techlead", "technoteslead", technicianIdNamePairs);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpLead", "criticalLead", "physicianRemarksLead");

                if (testResult.IncidentalFindings != null && testResult.IncidentalFindings.Any())
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='incidentalfinding-description-lead']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//span[@id='diagnosisCodeLead']");

                if (selectedNode != null && testResult.DiagnosisCode != null && !string.IsNullOrEmpty(testResult.DiagnosisCode.Reading))
                {
                    var readingList = testResult.DiagnosisCode.Reading.Split('|');
                    var stBuilder   = string.Empty;

                    foreach (var reading in readingList)
                    {
                        stBuilder = stBuilder + "<br/>" + reading;
                    }

                    selectedNode.InnerHtml = stBuilder;
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='lead-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }

                if (_settings.ChangeLeadReadingDate.HasValue && eventDate.Date >= _settings.ChangeLeadReadingDate.Value)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='diagnosisCodeLeadContainer']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:none");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//table[@id='leadFinding']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:none");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//table[@id='leadFinding-CheckBox']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='lead-longdescription-div']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:none");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='long-description-lead']");
                    if (selectedNode != null)
                    {
                        selectedNode.InnerHtml = "<i>" + LeadLongLongDescription + "</i>";
                    }

                    if (testResult.RightResultReadings != null)
                    {
                        _resultPdfHelper.SetCheckBox(doc, "rightNoVisualPlaque", testResult.RightResultReadings.NoVisualPlaque);
                        _resultPdfHelper.SetCheckBox(doc, "rightVisuallyDemonstratedPlaque", testResult.RightResultReadings.VisuallyDemonstratedPlaque);
                        _resultPdfHelper.SetCheckBox(doc, "rightModerateStenosis", testResult.RightResultReadings.ModerateStenosis);
                        _resultPdfHelper.SetCheckBox(doc, "rightPossibleOcclusion", testResult.RightResultReadings.PossibleOcclusion);
                    }

                    if (testResult.LeftResultReadings != null)
                    {
                        _resultPdfHelper.SetCheckBox(doc, "leftNoVisualPlaque", testResult.LeftResultReadings.NoVisualPlaque);
                        _resultPdfHelper.SetCheckBox(doc, "leftVisuallyDemonstratedPlaque", testResult.LeftResultReadings.VisuallyDemonstratedPlaque);
                        _resultPdfHelper.SetCheckBox(doc, "leftModerateStenosis", testResult.LeftResultReadings.ModerateStenosis);
                        _resultPdfHelper.SetCheckBox(doc, "leftPossibleOcclusion", testResult.LeftResultReadings.PossibleOcclusion);
                    }

                    SetLeadResult(doc, testResult, readings);
                }
                else
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='diagnosisCodeLeadContainer']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//table[@id='leadFinding']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block");
                    }

                    selectedNode = doc.DocumentNode.SelectSingleNode("//table[@id='leadFinding-CheckBox']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:none");
                    }

                    LoadLeadFindings(doc, testResult);
                }

                if (isPhysicianPartnerCustomer)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='ppLead-patient-detail']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block");
                    }
                }
            }
            else
            {
                LoadLeadFindings(doc, null, false);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, null, "leadIncidenatlFindings");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Lead, "leadUnableToScreen", null);
            }
        }
Exemplo n.º 9
0
        public void GenerateTestPdf(TestType testType, TestResult testResult, Event eventData, Customer customer, bool showUnreadableTest,
                                    bool removeLongDescription, bool loadImages, List <OrderedPair <long, string> > technicianIdNamePairs, bool showRepeatStudyCheckbox,
                                    IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests,
                                    IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview, MediaLocation ipResultPdfMediaLocation,
                                    string stringforMediaDirectory, bool isPhysicianPartnerCustomer)
        {
            var resultMedia        = new List <ResultMedia>();
            var testSourceHtmlPath = string.Empty;

            switch (testType)
            {
            case TestType.AwvAAA:
                var awvAaaTestResult = testResult as AwvAaaTestResult;
                if ((awvAaaTestResult.UnableScreenReason == null || awvAaaTestResult.UnableScreenReason.Count == 0) &&
                    (awvAaaTestResult.TestNotPerformed == null || awvAaaTestResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || awvAaaTestResult.RepeatStudy == null || awvAaaTestResult.RepeatStudy.Reading == false))
                {
                    testSourceHtmlPath = _settings.ResultPacketLocation + TestType.AwvAAA.ToString() + ".htm";

                    var awvAaaTestDoc = new HtmlDocument();
                    awvAaaTestDoc.Load(testSourceHtmlPath);

                    _awvAAAResultPdfHelper.LoadAwvAaaTestresults(awvAaaTestDoc, eventData.Id, customer.CustomerId, awvAaaTestResult, removeLongDescription, technicianIdNamePairs, loadImages, physicians, eventPhysicianTests, showUnreadableTest, eventCustomerPhysicianEvaluations, customerSkipReview);

                    if (awvAaaTestResult != null && awvAaaTestResult.ResultImages != null && awvAaaTestResult.ResultImages.Count > 0)
                    {
                        resultMedia.AddRange(awvAaaTestResult.ResultImages);
                    }

                    GeneratePdf(awvAaaTestDoc, ipResultPdfMediaLocation, eventData, customer, TestType.AwvAAA, testSourceHtmlPath, physicians, testResult, resultMedia);
                }
                break;

            case TestType.AwvEcho:
                var awvEchoTestResult = testResult as AwvEchocardiogramTestResult;
                if ((awvEchoTestResult.UnableScreenReason == null || awvEchoTestResult.UnableScreenReason.Count == 0) &&
                    (awvEchoTestResult.TestNotPerformed == null || awvEchoTestResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || awvEchoTestResult.RepeatStudyUnreadable == null || awvEchoTestResult.RepeatStudyUnreadable.Reading == false))
                {
                    testSourceHtmlPath = _settings.ResultPacketLocation + TestType.AwvEcho.ToString() + ".htm";

                    var awvEchoTestDoc = new HtmlDocument();
                    awvEchoTestDoc.Load(testSourceHtmlPath);

                    if (awvEchoTestResult != null && awvEchoTestResult.Media != null && awvEchoTestResult.Media.Count > 0)
                    {
                        resultMedia.AddRange(awvEchoTestResult.Media);
                    }
                    _echoResultPdfHelper.LoadAwvEchoTestResults(awvEchoTestDoc, awvEchoTestResult, removeLongDescription, loadImages, technicianIdNamePairs, physicians, eventPhysicianTests, showUnreadableTest, eventCustomerPhysicianEvaluations, customerSkipReview, customer.CustomerId, eventData.Id);

                    GeneratePdf(awvEchoTestDoc, ipResultPdfMediaLocation, eventData, customer, TestType.AwvEcho, testSourceHtmlPath, physicians, testResult, resultMedia);
                }
                break;

            case TestType.AwvEkg:
                var awvEkgTestResult = testResult as AwvEkgTestResult;
                if ((awvEkgTestResult.UnableScreenReason == null || awvEkgTestResult.UnableScreenReason.Count == 0) && (awvEkgTestResult.TestNotPerformed == null || awvEkgTestResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || awvEkgTestResult.RepeatStudy == null || awvEkgTestResult.RepeatStudy.Reading == false))
                {
                    testSourceHtmlPath = _settings.ResultPacketLocation + TestType.AwvEkg.ToString() + ".htm";

                    var awvEkgTestDoc = new HtmlDocument();
                    awvEkgTestDoc.Load(testSourceHtmlPath);

                    _awvEkgResultPdfHelper.LoadAwvEkgTestResults(awvEkgTestDoc, awvEkgTestResult, removeLongDescription, technicianIdNamePairs, loadImages, physicians, eventPhysicianTests, showUnreadableTest, eventCustomerPhysicianEvaluations, customerSkipReview, stringforMediaDirectory);

                    GeneratePdf(awvEkgTestDoc, ipResultPdfMediaLocation, eventData, customer, TestType.AwvEkg, testSourceHtmlPath, physicians, testResult, resultMedia);
                }
                break;

            case TestType.Lead:
                var leadTestResult = testResult as LeadTestResult;
                if ((leadTestResult.UnableScreenReason == null || leadTestResult.UnableScreenReason.Count == 0) && (leadTestResult.TestNotPerformed == null || leadTestResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (leadTestResult.RepeatStudy == null || leadTestResult.RepeatStudy.Reading == false))
                {
                    testSourceHtmlPath = _settings.ResultPacketLocation + TestType.Lead.ToString() + ".htm";

                    var leadTestDoc = new HtmlDocument();
                    leadTestDoc.Load(testSourceHtmlPath);

                    if (leadTestResult != null && leadTestResult.ResultImages != null && leadTestResult.ResultImages.Count > 0)
                    {
                        resultMedia.AddRange(leadTestResult.ResultImages);
                    }
                    _leadResultPdfHelper.LoadLeadTestresults(leadTestDoc, leadTestResult, removeLongDescription, technicianIdNamePairs, loadImages, physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview, eventData.EventDate, isPhysicianPartnerCustomer);

                    GeneratePdf(leadTestDoc, ipResultPdfMediaLocation, eventData, customer, TestType.Lead, testSourceHtmlPath, physicians, testResult, resultMedia);
                }
                break;
            }
        }
Exemplo n.º 10
0
        public void LoadAwvAaaTestresults(HtmlDocument doc, long eventId, long customerId, AwvAaaTestResult testResult, bool removeLongDescription,
                                          List <OrderedPair <long, string> > technicianIdNamePairs, bool loadImages, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians,
                                          IEnumerable <EventPhysicianTest> eventPhysicianTests, bool showUnreadableTest, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluation,
                                          CustomerSkipReview customerSkipReview)
        {
            var incidentalFindings = _incidentalFindingRepository.GetAllIncidentalFinding((int)TestType.AwvAAA);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvAaa-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='rpp-eus-AwvAaa-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "AwvAaa-primaryEvalPhysicianSign", "AwvAaa-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluation, customerSkipReview);

                var readings = new TestResultRepository().GetAllReadings((int)TestType.AwvAAA);

                foreach (var resultReading in readings)
                {
                    switch (resultReading.Label)
                    {
                    case ReadingLabels.AortaSize:
                        _resultPdfHelper.SetInputBox(doc, "AwvAaaAortaSizeInputText", testResult.AortaSize);
                        _resultPdfHelper.SetInputBox(doc, "aortasize-AwvAaa-summary", testResult.AortaSize);
                        break;

                    case ReadingLabels.TransverseViewDataPointOne:
                        if (testResult.TransverseView != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaTVDatapointOneTextbox", testResult.TransverseView.FirstValue);
                        }
                        break;

                    case ReadingLabels.TransverseViewDataPointTwo:
                        if (testResult.TransverseView != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaTVDatapointTwoTextbox", testResult.TransverseView.SecondValue);
                        }
                        break;

                    case ReadingLabels.AorticDissection:
                        _resultPdfHelper.SetCheckBox(doc, "AwvAaaAorticDissectionCheckbox", testResult.AorticDissection);
                        break;

                    case ReadingLabels.Plaque:
                        _resultPdfHelper.SetCheckBox(doc, "AwvAaaPlaqueCheckbox", testResult.Plaque);
                        break;

                    case ReadingLabels.Thrombus:
                        _resultPdfHelper.SetCheckBox(doc, "AwvAaaThrombusCheckbox", testResult.Thrombus);
                        break;

                    case ReadingLabels.TechnicallyLimitedbutReadable:
                        _resultPdfHelper.SetCheckBox(doc, "TechnicallyLimitedbutReadableAwvAaaInputCheck", testResult.TechnicallyLimitedbutReadable);
                        break;

                    case ReadingLabels.RepeatStudy:
                        _resultPdfHelper.SetCheckBox(doc, "RepeatStudyAwvAaaInputCheck", testResult.RepeatStudy);
                        break;

                    case ReadingLabels.PeakSystolicVelocity:
                        if (testResult.PeakSystolicVelocity != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaPeakSystolicVelocityTextbox", testResult.PeakSystolicVelocity);
                        }
                        break;

                    case ReadingLabels.ResidualLumenTransverseViewDataPointOne:
                        if (testResult.ResidualLumenStandardFindings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaResidualLumenTVDatapointOneTextbox", testResult.ResidualLumenStandardFindings.FirstValue);
                        }
                        break;

                    case ReadingLabels.ResidualLumenTransverseViewDataPointTwo:
                        if (testResult.ResidualLumenStandardFindings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaResidualLumenTVDatapointTwoTextbox", testResult.ResidualLumenStandardFindings.SecondValue);
                        }
                        break;
                    }
                }

                var maxAortaSize = GetMaxofthreeAwvAaaAortaValues(testResult);
                //TODO: This is a hack for U Screen Text on AAA Summary
                LoadAwvAaaFindings(doc, eventId, customerId, testResult.Finding, testResult.AortaRangeSaggitalView, testResult.AortaRangeTransverseView, maxAortaSize, true, (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 && testResult.UnableScreenReason.Count(us => us.Reason == UnableToScreenReason.UnableToTechnicallyVisualize) < 1 ? testResult.UnableScreenReason.First() : null), testResult.PeakSystolicVelocityStandardFindings);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvAAA, "AwvAaaUnableToScreen", testResult.UnableScreenReason);
                _resultPdfHelper.SetTechnician(doc, testResult, "techAwvAaa", "technotesAwvAaa", technicianIdNamePairs);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpAwvAaa", "criticalAwvAaa", "physicianRemarksAwvAaa");
                _resultPdfHelper.LoadTestMedia(doc, testResult.ResultImages, "testmedia-AwvAaa", loadImages);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, testResult.IncidentalFindings, "AwvAaaIncidenatlFindings");

                if (testResult.IncidentalFindings != null && testResult.IncidentalFindings.Any())
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='incidentalfinding-description-AwvAaa']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvAaa-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }
            }
            else
            {
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, null, "AwvAaaIncidenatlFindings");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvAAA, "AwvAaaUnableToScreen", null);
                LoadAwvAaaFindings(doc, eventId, customerId, null, null, null, null, false);
            }
        }