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

            testResult.Systolic  = CreateResultReadingforNullableInt((int)ReadingLabels.SystolicRight, customerEventReadingEntities);
            testResult.Diastolic = CreateResultReadingforNullableInt((int)ReadingLabels.DiastolicRight, customerEventReadingEntities);

            testResult.Pulse = CreateResultReadingforNullableInt((int)ReadingLabels.Pulse, customerEventReadingEntities);
            testResult.BloodPressureElevated = CreateResultReading((int)ReadingLabels.BloodPressureElevated, customerEventReadingEntities);
            testResult.RightArmBpMeasurement = CreateResultReading((int)ReadingLabels.RightArmBpMeasurement, customerEventReadingEntities);

            testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities);
            testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities);

            return(testResult);
        }
Esempio n. 2
0
        private void ParseDataForHypertension(long customerId, BasicBiometric basicBiometric)
        {
            var isTestPurchased = _testResultService.IsTestPurchasedByCustomer(_eventId, customerId, (long)TestType.Hypertension);

            try
            {
                if (isTestPurchased)
                {
                    var testResult = new HypertensionTestResult
                    {
                        Systolic = new ResultReading <int?> {
                            Reading = basicBiometric.SystolicPressure
                        },
                        Diastolic = new ResultReading <int?> {
                            Reading = basicBiometric.DiastolicPressure
                        },
                        RightArmBpMeasurement = new ResultReading <bool> {
                            Reading = basicBiometric.IsRightArmBpMeasurement
                        },
                        BloodPressureElevated = new ResultReading <bool> {
                            Reading = basicBiometric.SystolicPressure >= 140 || basicBiometric.DiastolicPressure >= 90
                        }
                    };

                    _resultParserHelper.AddTestResulttoEventCustomerAggregate(_eventCustomerScreeningAggregates, _eventId, customerId, testResult);
                    _resultParserHelper.AddResultArchiveLog(_kynAppLipidParser.ErrorSummary, TestType.Hypertension, customerId, MedicalEquipmentTag.Bloodworks, true);
                }
                else
                {
                    _logger.Info(string.Format("Hypertension is not availed by Customer : [{0}]", customerId));
                }
            }
            catch (Exception exception)
            {
                _logger.Error(string.Format("Some error occured while parsing data of Hypertension Test for customerId {0} and event Id {1} \nMessage:{2} \nStack Trace: {3}", customerId, _eventId, exception.Message, exception.StackTrace));
            }
        }
 public PcpResultExportModel SetHypertensionData(PcpResultExportModel model, HypertensionTestResult testResult)
 {
     throw new System.NotImplementedException();
 }
        public TestResult GetHypertensionTestResultDomain(KynHealthAssessmentEditModel model, HypertensionTestResult inpersistence, long uploadedby, bool isNewResultFlow)
        {
            if (!IsHypertensionReadingProvided(model) && inpersistence == null)
            {
                return(inpersistence);
            }

            var isBloodPressureElevated = (model.SystolicPressure.HasValue && model.SystolicPressure.Value >= SystolicAbnormalValue) ||
                                          (model.DiastolicPressure.HasValue && model.DiastolicPressure.Value >= DiastolicAbnormalValue);

            if (inpersistence == null)
            {
                inpersistence = new HypertensionTestResult
                {
                    Pulse = new ResultReading <int?>
                    {
                        Reading       = model.PulseRate,
                        Label         = ReadingLabels.Pulse,
                        ReadingSource = ReadingSource.Manual
                    },
                    Diastolic = new ResultReading <int?>
                    {
                        Reading       = model.DiastolicPressure,
                        Label         = ReadingLabels.DiastolicRight,
                        ReadingSource = ReadingSource.Manual
                    },
                    Systolic = new ResultReading <int?>
                    {
                        Reading       = model.SystolicPressure,
                        Label         = ReadingLabels.SystolicRight,
                        ReadingSource = ReadingSource.Manual
                    },
                    BloodPressureElevated = new ResultReading <bool>
                    {
                        Reading       = isBloodPressureElevated,
                        Label         = ReadingLabels.BloodPressureElevated,
                        ReadingSource = ReadingSource.Manual
                    },
                    ResultStatus = new TestResultState
                    {
                        StateNumber = isNewResultFlow ? (int)NewTestResultStateNumber.ResultEntryPartial : (int)TestResultStateNumber.ManualEntry
                    }
                };
            }
            else
            {
                inpersistence.Pulse = new ResultReading <int?>
                {
                    Reading       = model.PulseRate,
                    Label         = ReadingLabels.Pulse,
                    ReadingSource = ReadingSource.Manual
                };
                inpersistence.Diastolic = new ResultReading <int?>
                {
                    Reading       = model.DiastolicPressure,
                    Label         = ReadingLabels.DiastolicRight,
                    ReadingSource = ReadingSource.Manual
                };
                inpersistence.Systolic = new ResultReading <int?>
                {
                    Reading       = model.SystolicPressure,
                    Label         = ReadingLabels.SystolicRight,
                    ReadingSource = ReadingSource.Manual
                };
                inpersistence.BloodPressureElevated = new ResultReading <bool>
                {
                    Reading       = isBloodPressureElevated,
                    Label         = ReadingLabels.BloodPressureElevated,
                    ReadingSource = ReadingSource.Manual
                };
            }

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

            return(inpersistence);
        }