public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new VitaminDTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.VitD = CreateResultReadingforInputValues((int)ReadingLabels.VitD, customerEventReadingEntities); testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public void LoadVitaminDResult(VitaminDTestResult testResult, HtmlDocument doc, List <OrderedPair <long, string> > technicianIdNamePairs, bool isFromNewBloodLab) { if (testResult != null) { HtmlNode selectedNode; if (isFromNewBloodLab) { selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='VitaminDNewLab-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;"); } } else { selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='VitaminD-rpp-section']"); if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false)) { selectedNode.SetAttributeValue("style", "display:block;"); } } _resultPdfHelper.SetInputBox(doc, "VitaminDtextbox", testResult.VitD); _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.VitaminD, "VitaminDUnableToScreen", testResult.UnableScreenReason); _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpVitaminD", "criticalVitaminD", "physicianRemarksVitaminD"); _resultPdfHelper.SetTechnician(doc, testResult, "techVitaminD", "technotesVitaminD", technicianIdNamePairs); var selectedNodes = doc.DocumentNode.SelectNodes("//span[@id='VitaminD-rpp-resultspan']"); if (selectedNodes != null && testResult.VitD != null && !string.IsNullOrEmpty(testResult.VitD.Reading)) { foreach (var node in selectedNodes) { node.InnerHtml = testResult.VitD.Reading.Replace("<", "<").Replace(">", ">"); } } } else { _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.VitaminD, "VitaminDUnableToScreen", null); } }
private void ParseDataForVitaminD(DataRow dr, BloodTestResultParserLog log, long customerId, long eventId) { var isEmpty = IsDataRowItemEmpty(dr[ColumnVitaminD]); var isTestPurchasedByCustomer = _testResultService.IsTestPurchasedByCustomer(eventId, customerId, (long)TestType.VitaminD); string message; if (isEmpty && !isTestPurchasedByCustomer) { message = string.Format("For Customer Id {0}-Event Id {1}, no data for VitaminD", customerId, eventId); _logger.Info(message); return; } if (isEmpty) { message = string.Format("For Customer Id {0}-Event Id {1}, no data for VitaminD", customerId, eventId); _logger.Info(message); AppendTestResultLog(log, message, false); } else if (!isTestPurchasedByCustomer) { message = string.Format("VitaminD is not availed by CustomerId {0} - Event id {1}", customerId, eventId); _logger.Info(message); AppendTestResultLog(log, message); } else { var testResult = new VitaminDTestResult { VitD = new ResultReading <string>(ReadingLabels.VitD) { ReadingSource = ReadingSource.Automatic, Reading = dr[ColumnVitaminD].ToString() } }; _resultParserHelper.AddTestResulttoEventCustomerAggregate(_eventCustomerScreeningAggregates, eventId, customerId, testResult); _resultParserHelper.AddResultArchiveLog("", TestType.VitaminD, customerId, MedicalEquipmentTag.Bloodworks); } }