Esempio n. 1
0
        public void Test1()
        {
            TestResultRepository rep = new TestResultRepository();
            var u = rep.GetTestResult(1);
            var e = new TestResultTab {
                TestId = 1, UserId = 101, UserName = "******", Result = "Negative"
            };

            Assert.AreEqual(e.UserId, u.UserId);
            Assert.AreEqual(u.UserName, e.UserName);
            Assert.AreEqual(u.TestId, e.TestId);
            Assert.AreEqual(u.Result, e.Result);
        }
        private void SaveKynLabResult(KynHealthAssessmentEditModel model, long uploadedby, long customerId, long eventId, long eventCustomerResultId, int testId, bool isRecordable, bool isNewResultFlow)
        {
            if (isRecordable)
            {
                var testResultRepository = new TestResultRepository();
                var kynTestResult        = testResultRepository.GetTestResult(customerId, eventId, testId, isNewResultFlow);
                kynTestResult = _kynHealthAssessmentFactory.GetKynTestResultDomain(model, kynTestResult, uploadedby, testId, isNewResultFlow);
                if (kynTestResult != null)
                {
                    testResultRepository.SaveTestResults(kynTestResult, customerId, eventId, uploadedby);
                }
            }

            var kynLabValues = _kynHealthAssessmentFactory.GetKynLabValues(model);

            kynLabValues.EventCustomerResultId = eventCustomerResultId;
            kynLabValues.TestId = testId;
            _kynLabValuesRepository.Save(kynLabValues, uploadedby);

            UpdateFastingStatus(model, eventCustomerResultId);
        }
        public KynHealthAssessmentEditModel GetKynHealthAssessment(long customerId, long eventId, long testId, bool isNewResultFlow)
        {
            var basicBiometric = _basicBiometricRepository.Get(eventId, customerId);

            var model = new KynHealthAssessmentEditModel
            {
                EventId    = eventId,
                CustomerId = customerId,
                TestId     = testId
            };

            //var lipidRepository = new LipidTestRepository();

            //var lipidresult = lipidRepository.GetTestResults(customerId, eventId);

            //var lipidTestResult = lipidresult as LipidTestResult;

            //if (lipidTestResult != null)
            //{
            //    model.HDLCholestrol = lipidTestResult.HDL != null ? lipidTestResult.HDL.Reading : string.Empty;
            //    model.TotalCholestrol = lipidTestResult.TotalCholestrol != null ? lipidTestResult.TotalCholestrol.Reading
            //        : string.Empty;
            //    model.Triglycerides = lipidTestResult.TriGlycerides != null
            //        ? lipidTestResult.TriGlycerides.Reading
            //        : string.Empty;
            //    model.Glucose = lipidTestResult.Glucose != null ? lipidTestResult.Glucose.Reading : null;
            //}
            var eventCustomerResult = _eventCustomerResultRepository.GetByCustomerIdAndEventId(customerId, eventId);

            if (eventCustomerResult != null)
            {
                var kynLabValues = _kynLabValuesRepository.Get(eventCustomerResult.Id, testId);
                if (kynLabValues != null)
                {
                    model.TotalCholesterol = kynLabValues.TotalCholesterol != null?kynLabValues.TotalCholesterol.ToString() : string.Empty;

                    model.HDLCholesterol = kynLabValues.Hdl != null?kynLabValues.Hdl.ToString() : string.Empty;

                    model.Triglycerides = kynLabValues.Triglycerides != null?kynLabValues.Triglycerides.ToString() : string.Empty;

                    model.Glucose          = kynLabValues.Glucose ?? null;
                    model.FastingStatus    = kynLabValues.FastingStatus.HasValue ? kynLabValues.FastingStatus.Value : 0;
                    model.ManualSystolic   = kynLabValues.ManualSystolic;
                    model.ManualDiastolic  = kynLabValues.ManualDiastolic;
                    model.A1c              = kynLabValues.A1c;
                    model.BodyFat          = kynLabValues.BodyFat;
                    model.BoneDensity      = kynLabValues.BoneDensity;
                    model.Psa              = kynLabValues.Psa;
                    model.NonHdlCholestrol = kynLabValues.NonHdlCholestrol;
                    model.Nicotine         = kynLabValues.Nicotine;
                    model.Cotinine         = kynLabValues.Cotinine;
                    model.Smoker           = kynLabValues.Smoker;
                    model.LdlCholestrol    = kynLabValues.LdlCholestrol;
                    model.Notes            = kynLabValues.Notes;
                }
            }


            var testResultRepository = new TestResultRepository();
            var testresult           = testResultRepository.GetTestResult(customerId, eventId, (int)testId, isNewResultFlow);

            if (testresult != null)
            {
                model.Notes = testresult.TechnicianNotes;
            }

            if (basicBiometric != null)
            {
                model.SystolicPressure  = basicBiometric.SystolicPressure;
                model.DiastolicPressure = basicBiometric.DiastolicPressure;
                model.PulseRate         = basicBiometric.PulseRate;
            }
            var customer = _customerRepository.GetCustomer(customerId);

            if (customer == null)
            {
                return(model);
            }

            model.HeightInFeet   = customer.Height != null ? customer.Height.Feet : (double?)null;
            model.HeightInInches = customer.Height != null ? customer.Height.Inches : (double?)null;
            model.KynWeight      = customer.Weight != null && customer.Weight.Pounds > 0 ? customer.Weight.Pounds : (double?)null;
            model.WaistSize      = customer.Waist != null ? customer.Waist.Value : (decimal?)null;

            return(model);
        }
Esempio n. 4
0
        // TODO: might need to put under a common place.
        private static List <TestResult> GetTestResults(long customerId, long eventId, bool isNewResultFlow)
        {
            var testResults = new List <TestResult>();

            ITestResultRepository testResultRepository = new ASITestRepository();
            var asiTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (asiTestResult != null)
            {
                testResults.Add(asiTestResult);
            }

            testResultRepository = new PadTestRepository();
            var padTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (padTestResult != null)
            {
                testResults.Add(padTestResult);
            }

            testResultRepository = new AwvAbiTestRepository();
            var awvAbiTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvAbiTestResult != null)
            {
                testResults.Add(awvAbiTestResult);
            }

            testResultRepository = new OsteoporosisTestRepository();
            var osteoTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (osteoTestResult != null)
            {
                testResults.Add(osteoTestResult);
            }

            testResultRepository = new AwvBoneMassTestRepository();
            var awvBoneMassTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvBoneMassTestResult != null)
            {
                testResults.Add(awvBoneMassTestResult);
            }

            testResultRepository = new EKGTestRepository();
            var ekgTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (ekgTestResult != null)
            {
                testResults.Add(ekgTestResult);
            }

            testResultRepository = new AwvEkgTestRepository();
            var awvEkgTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvEkgTestResult != null)
            {
                testResults.Add(awvEkgTestResult);
            }

            testResultRepository = new AwvEkgIppeTestRepository();
            var awvEkgIppeTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvEkgIppeTestResult != null)
            {
                testResults.Add(awvEkgIppeTestResult);
            }

            testResultRepository = new LipidTestRepository();
            var lipidTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (lipidTestResult != null)
            {
                testResults.Add(lipidTestResult);
            }

            testResultRepository = new AwvLipidTestRepository();
            var awvLipidTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvLipidTestResult != null)
            {
                testResults.Add(awvLipidTestResult);
            }

            testResultRepository = new AwvGlucoseTestRepository();
            var awvGlucoseTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvGlucoseTestResult != null)
            {
                testResults.Add(awvGlucoseTestResult);
            }

            testResultRepository = new LiverTestRepository();
            var liverTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (liverTestResult != null)
            {
                testResults.Add(liverTestResult);
            }

            testResultRepository = new AAATestRepository();
            var aaaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (aaaTestResult != null)
            {
                testResults.Add(aaaTestResult);
            }

            testResultRepository = new AwvAaaTestRepository();
            var awvAaaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvAaaTestResult != null)
            {
                testResults.Add(awvAaaTestResult);
            }

            testResultRepository = new PpAaaTestRepository();
            var ppAaaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (ppAaaTestResult != null)
            {
                testResults.Add(ppAaaTestResult);
            }

            testResultRepository = new StrokeTestRepository();
            var strokeTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (strokeTestResult != null)
            {
                testResults.Add(strokeTestResult);
            }

            testResultRepository = new AwvCarotidTestRepository();
            var awvCarotidTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvCarotidTestResult != null)
            {
                testResults.Add(awvCarotidTestResult);
            }

            testResultRepository = new LeadTestRepository();
            var leadTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (leadTestResult != null)
            {
                testResults.Add(leadTestResult);
            }

            testResultRepository = new EchocardiogramTestRepository();
            var echocResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (echocResult != null)
            {
                testResults.Add(echocResult);
            }

            testResultRepository = new PpEchocardiogramTestRepository();
            var ppEchocResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (ppEchocResult != null)
            {
                testResults.Add(ppEchocResult);
            }

            testResultRepository = new ImtTestRepository();
            var imtTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (imtTestResult != null)
            {
                testResults.Add(imtTestResult);
            }

            testResultRepository = new PulmonaryFunctionTestRepository();
            var pulmonaryTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (pulmonaryTestResult != null)
            {
                testResults.Add(pulmonaryTestResult);
            }

            testResultRepository = new SpiroTestRepository();
            var spiroTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (spiroTestResult != null)
            {
                testResults.Add(spiroTestResult);
            }

            testResultRepository = new AwvSpiroTestRepository();
            var awvSpiroTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvSpiroTestResult != null)
            {
                testResults.Add(awvSpiroTestResult);
            }

            testResultRepository = new HemaglobinTestRepository();
            var a1CTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (a1CTestResult != null)
            {
                testResults.Add(a1CTestResult);
            }

            testResultRepository = new AwvHemaglobinTestRepository();
            var awvA1CTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvA1CTestResult != null)
            {
                testResults.Add(awvA1CTestResult);
            }

            testResultRepository = new HemoglobinTestRepository();
            var hemoglobinTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hemoglobinTestResult != null)
            {
                testResults.Add(hemoglobinTestResult);
            }

            testResultRepository = new ThyroidTestRepository();
            var thyroidTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (thyroidTestResult != null)
            {
                testResults.Add(thyroidTestResult);
            }

            testResultRepository = new PsaTestRepository();
            var psaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (psaTestResult != null)
            {
                testResults.Add(psaTestResult);
            }

            testResultRepository = new CrpTestRepository();
            var crpTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (crpTestResult != null)
            {
                testResults.Add(crpTestResult);
            }

            testResultRepository = new TestosteroneTestRepository();
            var testosteroneTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (testosteroneTestResult != null)
            {
                testResults.Add(testosteroneTestResult);
            }

            testResultRepository = new HearingTestRepository();
            var hearingTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hearingTestResult != null)
            {
                testResults.Add(hearingTestResult);
            }

            testResultRepository = new VisionTestRepository();
            var visionTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (visionTestResult != null)
            {
                testResults.Add(visionTestResult);
            }

            testResultRepository = new GlaucomaTestRepository();
            var glaucomaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (glaucomaTestResult != null)
            {
                testResults.Add(glaucomaTestResult);
            }

            testResultRepository = new HcpAaaTestRepository();
            var hcpAaaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hcpAaaTestResult != null)
            {
                testResults.Add(hcpAaaTestResult);
            }

            testResultRepository = new HcpCarotidTestRepository();
            var hcpCarotidTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hcpCarotidTestResult != null)
            {
                testResults.Add(hcpCarotidTestResult);
            }

            testResultRepository = new HcpEchocardiogramTestRepository();
            var hcpEchocResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hcpEchocResult != null)
            {
                testResults.Add(hcpEchocResult);
            }

            testResultRepository = new AwvEchocardiogramTestRepository();
            var awvEchocResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvEchocResult != null)
            {
                testResults.Add(awvEchocResult);
            }

            testResultRepository = new CholesterolTestRepository();
            var cholesterolTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (cholesterolTestResult != null)
            {
                testResults.Add(cholesterolTestResult);
            }


            testResultRepository = new DiabetesTestRepository();
            var diabetesTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (diabetesTestResult != null)
            {
                testResults.Add(diabetesTestResult);
            }

            testResultRepository = new HPyloriTestRepository();
            var hPyloriTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hPyloriTestResult != null)
            {
                testResults.Add(hPyloriTestResult);
            }

            testResultRepository = new MenBloodPanelTestRepository();
            var menBloodPanelTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (menBloodPanelTestResult != null)
            {
                testResults.Add(menBloodPanelTestResult);
            }

            testResultRepository = new WomenBloodPanelTestRepository();
            var womenBloodPanelTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (womenBloodPanelTestResult != null)
            {
                testResults.Add(womenBloodPanelTestResult);
            }

            testResultRepository = new VitaminDTestRepository();
            var vitaminDTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (vitaminDTestResult != null)
            {
                testResults.Add(vitaminDTestResult);
            }

            testResultRepository = new HypertensionTestRepository();
            var hypertensionTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (hypertensionTestResult != null)
            {
                testResults.Add(hypertensionTestResult);
            }

            testResultRepository = new DiabeticRetinopathyTestRepository();
            var diabeticRetinopathyTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (diabeticRetinopathyTestResult != null)
            {
                testResults.Add(diabeticRetinopathyTestResult);
            }

            testResultRepository = new EAwvTestRepository();
            var eawvTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (eawvTestResult != null)
            {
                testResults.Add(eawvTestResult);
            }

            testResultRepository = new DiabetesFootExamTestRepository();
            var diabetesFootExamTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (diabetesFootExamTestResult != null)
            {
                testResults.Add(diabetesFootExamTestResult);
            }

            testResultRepository = new RinneWeberHearingTestRepository();
            var rinneWeberHearingTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (rinneWeberHearingTestResult != null)
            {
                testResults.Add(rinneWeberHearingTestResult);
            }

            testResultRepository = new MonofilamentTestRepository();
            var monofilamentTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (monofilamentTestResult != null)
            {
                testResults.Add(monofilamentTestResult);
            }

            testResultRepository = new DiabeticNeuropathyTestRepository();
            var diabeticNeuropathyTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (diabeticNeuropathyTestResult != null)
            {
                testResults.Add(diabeticNeuropathyTestResult);
            }

            testResultRepository = new FloChecABITestRepository();
            var floChecABITestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (floChecABITestResult != null)
            {
                testResults.Add(floChecABITestResult);
            }

            testResultRepository = new IFOBTTestRepository();
            var iFOBTTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (iFOBTTestResult != null)
            {
                testResults.Add(iFOBTTestResult);
            }

            testResultRepository = new QualityMeasuresTestRepository();
            var qualityMeasureTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (qualityMeasureTestResult != null)
            {
                testResults.Add(qualityMeasureTestResult);
            }

            testResultRepository = new Phq9TestRepository();
            var phq9TestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (phq9TestResult != null)
            {
                testResults.Add(phq9TestResult);
            }

            testResultRepository = new FocAttestationTestRepository();
            var focAttestationTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (focAttestationTestResult != null)
            {
                testResults.Add(focAttestationTestResult);
            }

            testResultRepository = new MammogramTestRepository();
            var mammogramTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (mammogramTestResult != null)
            {
                testResults.Add(mammogramTestResult);
            }

            testResultRepository = new UrineMicroalbuminTestRepository();
            var urineMicroalbuminTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (urineMicroalbuminTestResult != null)
            {
                testResults.Add(urineMicroalbuminTestResult);
            }

            testResultRepository = new FluShotTestRepository();
            var fluShotTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (fluShotTestResult != null)
            {
                testResults.Add(fluShotTestResult);
            }

            testResultRepository = new AwvFluShotTestRepository();
            var awvFluShotTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (awvFluShotTestResult != null)
            {
                testResults.Add(awvFluShotTestResult);
            }

            testResultRepository = new PneumococcalTestRepository();
            var pneumococcalTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (pneumococcalTestResult != null)
            {
                testResults.Add(pneumococcalTestResult);
            }

            testResultRepository = new ChlamydiaTestRepository();
            var chlamydiaTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (chlamydiaTestResult != null)
            {
                testResults.Add(chlamydiaTestResult);
            }

            testResultRepository = new QuantaFloABITestRepository();
            var quantaFloABITestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (quantaFloABITestResult != null)
            {
                testResults.Add(quantaFloABITestResult);
            }


            testResultRepository = new DpnTestRepository();
            var dpnTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (dpnTestResult != null)
            {
                testResults.Add(dpnTestResult);
            }

            testResultRepository = new MyBioAssessmentTestRepository();
            var mybioCheckTestResult = testResultRepository.GetTestResults(customerId, eventId, isNewResultFlow);

            if (mybioCheckTestResult != null)
            {
                testResults.Add(mybioCheckTestResult);
            }

            testResultRepository = new TestResultRepository();

            var testResult = testResultRepository.GetTestResult(customerId, eventId, (int)TestType.Colorectal, isNewResultFlow);

            if (testResult != null)
            {
                testResults.Add(testResult);
            }

            testResult = testResultRepository.GetTestResult(customerId, eventId, (int)TestType.Kyn, isNewResultFlow);
            if (testResult != null)
            {
                testResults.Add(testResult);
            }

            testResult = testResultRepository.GetTestResult(customerId, eventId, (int)TestType.AWV, isNewResultFlow);
            if (testResult != null)
            {
                testResults.Add(testResult);
            }

            testResultRepository = new TestResultRepository();
            testResult           = testResultRepository.GetTestResult(customerId, eventId, (int)TestType.Medicare, isNewResultFlow);
            if (testResult != null)
            {
                testResults.Add(testResult);
            }

            testResultRepository = new TestResultRepository();
            testResult           = testResultRepository.GetTestResult(customerId, eventId, (int)TestType.AwvSubsequent, isNewResultFlow);
            if (testResult != null)
            {
                testResults.Add(testResult);
            }

            return(testResults);
        }