public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity)
        {
            var testResult = new ThyroidTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId);
            var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList();

            testResult.TSHSCR = CreateResultReadingforInputValues((int)ReadingLabels.TSHSCR, customerEventReadingEntities);

            return(testResult);
        }
Beispiel #2
0
        public void LoadThyroidResult(ThyroidTestResult testResult, HtmlDocument doc, List <OrderedPair <long, string> > technicianIdNamePairs, bool isFromNewBloodLab)
        {
            if (testResult != null)
            {
                HtmlNode selectedNode;
                if (isFromNewBloodLab)
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='thyroidNewLab-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='thyroid-rpp-section']");
                    if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0))
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }


                _resultPdfHelper.SetInputBox(doc, "thyroidtextbox", testResult.TSHSCR);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Thyroid, "thyroidUnableToScreen", testResult.UnableScreenReason);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpThyroid", "criticalThyroid", "physicianRemarksThyroid");
                _resultPdfHelper.SetTechnician(doc, testResult, "techThyroid", "technotesThyroid", technicianIdNamePairs);

                var selectedNodes = doc.DocumentNode.SelectNodes("//span[@id='thyroid-rpp-resultspan']");
                if (selectedNodes != null && testResult.TSHSCR != null && !string.IsNullOrEmpty(testResult.TSHSCR.Reading))
                {
                    foreach (var node in selectedNodes)
                    {
                        node.InnerHtml = testResult.TSHSCR.Reading.Replace("<", "&lt;").Replace(">", "&gt;");
                    }
                }
            }
            else
            {
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Thyroid, "thyroidUnableToScreen", null);
            }
        }
Beispiel #3
0
        public TestResult Parse()
        {
            bool isExceptionCaused;
            var  resultImages = _mediaHelper.GetMediaforTest(Directory.GetParent(_pathToReportXmlFile).Parent.FullName, _mediaLocation, TestType.Thyroid.ToString(), out isExceptionCaused);
            var  testResult   = new ThyroidTestResult();

            if (resultImages != null && resultImages.Count() > 0)
            {
                testResult.ResultMedia = resultImages;
            }
            else
            {
                testResult = null;
            }

            if (isExceptionCaused)
            {
                _errorSummary += "Media Extraction Failed. ";
            }

            return(testResult);
        }
Beispiel #4
0
        private void ParseDataForThyroid(DataRow dr, BloodTestResultParserLog log, long customerId, long eventId)
        {
            var    isTestPurchasedByCustomer = _testResultService.IsTestPurchasedByCustomer(eventId, customerId, (long)TestType.Thyroid);
            var    isEmpty = IsDataRowItemEmpty(dr[ColumnThyroid]);
            string message;

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

            if (isEmpty)
            {
                message = string.Format("For Customer Id {0} - EventId {1}, no data for TSH", customerId, eventId);
                AppendTestResultLog(log, message, false);
                _logger.Info(message);
            }
            else if (!isTestPurchasedByCustomer)
            {
                message = string.Format("TSH is not availed by CustomerId {0} - EventId {1}.", customerId, eventId);
                AppendTestResultLog(log, message, false);
                _logger.Info(message);
            }
            else
            {
                var testResult = new ThyroidTestResult
                {
                    TSHSCR = new ResultReading <string>(ReadingLabels.TSHSCR)
                    {
                        ReadingSource = ReadingSource.Automatic,
                        Reading       = dr[ColumnThyroid].ToString()
                    }
                };
                _resultParserHelper.AddTestResulttoEventCustomerAggregate(_eventCustomerScreeningAggregates, eventId, customerId, testResult);
            }
        }