public void LoadAwvLipidResult(HtmlDocument doc, AwvLipidTestResult testResult, bool isMale, List <OrderedPair <long, string> > technicianIdNamePairs, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians, IEnumerable <EventPhysicianTest> eventPhysicianTests, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluations, CustomerSkipReview customerSkipReview) { LoadAwvLipidFinding(doc, testResult, isMale); if (testResult != null) { var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvLipid-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, "AwvLipid-primaryEvalPhysicianSign", "AwvLipid-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluations, customerSkipReview); _resultPdfHelper.SetInputBox(doc, "AwvLipidTotalCholestrolInputText", testResult.TotalCholestrol); _resultPdfHelper.SetInputBox(doc, "AwvLipidLDLInputText", testResult.LDL); _resultPdfHelper.SetInputBox(doc, "AwvLipidHDLInputText", testResult.HDL); _resultPdfHelper.SetInputBox(doc, "AwvLipidTriglyceridesInputText", testResult.TriGlycerides); _resultPdfHelper.SetInputBox(doc, "AwvLipidTCHDLRatioInputText", testResult.TCHDLRatio); _resultPdfHelper.SetTechnician(doc, testResult, "techAwvLipid", "technotesAwvLipid", technicianIdNamePairs); _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpAwvLipid", "criticalAwvLipid", "physicianRemarksAwvLipid"); _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvLipid, "AwvLipidUnableToScreen", testResult.UnableScreenReason); } else { _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvLipid, "AwvLipidUnableToScreen", null); } }
public TestResult GetAwvLipidTestResultDomain(KynHealthAssessmentEditModel model, AwvLipidTestResult inpersistence, long uploadedby, bool isNewResultFlow) { if (!IsLipidReadingProvided(model) && inpersistence == null) { return(inpersistence); } decimal?tchol = null; decimal?hdl = null; decimal?triglycerides = null; if (inpersistence == null) { inpersistence = new AwvLipidTestResult { ResultStatus = new TestResultState { StateNumber = isNewResultFlow ? (int)NewTestResultStateNumber.ResultEntryPartial : (int)TestResultStateNumber.ManualEntry } }; } inpersistence.TotalCholestrol = GetTotalColesterolReading(model.TotalCholesterol, ref tchol); inpersistence.HDL = GetHdlReading(model.HDLCholesterol, ref hdl); inpersistence.TriGlycerides = GetTriglyceridesReading(model.Triglycerides, ref triglycerides); inpersistence.TCHDLRatio = CalculateTchdlRatio(tchol, hdl, TestType.AwvLipid); inpersistence.LDL = CalculateLdlReading(hdl, tchol, triglycerides, TestType.AwvLipid); inpersistence.DataRecorderMetaData = SetDataRecorderMetaData(inpersistence.DataRecorderMetaData, uploadedby); inpersistence.ResultStatus.DataRecorderMetaData = SetDataRecorderMetaData(inpersistence.ResultStatus.DataRecorderMetaData, uploadedby); return(inpersistence); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestsEntity) { var customerEventReadingEntities = customerEventScreeningTestsEntity.CustomerEventReading.ToList(); var testResult = new AwvLipidTestResult(customerEventScreeningTestsEntity.CustomerEventScreeningTestId); var standardFindingTestReadingEntities = customerEventScreeningTestsEntity. StandardFindingTestReadingCollectionViaCustomerEventReading.ToList(); var totalCholesterolData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.TotalCholestrol). SingleOrDefault(); if (totalCholesterolData != null) { testResult.TotalCholestrol = CreateTestReadingforaIntValue(totalCholesterolData, (int)ReadingLabels.TotalCholestrol, standardFindingTestReadingEntities, totalCholesterolData.Value); } var hdlData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.HDL). SingleOrDefault(); if (hdlData != null) { testResult.HDL = CreateTestReadingforaIntValue(hdlData, (int)ReadingLabels.HDL, standardFindingTestReadingEntities, hdlData.Value); } var ldlData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.LDL). SingleOrDefault(); if (ldlData != null) { testResult.LDL = CreateTestReadingforaIntValue(ldlData, (int)ReadingLabels.LDL, standardFindingTestReadingEntities, (string.IsNullOrEmpty(ldlData.Value) ? null : (int?)Convert.ToInt32(ldlData.Value))); } var triglyceridesData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.TriGlycerides). SingleOrDefault(); if (triglyceridesData != null) { testResult.TriGlycerides = CreateTestReadingforaIntValue(triglyceridesData, (int)ReadingLabels.TriGlycerides, standardFindingTestReadingEntities, triglyceridesData.Value); } var tchdlratioData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.TCHDLRatio). SingleOrDefault(); if (tchdlratioData != null) { testResult.TCHDLRatio = CreateTestReadingforaDecimalValue(tchdlratioData, (int)ReadingLabels.TCHDLRatio, standardFindingTestReadingEntities, (string.IsNullOrEmpty(tchdlratioData.Value) ? null : (decimal?)Convert.ToDecimal(tchdlratioData.Value))); } return(testResult); }
private void LoadAwvLipidFinding(HtmlDocument doc, AwvLipidTestResult testResult, bool isMale) { var hdlFinding = _standardFindingRepository.GetAllStandardFindings <string>((int)TestType.AwvLipid, (int)ReadingLabels.HDL); var ldlFinding = _standardFindingRepository.GetAllStandardFindings <int?>((int)TestType.AwvLipid, (int)ReadingLabels.LDL); var trigFinding = _standardFindingRepository.GetAllStandardFindings <string>((int)TestType.AwvLipid, (int)ReadingLabels.TriGlycerides); var totalCholFinding = _standardFindingRepository.GetAllStandardFindings <string>((int)TestType.AwvLipid, (int)ReadingLabels.TotalCholestrol); var tcHdlFinding = _standardFindingRepository.GetAllStandardFindings <decimal?>((int)TestType.AwvLipid, (int)ReadingLabels.TCHDLRatio); hdlFinding = FilterMaleFemalRecordsontheGenderBasis(hdlFinding, isMale).ToList(); _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.HDL != null ? testResult.HDL.Finding : null, hdlFinding, "AwvLipidHdlFinding"); _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.LDL != null ? testResult.LDL.Finding : null, ldlFinding, "AwvLipidLdlFinding"); _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.TriGlycerides != null ? testResult.TriGlycerides.Finding : null, trigFinding, "AwvLipidTriglyceridesFinding"); _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.TotalCholestrol != null ? testResult.TotalCholestrol.Finding : null, totalCholFinding, "AwvLipidTotalCholestrolFinding"); _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.TCHDLRatio != null ? testResult.TCHDLRatio.Finding : null, tcHdlFinding, "AwvLipidTchdlRatioFinding"); }
public PcpResultExportModel SetAwvLipidData(PcpResultExportModel model, AwvLipidTestResult testResult, bool useBlankValue = false) { if (testResult.TotalCholestrol != null) { if (testResult.TotalCholestrol.Reading != null) { model.AwvLipidTotalCholesterol = testResult.TotalCholestrol.Reading; } if (testResult.TotalCholestrol.Finding != null) { model.AwvLipidTotalCholesterolFinding = testResult.TotalCholestrol.Finding.Label; } } if (testResult.HDL != null) { if (testResult.HDL.Reading != null) { model.AwvLipidHdl = testResult.HDL.Reading; } if (testResult.HDL.Finding != null) { model.AwvLipidHdlFinding = testResult.HDL.Finding.Label.Replace("Male", "").Replace("Female", "").Replace("-", "").Trim(); } } if (testResult.LDL != null) { if (testResult.LDL.Reading != null) { model.AwvLipidLdl = testResult.LDL.Reading.ToString(); } if (testResult.LDL.Finding != null) { model.AwvLipidLdlFinding = testResult.LDL.Finding.Label; } } if (testResult.TriGlycerides != null) { if (testResult.TriGlycerides.Reading != null) { model.AwvLipidTriGlycerides = testResult.TriGlycerides.Reading; } if (testResult.TriGlycerides.Finding != null) { model.AwvLipidTriglyceridesFinding = testResult.TriGlycerides.Finding.Label; } } if (testResult.TCHDLRatio != null) { if (testResult.TCHDLRatio.Reading != null && testResult.TCHDLRatio.Reading.HasValue) { model.AwvLipidTchdlRatio = testResult.TCHDLRatio.Reading.Value.ToString("0.0"); } if (testResult.TCHDLRatio.Finding != null) { model.AwvLipidTcHdlFinding = testResult.TCHDLRatio.Finding.Label; } } if (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0) { model.AwvLipidUnabletoScreen = PcpResultExportHelper.YesString; } else if (!useBlankValue) { model.AwvLipidUnabletoScreen = PcpResultExportHelper.NoString; } if ((testResult.ResultStatus != null && testResult.ResultStatus.SelfPresent) || (testResult.PhysicianInterpretation != null && testResult.PhysicianInterpretation.IsCritical)) { model.AwvLipidCritical = PcpResultExportHelper.YesString; } else if (!useBlankValue) { model.AwvLipidCritical = PcpResultExportHelper.NoString; } return(model); }