Exemplo n.º 1
0
        public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity)
        {
            var testResult = new TestosteroneTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId);
            var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList();

            testResult.TESTSCRE = CreateResultReadingforInputValues((int)ReadingLabels.TESTSCRE, customerEventReadingEntities);
            return(testResult);
        }
Exemplo n.º 2
0
        public void LoadTestosteroneResult(TestosteroneTestResult testResult, HtmlDocument doc, List <OrderedPair <long, string> > technicianIdNamePairs, bool isFromNewBloodLab)
        {
            if (testResult != null)
            {
                HtmlNode selectedNode;
                if (isFromNewBloodLab)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='testosteroneNewLab-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='testosterone-rpp-section']");
                    if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0))
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }

                _resultPdfHelper.SetInputBox(doc, "testosteronetextbox", testResult.TESTSCRE);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Testosterone, "testosteroneUnableToScreen", testResult.UnableScreenReason);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpTestosterone", "criticalTestosterone", "physicianRemarksTestosterone");
                _resultPdfHelper.SetTechnician(doc, testResult, "techTestosterone", "technotesTestosterone", technicianIdNamePairs);

                var selectedNodes = doc.DocumentNode.SelectNodes("//span[@id='testosterone-rpp-resultspan']");
                if (selectedNodes != null && testResult.TESTSCRE != null && !string.IsNullOrEmpty(testResult.TESTSCRE.Reading))
                {
                    foreach (var node in selectedNodes)
                    {
                        node.InnerHtml = testResult.TESTSCRE.Reading.Replace("<", "&lt;").Replace(">", "&gt;");
                    }
                }
            }
            else
            {
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Testosterone, "testosteroneUnableToScreen", null);
            }
        }
Exemplo n.º 3
0
        private void ParseDataForTestosterone(DataRow dr, BloodTestResultParserLog log, long customerId, long eventId)
        {
            var    isEmpty = IsDataRowItemEmpty(dr[ColumnTestosterone]);
            var    isTestPurchasedByCustomer = _testResultService.IsTestPurchasedByCustomer(eventId, customerId, (long)TestType.Testosterone);
            string message;

            if (isEmpty && !isTestPurchasedByCustomer)
            {
                message = string.Format("For Customer Id {0}-Event Id {1}, no data for Testosterone", customerId, eventId);
                _logger.Info(message);
                return;
            }

            if (isEmpty)
            {
                message = string.Format("For Customer Id {0}-Event Id {1}, no data for Testosterone", customerId, eventId);
                _logger.Info(message);
                AppendTestResultLog(log, message, false);
            }
            else if (!isTestPurchasedByCustomer)
            {
                message = string.Format("Testosterone is not availed by CustomerId {0} - Event id {1}", customerId, eventId);
                _logger.Info(message);
                AppendTestResultLog(log, message);
            }
            else
            {
                var testResult = new TestosteroneTestResult
                {
                    TESTSCRE = new ResultReading <string>(ReadingLabels.TESTSCRE)
                    {
                        ReadingSource = ReadingSource.Automatic,
                        Reading       = dr[ColumnTestosterone].ToString()
                    }
                };
                _resultParserHelper.AddTestResulttoEventCustomerAggregate(_eventCustomerScreeningAggregates, eventId, customerId, testResult);
                _resultParserHelper.AddResultArchiveLog("", TestType.Testosterone, customerId, MedicalEquipmentTag.Bloodworks);
            }
        }