예제 #1
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);
            }
        }
예제 #2
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");
            }
        }
예제 #3
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);
            }
        }
예제 #4
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);
            }
        }
예제 #5
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);
            }
        }