示例#1
0
        public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity)
        {
            var testResult = new PsaTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId);
            var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList();

            testResult.PSASCR = CreateResultReadingforInputValues((int)ReadingLabels.PSASCR, customerEventReadingEntities);
            return(testResult);
        }
示例#2
0
        private void ParseDataForPsa(DataRow dr, BloodTestResultParserLog log, long customerId, long eventId)
        {
            bool   isTestPurchasedByCustomer = _testResultService.IsTestPurchasedByCustomer(eventId, customerId, (long)TestType.Psa);
            var    isEmpty = IsDataRowItemEmpty(dr[ColumnPsa]);
            string message;

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

            if (isEmpty)
            {
                message = string.Format("For Customer Id {0}, no data for PSA", customerId);
                _logger.Info(message);
                AppendTestResultLog(log, message, false);
            }
            else if (!isTestPurchasedByCustomer)
            {
                message = string.Format("PSA is not availed by CustomerId {0} EventId {1}", customerId, eventId);
                AppendTestResultLog(log, message, false);
                _logger.Info(message);
            }
            else
            {
                var testResult = new PsaTestResult
                {
                    PSASCR = new ResultReading <string>(ReadingLabels.PSASCR)
                    {
                        ReadingSource = ReadingSource.Automatic,
                        Reading       = dr[ColumnPsa].ToString()
                    }
                };
                _resultParserHelper.AddTestResulttoEventCustomerAggregate(_eventCustomerScreeningAggregates, eventId, customerId, testResult);
            }
        }
示例#3
0
        public void LoadPsaResult(PsaTestResult testResult, HtmlDocument doc, List <OrderedPair <long, string> > technicianIdNamePairs, bool isFromNewBloodLab, bool isHanson)
        {
            if (testResult != null)
            {
                HtmlNode selectedNode;
                if (!isHanson) // Old case
                {
                    if (isFromNewBloodLab)
                    {
                        selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='psaNewLab-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='psa-rpp-section']");
                        if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0))
                        {
                            selectedNode.SetAttributeValue("style", "display:block;");
                        }
                    }

                    _resultPdfHelper.SetInputBox(doc, "psatextbox", testResult.PSASCR);
                    _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Psa, "psaUnableToScreen", testResult.UnableScreenReason);
                    _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpPsa", "criticalPsa", "physicianRemarksPsa");
                    _resultPdfHelper.SetTechnician(doc, testResult, "techPsa", "technotesPsa", technicianIdNamePairs);

                    var selectedNodes = doc.DocumentNode.SelectNodes("//span[@id='psa-rpp-resultspan']");
                    if (selectedNodes != null && testResult.PSASCR != null && !string.IsNullOrEmpty(testResult.PSASCR.Reading))
                    {
                        foreach (var node in selectedNodes)
                        {
                            node.InnerHtml = testResult.PSASCR.Reading.Replace("<", "&lt;").Replace(">", "&gt;");
                        }
                    }
                }
                else // New case
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='psaHensonsection-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.SetInputBox(doc, "psatextbox", testResult.PSASCR);
                    _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Psa, "psaUnableToScreen", testResult.UnableScreenReason);
                    _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpPsa", "criticalPsa", "physicianRemarksPsa");
                    _resultPdfHelper.SetTechnician(doc, testResult, "techPsa", "technotesPsa", technicianIdNamePairs);

                    var selectedNodes = doc.DocumentNode.SelectNodes("//span[@id='psa-rpp-resultspan']");
                    if (selectedNodes != null && testResult.PSASCR != null && !string.IsNullOrEmpty(testResult.PSASCR.Reading))
                    {
                        foreach (var node in selectedNodes)
                        {
                            node.InnerHtml = testResult.PSASCR.Reading.Replace("<", "&lt;").Replace(">", "&gt;");
                        }
                    }

                    var chkPsaNormalNodes   = doc.DocumentNode.SelectSingleNode("//input[@id='chkPsaNormal']");
                    var chkPsaAbNormalNodes = doc.DocumentNode.SelectSingleNode("//input[@id='chkPsaAbNormal']");
                    if (selectedNodes != null && testResult.PSASCR != null && !string.IsNullOrEmpty(testResult.PSASCR.Reading))
                    {
                        var PSASCRReading = Convert.ToDecimal(testResult.PSASCR.Reading);

                        if (PSASCRReading > 4)
                        {
                            chkPsaAbNormalNodes.SetAttributeValue("checked", "checked");
                        }
                        else
                        {
                            chkPsaNormalNodes.SetAttributeValue("checked", "checked");
                        }
                    }
                }
            }
            else
            {
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Psa, "psaUnableToScreen", null);
            }
        }