public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new CrpTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.LCRP = CreateResultReadingforInputValues((int)ReadingLabels.LCRP, customerEventReadingEntities); return(testResult); }
public void LoadCrpResult(CrpTestResult testResult, HtmlDocument doc, List <OrderedPair <long, string> > technicianIdNamePairs, bool isFromNewBloodLab) { if (testResult != null) { HtmlNode selectedNode; if (isFromNewBloodLab) { selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='crpNewLab-rpp-section']"); if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0)) { selectedNode.SetAttributeValue("style", "display:block;"); } } else { selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='crp-rpp-section']"); if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0)) { selectedNode.SetAttributeValue("style", "display:block;"); } } _resultPdfHelper.SetInputBox(doc, "crptextbox", testResult.LCRP); _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Crp, "crpUnableToScreen", testResult.UnableScreenReason); _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpCrp", "criticalCrp", "physicianRemarksCrp"); _resultPdfHelper.SetTechnician(doc, testResult, "techCrp", "technotesCrp", technicianIdNamePairs); var selectedNodes = doc.DocumentNode.SelectNodes("//span[@id='crp-rpp-resultspan']"); if (selectedNodes != null && testResult.LCRP != null && !string.IsNullOrEmpty(testResult.LCRP.Reading)) { foreach (var node in selectedNodes) { node.InnerHtml = testResult.LCRP.Reading.Replace("<", "<").Replace(">", ">"); } } } else { _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Crp, "crpUnableToScreen", null); } }
private void ParseDataForCrp(DataRow dr, BloodTestResultParserLog log, long customerId, long eventId) { bool isTestPurchasedByCustomer = _testResultService.IsTestPurchasedByCustomer(eventId, customerId, (long)TestType.Crp); var isEmpty = IsDataRowItemEmpty(dr[ColumnCrp]); string message; if (isEmpty && !isTestPurchasedByCustomer) { _logger.Info(string.Format("For Customer Id {0} - EventId {1}, no data for CRP", customerId, eventId)); return; } if (isEmpty) { message = string.Format("For Customer Id {0} - EventId {1}, no data for CRP", customerId, eventId); _logger.Info(message); AppendTestResultLog(log, message, false); } else if (!isTestPurchasedByCustomer) { message = string.Format("CRP is not availed by CustomerId {0} - EventId {1}", customerId, eventId); AppendTestResultLog(log, message, false); _logger.Info(message); } else { var testResult = new CrpTestResult { LCRP = new ResultReading <string>(ReadingLabels.LCRP) { ReadingSource = ReadingSource.Automatic, Reading = dr[ColumnCrp].ToString() } }; _resultParserHelper.AddTestResulttoEventCustomerAggregate(_eventCustomerScreeningAggregates, eventId, customerId, testResult); _resultParserHelper.AddResultArchiveLog("", TestType.Crp, customerId, MedicalEquipmentTag.Bloodworks); } }