public TestResult GetDiabetesTestResultDomain(KynHealthAssessmentEditModel model, DiabetesTestResult inpersistence, long uploadedby, bool isNewResultFlow)
        {
            if (!IsLipidReadingProvided(model) && inpersistence == null)
            {
                return(inpersistence);
            }

            if (inpersistence == null)
            {
                inpersistence = new DiabetesTestResult
                {
                    ResultStatus = new TestResultState
                    {
                        StateNumber = isNewResultFlow ? (int)NewTestResultStateNumber.ResultEntryPartial : (int)TestResultStateNumber.ManualEntry
                    }
                };
            }

            inpersistence.Glucose = GetGlucoseReading(model.Glucose);

            inpersistence.DataRecorderMetaData = SetDataRecorderMetaData(inpersistence.DataRecorderMetaData, uploadedby);
            inpersistence.ResultStatus.DataRecorderMetaData = SetDataRecorderMetaData(inpersistence.ResultStatus.DataRecorderMetaData, uploadedby);

            return(inpersistence);
        }
예제 #2
0
        private TestResult GetDiabetesTestResult(DiabetesTestResult testResult)
        {
            if (testResult.Glucose == null)
            {
                return(null);
            }

            return(testResult);
        }
예제 #3
0
        public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestsEntity)
        {
            var customerEventReadingEntities = customerEventScreeningTestsEntity.CustomerEventReading.ToList();

            var testResult = new DiabetesTestResult(customerEventScreeningTestsEntity.CustomerEventScreeningTestId);

            var standardFindingTestReadingEntities = customerEventScreeningTestsEntity.StandardFindingTestReadingCollectionViaCustomerEventReading.ToList();


            var glucoseData = customerEventReadingEntities.SingleOrDefault(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.Glucose);

            if (glucoseData != null)
            {
                testResult.Glucose = CreateTestReadingforaIntValue(glucoseData, (int)ReadingLabels.Glucose, standardFindingTestReadingEntities,
                                                                   (string.IsNullOrEmpty(glucoseData.Value) ? null : (int?)Convert.ToInt32(glucoseData.Value)));
            }

            return(testResult);
        }
예제 #4
0
        public void LoadDiabetesResult(HtmlDocument doc, DiabetesTestResult testResult, List <OrderedPair <long, string> > technicianIdNamePairs)
        {
            LoadDiabetesFinding(doc, testResult);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='Diabetes-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, "DiabetesGlucoseInputText", testResult.Glucose);

                _resultPdfHelper.SetTechnician(doc, testResult, "techDiabetes", "technotesDiabetes", technicianIdNamePairs);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpDiabetes", "criticalDiabetes", "physicianRemarksDiabetes");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Diabetes, "DiabetesUnableToScreen", testResult.UnableScreenReason);
            }
            else
            {
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.Diabetes, "DiabetesUnableToScreen", null);
            }
        }
예제 #5
0
        public TestResult Parse(long customerId, string xmlFilePath, TestType testType)
        {
            _lipidParserHelper.SetLogger(_logger);
            _errorSummary = string.Empty;
            _logger.Info(string.Format("------------------------------- {0} Parsing for file [{1}]", testType.ToString(), xmlFilePath));

            if (!File.Exists(xmlFilePath))
            {
                _errorSummary += "File doesn't exist.";
                _logger.Error("File doesn't exist.");
                return(null);
            }

            var doc = new XmlDocument();

            doc.Load(xmlFilePath);
            var elements = doc.GetElementsByTagName(_tagNameforBiomarker);

            if (elements.Count < 1)
            {
                _errorSummary += "Data not found in file.";
                _logger.Error("Data not found in file.");
                return(null);
            }

            var ldlValue     = GetLipidValue(LdlCholName, elements);
            var hdlValue     = GetLipidValue(HdlCholName, elements);
            var tCholValue   = GetLipidValue(TotalCholName, elements);
            var glucoseValue = GetLipidValue(GlucoseName, elements);
            var tglValue     = GetLipidValue(TriglyceridesName, elements);

            decimal?tchol = null;
            decimal?hdl   = null;
            //not in use
            decimal?tGlycerides = null;


            if (testType == TestType.Lipid)
            {
                var testResult = new LipidTestResult
                {
                    Glucose         = _lipidParserHelper.GetReading(glucoseValue, ReadingLabels.Glucose, testType, ref _errorSummary),
                    LDL             = _lipidParserHelper.GetReading(ldlValue, ReadingLabels.LDL, testType, ref _errorSummary),
                    TotalCholestrol = _lipidParserHelper.GetReading(tCholValue, ReadingLabels.TotalCholestrol, ref tchol, testType, ref _errorSummary),
                    TriGlycerides   = _lipidParserHelper.GetReading(tglValue, ReadingLabels.TriGlycerides, ref tGlycerides, testType, ref _errorSummary),
                    HDL             = _lipidParserHelper.GetHdlReading(hdlValue, customerId, ref hdl, testType, ref _errorSummary),
                    TCHDLRatio      = _lipidParserHelper.GetHdlTclRatio(hdl, tchol, testType, ref _errorSummary)
                };

                return(GetLipidTestResult(testResult));
            }

            if (testType == TestType.Cholesterol)
            {
                var testResult = new CholesterolTestResult
                {
                    LDL = _lipidParserHelper.GetReading(ldlValue, ReadingLabels.LDL, testType, ref _errorSummary),
                    TotalCholesterol = _lipidParserHelper.GetReading(tCholValue, ReadingLabels.TotalCholestrol, ref tchol, testType, ref _errorSummary),
                    TriGlycerides    = _lipidParserHelper.GetReading(tglValue, ReadingLabels.TriGlycerides, ref tGlycerides, testType, ref _errorSummary),
                    HDL        = _lipidParserHelper.GetHdlReading(hdlValue, customerId, ref hdl, testType, ref _errorSummary),
                    TCHDLRatio = _lipidParserHelper.GetHdlTclRatio(hdl, tchol, testType, ref _errorSummary)
                };

                return(GetCholesterolTestResult(testResult));
            }

            if (testType == TestType.Diabetes)
            {
                var testResult = new DiabetesTestResult
                {
                    Glucose = _lipidParserHelper.GetReading(glucoseValue, ReadingLabels.Glucose, testType, ref _errorSummary)
                };

                return(GetDiabetesTestResult(testResult));
            }

            return(null);
        }
예제 #6
0
        private void LoadDiabetesFinding(HtmlDocument doc, DiabetesTestResult testResult)
        {
            var glucoseFinding = _standardFindingRepository.GetAllStandardFindings <int?>((int)TestType.Diabetes, (int)ReadingLabels.Glucose);

            _resultPdfHelper.SetFindingsVertical(doc, testResult != null && testResult.Glucose != null ? testResult.Glucose.Finding : null, glucoseFinding, "DiabetesGlucoseFinding");
        }