public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var pulmonaryFunctionTestResult = testResult as PulmonaryFunctionTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.PulmonaryFunction }; testResult.ResultInterpretation = null; if (pulmonaryFunctionTestResult.Finding != null) { var customerEventTestStandardFindingEntity = new CustomerEventTestStandardFindingEntity { StandardFindingTestReadingId = (int?)new TestResultService().GetStandardFindingTestReadingIdForStandardFinding ((int)TestType.PulmonaryFunction, null, Convert.ToInt64(pulmonaryFunctionTestResult.Finding.Id)), CustomerEventTestStandardFindingId = pulmonaryFunctionTestResult.Finding.CustomerEventStandardFindingId, CustomerEventScreeningTestId = testResult.Id }; var finding = GetSelectedStandardFinding((int)TestType.PulmonaryFunction, null, pulmonaryFunctionTestResult.Finding.Id); if (testResult.ResultStatus.StateNumber == (int)TestResultStateNumber.Evaluated || testResult.ResultStatus.StateNumber == (int)NewTestResultStateNumber.Evaluated) { testResult.ResultInterpretation = finding.ResultInterpretation; testResult.PathwayRecommendation = finding.PathwayRecommendation; } customerEventScreeningTestsEntity.CustomerEventTestStandardFinding.Add(customerEventTestStandardFindingEntity); } return(customerEventScreeningTestsEntity); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var diabetesFootExamTestResult = testResult as DiabetesFootExamTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.DiabetesFootExam }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (diabetesFootExamTestResult.RightFootYes != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(diabetesFootExamTestResult.RightFootYes, (int)ReadingLabels.RightFootYes, testReadingReadingPairs)); } if (diabetesFootExamTestResult.RightFootNo != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(diabetesFootExamTestResult.RightFootNo, (int)ReadingLabels.RightFootNo, testReadingReadingPairs)); } if (diabetesFootExamTestResult.LeftFootYes != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(diabetesFootExamTestResult.LeftFootYes, (int)ReadingLabels.LeftFootYes, testReadingReadingPairs)); } if (diabetesFootExamTestResult.LeftFootNo != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(diabetesFootExamTestResult.LeftFootNo, (int)ReadingLabels.LeftFootNo, testReadingReadingPairs)); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); var testResult = new HPyloriTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventTestStandardFindingEntities = customerEventScreeningTestEntity.CustomerEventTestStandardFinding.ToList(); var standardFindingTestReadingEntities = customerEventScreeningTestEntity.StandardFindingTestReadingCollectionViaCustomerEventTestStandardFinding.ToList(); if (customerEventTestStandardFindingEntities.Any()) { var testResultService = new TestResultService(); var standardFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.HPylori); customerEventTestStandardFindingEntities.ForEach(customerEventTestStandardFindingEntity => { var standardFindingTestReadingEntity = standardFindingTestReadingEntities.Find(entity => entity.StandardFindingTestReadingId == customerEventTestStandardFindingEntity.StandardFindingTestReadingId); if (standardFindingTestReadingEntity == null) { return; } var finding = CreateFindingObject(customerEventTestStandardFindingEntity, standardFindings, standardFindingTestReadingEntity, null); if (finding != null) { testResult.Finding = finding; return; } }); } testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var monofilamentTestResult = testResult as MonofilamentTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.Monofilament }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (monofilamentTestResult.RightPositive != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(monofilamentTestResult.RightPositive, (int)ReadingLabels.MonofilamentRightFootSensationIntact, testReadingReadingPairs)); } if (monofilamentTestResult.RightNegative != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(monofilamentTestResult.RightNegative, (int)ReadingLabels.MonofilamentRightFootSensationNotIntact, testReadingReadingPairs)); } if (monofilamentTestResult.LeftPositive != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(monofilamentTestResult.LeftPositive, (int)ReadingLabels.MonofilamentLeftFootSensationIntact, testReadingReadingPairs)); } if (monofilamentTestResult.LeftNegative != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(monofilamentTestResult.LeftNegative, (int)ReadingLabels.MonofilamentLeftFootSensationNotIntact, testReadingReadingPairs)); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var rinneWeberHearingTestResult = testResult as RinneWeberHearingTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.RinneWeberHearing }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (rinneWeberHearingTestResult.WeberNormal != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(rinneWeberHearingTestResult.WeberNormal, (int)ReadingLabels.WeberNormal, testReadingReadingPairs)); } if (rinneWeberHearingTestResult.WeberAbnormal != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(rinneWeberHearingTestResult.WeberAbnormal, (int)ReadingLabels.WeberAbnormal, testReadingReadingPairs)); } if (rinneWeberHearingTestResult.RinneNormal != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(rinneWeberHearingTestResult.RinneNormal, (int)ReadingLabels.RinneNormal, testReadingReadingPairs)); } if (rinneWeberHearingTestResult.RinneAbnormal != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(rinneWeberHearingTestResult.RinneAbnormal, (int)ReadingLabels.RinneAbnormal, testReadingReadingPairs)); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var glaucomaTestResult = testResult as GlaucomaTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.Glaucoma }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (glaucomaTestResult.AmslerRightEye != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(glaucomaTestResult.AmslerRightEye, (int)ReadingLabels.AmslerRightEye, testReadingReadingPairs)); } if (glaucomaTestResult.AmslerLeftEye != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(glaucomaTestResult.AmslerLeftEye, (int)ReadingLabels.AmslerLeftEye, testReadingReadingPairs)); } if (glaucomaTestResult.RightEyePressure != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(glaucomaTestResult.RightEyePressure, (int)ReadingLabels.RightEyePressure, testReadingReadingPairs)); } if (glaucomaTestResult.LeftEyePressure != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(glaucomaTestResult.LeftEyePressure, (int)ReadingLabels.LeftEyePressure, testReadingReadingPairs)); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <OrderedPair <int, int> > testReadingReadingPairs) { var csTestResult = testResult as CsTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.Cs }; var resultIntpretations = new List <long>(); var pathwayRecomendations = new List <long>(); var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (csTestResult != null) { if (testResult.ResultStatus.StateNumber == (int)TestResultStateNumber.Evaluated || testResult.ResultStatus.StateNumber == (int)NewTestResultStateNumber.Evaluated) { if (resultIntpretations.Count > 0) { testResult.ResultInterpretation = ResultInterpretation.Normal.GetMax(resultIntpretations); } if (pathwayRecomendations.Count > 0) { testResult.PathwayRecommendation = PathwayRecommendation.None.GetMax(pathwayRecomendations); } } } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override bool SaveTestResults(TestResult currentTestResult, long customerId, long eventId, long technicianId) { TestResult synchronizedTestResult = null; if (currentTestResult.IsNewResultFlow) { if (SaveNewTestResult(currentTestResult, customerId, eventId, ref synchronizedTestResult)) { return(true); } } else { if (SaveOldTestResult(currentTestResult, customerId, eventId, ref synchronizedTestResult)) { return(true); } } CustomerEventScreeningTestsEntity customerEventScreeningEntity = _testResultFactory.CreateTestResultEntity(synchronizedTestResult, GetListOfTestReadingAndReadingId((int)TestType.PHQ9)); using (var scope = new TransactionScope()) { var result = PersistTestResults(customerEventScreeningEntity, (int)TestType.PHQ9, customerId, eventId, technicianId); scope.Complete(); return(result); } }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new HearingTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.HearingSummary = CreateResultReadingforNullableBool((int)ReadingLabels.HearingSummary, customerEventReadingEntities); testResult.RightEar500Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar500Hz, customerEventReadingEntities); testResult.LeftEar500Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar500Hz, customerEventReadingEntities); testResult.RightEar1000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar1000Hz, customerEventReadingEntities); testResult.LeftEar1000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar1000Hz, customerEventReadingEntities); testResult.RightEar2000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar2000Hz, customerEventReadingEntities); testResult.LeftEar2000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar2000Hz, customerEventReadingEntities); testResult.RightEar3000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar3000Hz, customerEventReadingEntities); testResult.LeftEar3000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar3000Hz, customerEventReadingEntities); testResult.RightEar4000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar4000Hz, customerEventReadingEntities); testResult.LeftEar4000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar4000Hz, customerEventReadingEntities); testResult.RightEar6000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar6000Hz, customerEventReadingEntities); testResult.LeftEar6000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar6000Hz, customerEventReadingEntities); testResult.RightEar8000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.RightEar8000Hz, customerEventReadingEntities); testResult.LeftEar8000Hz = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEar8000Hz, customerEventReadingEntities); return(testResult); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var phq9TestResult = testResult as Phq9TestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.PHQ9 }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (phq9TestResult.Phq9Score != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(phq9TestResult.Phq9Score, (int)ReadingLabels.Phq9Score, testReadingReadingPairs)); } if (phq9TestResult.TechnicallyLimitedbutReadable != null) { var customerEventReading = CreateEventReadingEntity(phq9TestResult.TechnicallyLimitedbutReadable, (int)ReadingLabels.TechnicallyLimitedbutReadable, testReadingReadingPairs); customerEventReadingEntities.Add(customerEventReading); } if (phq9TestResult.RepeatStudy != null) { var customerEventReading = CreateEventReadingEntity(phq9TestResult.RepeatStudy, (int)ReadingLabels.RepeatStudy, testReadingReadingPairs); customerEventReadingEntities.Add(customerEventReading); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override bool SaveTestResults(TestResult currentTestResult, long customerId, long eventId, long technicianId) { TestResult synchronizedTestResult = null; if (currentTestResult.IsNewResultFlow) { if (SaveNewTestResult(currentTestResult, customerId, eventId, ref synchronizedTestResult)) { return(true); } } else { if (SaveOldTestResult(currentTestResult, customerId, eventId, ref synchronizedTestResult)) { return(true); } } CustomerEventScreeningTestsEntity customerEventScreeningEntity = _testResultFactory.CreateTestResultEntity(synchronizedTestResult, GetListOfTestReadingAndReadingId((int)TestType.AAA)); using (var scope = new TransactionScope()) { var result = PersistTestResults(customerEventScreeningEntity, (int)TestType.AAA, customerId, eventId, technicianId); var eventCustomerResultRepository = new EventCustomerResultRepository(); var eventCustomerResult = eventCustomerResultRepository.GetByCustomerIdAndEventId(customerId, eventId); var customerEventScreeningTestId = GetCustomerEventScreeningTestId((int)TestType.AAA, eventCustomerResult.Id); SaveTestMedia(((AAATestResult)synchronizedTestResult).ResultImages, customerEventScreeningTestId, synchronizedTestResult.DataRecorderMetaData); scope.Complete(); return(result); } }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new VisionTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.BothEyesLeftUpperQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.BothEyesLeftUpperQuadrant, customerEventReadingEntities); testResult.BothEyesLeftLowerQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.BothEyesLeftLowerQuadrant, customerEventReadingEntities); testResult.BothEyesRightUpperQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.BothEyesRightUpperQuadrant, customerEventReadingEntities); testResult.BothEyesRightLowerQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.BothEyesRightLowerQuadrant, customerEventReadingEntities); testResult.RightEyeLeftUpperQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.RightEyeLeftUpperQuadrant, customerEventReadingEntities); testResult.RightEyeLeftLowerQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.RightEyeLeftLowerQuadrant, customerEventReadingEntities); testResult.RightEyeRightUpperQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.RightEyeRightUpperQuadrant, customerEventReadingEntities); testResult.RightEyeRightLowerQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.RightEyeRightLowerQuadrant, customerEventReadingEntities); testResult.LeftEyeLeftUpperQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.LeftEyeLeftUpperQuadrant, customerEventReadingEntities); testResult.LeftEyeLeftLowerQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.LeftEyeLeftLowerQuadrant, customerEventReadingEntities); testResult.LeftEyeRightUpperQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.LeftEyeRightUpperQuadrant, customerEventReadingEntities); testResult.LeftEyeRightLowerQuadrant = CreateResultReadingforNullableBool((int)ReadingLabels.LeftEyeRightLowerQuadrant, customerEventReadingEntities); testResult.RightEyeCylindrical = CreateResultReadingforNullableInt((int)ReadingLabels.RightEyeCylindrical, customerEventReadingEntities); testResult.RightEyeSpherical = CreateResultReadingforNullableInt((int)ReadingLabels.RightEyeSpherical, customerEventReadingEntities); testResult.LeftEyeCylindrical = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEyeCylindrical, customerEventReadingEntities); testResult.LeftEyeSpherical = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEyeSpherical, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestsEntity) { var customerEventReadingEntities = customerEventScreeningTestsEntity.CustomerEventReading.ToList(); var testResult = new AwvLipidTestResult(customerEventScreeningTestsEntity.CustomerEventScreeningTestId); var standardFindingTestReadingEntities = customerEventScreeningTestsEntity. StandardFindingTestReadingCollectionViaCustomerEventReading.ToList(); var totalCholesterolData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.TotalCholestrol). SingleOrDefault(); if (totalCholesterolData != null) { testResult.TotalCholestrol = CreateTestReadingforaIntValue(totalCholesterolData, (int)ReadingLabels.TotalCholestrol, standardFindingTestReadingEntities, totalCholesterolData.Value); } var hdlData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.HDL). SingleOrDefault(); if (hdlData != null) { testResult.HDL = CreateTestReadingforaIntValue(hdlData, (int)ReadingLabels.HDL, standardFindingTestReadingEntities, hdlData.Value); } var ldlData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.LDL). SingleOrDefault(); if (ldlData != null) { testResult.LDL = CreateTestReadingforaIntValue(ldlData, (int)ReadingLabels.LDL, standardFindingTestReadingEntities, (string.IsNullOrEmpty(ldlData.Value) ? null : (int?)Convert.ToInt32(ldlData.Value))); } var triglyceridesData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.TriGlycerides). SingleOrDefault(); if (triglyceridesData != null) { testResult.TriGlycerides = CreateTestReadingforaIntValue(triglyceridesData, (int)ReadingLabels.TriGlycerides, standardFindingTestReadingEntities, triglyceridesData.Value); } var tchdlratioData = customerEventReadingEntities. Where(customerEventReading => customerEventReading.TestReading.ReadingId == (int)ReadingLabels.TCHDLRatio). SingleOrDefault(); if (tchdlratioData != null) { testResult.TCHDLRatio = CreateTestReadingforaDecimalValue(tchdlratioData, (int)ReadingLabels.TCHDLRatio, standardFindingTestReadingEntities, (string.IsNullOrEmpty(tchdlratioData.Value) ? null : (decimal?)Convert.ToDecimal(tchdlratioData.Value))); } return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new CrpTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.LCRP = CreateResultReadingforInputValues((int)ReadingLabels.LCRP, customerEventReadingEntities); return(testResult); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <OrderedPair <int, int> > testReadingReadingPairs) { var medicareTestResult = testResult as MedicareTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.Medicare }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); testResult.ResultInterpretation = null; if (medicareTestResult.Finding != null) { var customerEventTestStandardFindingEntity = new CustomerEventTestStandardFindingEntity { StandardFindingTestReadingId = (int?)new TestResultService().GetStandardFindingTestReadingIdForStandardFinding ((int)TestType.Medicare, null, Convert.ToInt64(medicareTestResult.Finding.Id)), CustomerEventTestStandardFindingId = medicareTestResult.Finding.CustomerEventStandardFindingId, CustomerEventScreeningTestId = testResult.Id }; var finding = GetSelectedStandardFinding((int)TestType.Medicare, null, medicareTestResult.Finding.Id); if (testResult.ResultStatus.StateNumber == (int)TestResultStateNumber.Evaluated || testResult.ResultStatus.StateNumber == (int)NewTestResultStateNumber.Evaluated) { testResult.ResultInterpretation = finding.ResultInterpretation; testResult.PathwayRecommendation = finding.PathwayRecommendation; } customerEventScreeningTestsEntity.CustomerEventTestStandardFinding.Add(customerEventTestStandardFindingEntity); } if (medicareTestResult.TechnicallyLimitedbutReadable != null) { var customerEventReadingEntity = CreateEventReadingEntity(medicareTestResult.TechnicallyLimitedbutReadable, (int)ReadingLabels.TechnicallyLimitedbutReadable, testReadingReadingPairs); if (customerEventReadingEntity != null) { customerEventReadingEntities.Add(customerEventReadingEntity); } } if (medicareTestResult.RepeatStudy != null) { var customerEventReadingEntity = CreateEventReadingEntity(medicareTestResult.RepeatStudy, (int)ReadingLabels.RepeatStudy, testReadingReadingPairs); if (customerEventReadingEntity != null) { customerEventReadingEntities.Add(customerEventReadingEntity); } } if (customerEventReadingEntities.Count > 0) { customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); } return(customerEventScreeningTestsEntity); }
/// <summary> setups the sync logic for member _customerEventScreeningTests</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCustomerEventScreeningTests(IEntity2 relatedEntity) { if (_customerEventScreeningTests != relatedEntity) { DesetupSyncCustomerEventScreeningTests(true, true); _customerEventScreeningTests = (CustomerEventScreeningTestsEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_customerEventScreeningTests, new PropertyChangedEventHandler(OnCustomerEventScreeningTestsPropertyChanged), "CustomerEventScreeningTests", CustomerEventTestPhysicianEvaluationEntity.Relations.CustomerEventScreeningTestsEntityUsingCustomerEventScreeningTestId, true, new string[] { }); } }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var imtTestResult = testResult as ImtTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.IMT }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (imtTestResult.VascularAge != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(imtTestResult.VascularAge, (int)ReadingLabels.VascularAge, testReadingReadingPairs)); } if (imtTestResult.QimtLeft != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(imtTestResult.QimtLeft, (int)ReadingLabels.QimtLeft, testReadingReadingPairs)); } if (imtTestResult.QimtRight != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(imtTestResult.QimtRight, (int)ReadingLabels.QimtRight, testReadingReadingPairs)); } if (imtTestResult.ExpectedQimt != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(imtTestResult.ExpectedQimt, (int)ReadingLabels.ExpectedQimt, testReadingReadingPairs)); } testResult.ResultInterpretation = null; if (imtTestResult.Finding != null) { var customerEventTestStandardFindingEntity = new CustomerEventTestStandardFindingEntity() { StandardFindingTestReadingId = (int?)new TestResultService().GetStandardFindingTestReadingIdForStandardFinding ((int)TestType.IMT, null, Convert.ToInt64(imtTestResult.Finding.Id)), CustomerEventTestStandardFindingId = imtTestResult.Finding.CustomerEventStandardFindingId, CustomerEventScreeningTestId = testResult.Id }; var finding = GetSelectedStandardFinding((int)TestType.IMT, null, imtTestResult.Finding.Id); if (testResult.ResultStatus.StateNumber == (int)TestResultStateNumber.Evaluated || testResult.ResultStatus.StateNumber == (int)NewTestResultStateNumber.Evaluated) { testResult.ResultInterpretation = finding.ResultInterpretation; testResult.PathwayRecommendation = finding.PathwayRecommendation; } customerEventScreeningTestsEntity.CustomerEventTestStandardFinding.Add(customerEventTestStandardFindingEntity); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
/// <summary> Initializes the class members</summary> protected virtual void InitClassMembers() { _customerEventScreeningTests = null; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); var testResult = new DpnTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); if (customerEventScreeningTestEntity.TestMedia != null && customerEventScreeningTestEntity.TestMedia.Count > 0) { var fileEntityCollection = customerEventScreeningTestEntity.FileCollectionViaTestMedia.ToList(); var testMediaEntity = customerEventScreeningTestEntity.TestMedia.FirstOrDefault(); testResult.ResultImage = new ResultMedia(testMediaEntity.MediaId) { File = GetFileObjectfromEntity(testMediaEntity.FileId, fileEntityCollection), Thumbnail = testMediaEntity.ThumbnailFileId != null ? new File(testMediaEntity.ThumbnailFileId.Value) : null, ReadingSource = testMediaEntity.IsManual ? ReadingSource.Manual : ReadingSource.Automatic }; } var customerEventTestStandardFindingEntities = customerEventScreeningTestEntity.CustomerEventTestStandardFinding.ToList(); var standardFindingTestReadingEntities = customerEventScreeningTestEntity.StandardFindingTestReadingCollectionViaCustomerEventTestStandardFinding.ToList(); if (customerEventTestStandardFindingEntities.Count() > 0) { var testResultService = new TestResultService(); var standardFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.DPN); customerEventTestStandardFindingEntities.ForEach(customerEventTestStandardFindingEntity => { var standardFindingTestReadingEntity = standardFindingTestReadingEntities.Find(entity => entity.StandardFindingTestReadingId == customerEventTestStandardFindingEntity.StandardFindingTestReadingId); if (standardFindingTestReadingEntity == null) { return; } var finding = CreateFindingObject(customerEventTestStandardFindingEntity, standardFindings, standardFindingTestReadingEntity, null); if (finding != null) { testResult.Finding = finding; return; } }); } testResult.Amplitude = CreateResultReadingforNullableDecimal((int)ReadingLabels.DpnAmplitude, customerEventReadingEntities); testResult.ConductionVelocity = CreateResultReadingforNullableDecimal((int)ReadingLabels.DpnConductionVelocity, customerEventReadingEntities); testResult.RightLeg = CreateResultReadingforNullableBool((int)ReadingLabels.DpnRightLeg, customerEventReadingEntities); testResult.LeftLeg = CreateResultReadingforNullableBool((int)ReadingLabels.DpnLeftLeg, customerEventReadingEntities); testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override CustomerEventScreeningTestsEntity CreateActualTestResultEntity(TestResult testResult, List <Core.OrderedPair <int, int> > testReadingReadingPairs) { var hypertensionTestResult = testResult as HypertensionTestResult; var customerEventScreeningTestsEntity = new CustomerEventScreeningTestsEntity(testResult.Id) { TestId = (int)TestType.Hypertension }; var customerEventReadingEntities = new List <CustomerEventReadingEntity>(); if (hypertensionTestResult.Systolic != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(hypertensionTestResult.Systolic, (int)ReadingLabels.SystolicRight, testReadingReadingPairs)); } if (hypertensionTestResult.Diastolic != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(hypertensionTestResult.Diastolic, (int)ReadingLabels.DiastolicRight, testReadingReadingPairs)); } if (hypertensionTestResult.Pulse != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(hypertensionTestResult.Pulse, (int)ReadingLabels.Pulse, testReadingReadingPairs)); } if (hypertensionTestResult.RightArmBpMeasurement != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(hypertensionTestResult.RightArmBpMeasurement, (int)ReadingLabels.RightArmBpMeasurement, testReadingReadingPairs)); } if (hypertensionTestResult.BloodPressureElevated != null) { customerEventReadingEntities.Add(CreateEventReadingEntity(hypertensionTestResult.BloodPressureElevated, (int)ReadingLabels.BloodPressureElevated, testReadingReadingPairs)); } if (hypertensionTestResult.TechnicallyLimitedbutReadable != null) { var customerEventReading = CreateEventReadingEntity(hypertensionTestResult.TechnicallyLimitedbutReadable, (int)ReadingLabels.TechnicallyLimitedbutReadable, testReadingReadingPairs); customerEventReadingEntities.Add(customerEventReading); } if (hypertensionTestResult.RepeatStudy != null) { var customerEventReading = CreateEventReadingEntity(hypertensionTestResult.RepeatStudy, (int)ReadingLabels.RepeatStudy, testReadingReadingPairs); customerEventReadingEntities.Add(customerEventReading); } customerEventScreeningTestsEntity.CustomerEventReading.AddRange(customerEventReadingEntities); return(customerEventScreeningTestsEntity); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new Phq9TestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.Phq9Score = CreateResultReadingforInputValues((int)ReadingLabels.Phq9Score, customerEventReadingEntities); testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); var testResult = new MedicareTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventTestStandardFindingEntities = customerEventScreeningTestEntity.CustomerEventTestStandardFinding.ToList(); var standardFindingTestReadingEntities = customerEventScreeningTestEntity.StandardFindingTestReadingCollectionViaCustomerEventTestStandardFinding.ToList(); if (customerEventTestStandardFindingEntities.Count() > 0) { var testResultService = new TestResultService(); var standardFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.Medicare); customerEventTestStandardFindingEntities.ForEach(customerEventTestStandardFindingEntity => { var standardFindingTestReadingEntity = standardFindingTestReadingEntities.Find(entity => entity.StandardFindingTestReadingId == customerEventTestStandardFindingEntity.StandardFindingTestReadingId); if (standardFindingTestReadingEntity == null) { return; } var finding = CreateFindingObject(customerEventTestStandardFindingEntity, standardFindings, standardFindingTestReadingEntity, null); if (finding != null) { testResult.Finding = finding; return; } }); } var testMediaCollection = customerEventScreeningTestEntity.TestMedia.ToList(); var fileEntityCollection = customerEventScreeningTestEntity.FileCollectionViaTestMedia.ToList(); if (testMediaCollection.Count > 0) { var resultMedia = new List <ResultMedia>(); testMediaCollection.ForEach(testMedia => resultMedia.Add(new ResultMedia(testMedia.MediaId) { File = GetFileObjectfromEntity(testMedia.FileId, fileEntityCollection), Thumbnail = testMedia.ThumbnailFileId != null ? new File(testMedia.ThumbnailFileId.Value) : null, ReadingSource = testMedia.IsManual ? ReadingSource.Manual : ReadingSource.Automatic })); testResult.ResultImages = resultMedia; } testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new GlaucomaTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.AmslerRightEye = CreateResultReadingforNullableBool((int)ReadingLabels.AmslerRightEye, customerEventReadingEntities); testResult.AmslerLeftEye = CreateResultReadingforNullableBool((int)ReadingLabels.AmslerLeftEye, customerEventReadingEntities); testResult.RightEyePressure = CreateResultReadingforNullableInt((int)ReadingLabels.RightEyePressure, customerEventReadingEntities); testResult.LeftEyePressure = CreateResultReadingforNullableInt((int)ReadingLabels.LeftEyePressure, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new DiabetesFootExamTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.RightFootYes = CreateResultReadingforNullableBool((int)ReadingLabels.RightFootYes, customerEventReadingEntities); testResult.RightFootNo = CreateResultReadingforNullableBool((int)ReadingLabels.RightFootNo, customerEventReadingEntities); testResult.LeftFootYes = CreateResultReadingforNullableBool((int)ReadingLabels.LeftFootYes, customerEventReadingEntities); testResult.LeftFootNo = CreateResultReadingforNullableBool((int)ReadingLabels.LeftFootNo, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new MonofilamentTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.RightPositive = CreateResultReadingforNullableBool((int)ReadingLabels.MonofilamentRightFootSensationIntact, customerEventReadingEntities); testResult.RightNegative = CreateResultReadingforNullableBool((int)ReadingLabels.MonofilamentRightFootSensationNotIntact, customerEventReadingEntities); testResult.LeftPositive = CreateResultReadingforNullableBool((int)ReadingLabels.MonofilamentLeftFootSensationIntact, customerEventReadingEntities); testResult.LeftNegative = CreateResultReadingforNullableBool((int)ReadingLabels.MonofilamentLeftFootSensationNotIntact, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new RinneWeberHearingTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.WeberNormal = CreateResultReadingforNullableBool((int)ReadingLabels.WeberNormal, customerEventReadingEntities); testResult.WeberAbnormal = CreateResultReadingforNullableBool((int)ReadingLabels.WeberAbnormal, customerEventReadingEntities); testResult.RinneNormal = CreateResultReadingforNullableBool((int)ReadingLabels.RinneNormal, customerEventReadingEntities); testResult.RinneAbnormal = CreateResultReadingforNullableBool((int)ReadingLabels.RinneAbnormal, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); var testResult = new UrineMicroalbuminTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); testResult.SerialKey = CreateResultReadingforInputValues((int)ReadingLabels.MicroalbuminSerialKey, customerEventReadingEntities); testResult.MicroalbuminValue = CreateResultReadingforString((int)ReadingLabels.MicroalbuminValue, customerEventReadingEntities); if (customerEventScreeningTestEntity.TestMedia != null && customerEventScreeningTestEntity.TestMedia.Count > 0) { var fileEntityCollection = customerEventScreeningTestEntity.FileCollectionViaTestMedia.ToList(); var testMediaEntity = customerEventScreeningTestEntity.TestMedia.FirstOrDefault(); testResult.ResultImage = new ResultMedia(testMediaEntity.MediaId) { File = GetFileObjectfromEntity(testMediaEntity.FileId, fileEntityCollection), Thumbnail = testMediaEntity.ThumbnailFileId != null ? new File(testMediaEntity.ThumbnailFileId.Value) : null, ReadingSource = testMediaEntity.IsManual ? ReadingSource.Manual : ReadingSource.Automatic }; } var customerEventTestStandardFindingEntities = customerEventScreeningTestEntity.CustomerEventTestStandardFinding.ToList(); var standardFindingTestReadingEntities = customerEventScreeningTestEntity.StandardFindingTestReadingCollectionViaCustomerEventTestStandardFinding.ToList(); if (customerEventTestStandardFindingEntities.Any()) { var testResultService = new TestResultService(); var standardFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.UrineMicroalbumin); customerEventTestStandardFindingEntities.ForEach(customerEventTestStandardFindingEntity => { var standardFindingTestReadingEntity = standardFindingTestReadingEntities.Find(entity => entity.StandardFindingTestReadingId == customerEventTestStandardFindingEntity.StandardFindingTestReadingId); if (standardFindingTestReadingEntity == null) { return; } var finding = CreateFindingObject(customerEventTestStandardFindingEntity, standardFindings, standardFindingTestReadingEntity, null); if (finding != null) { testResult.Finding = finding; return; } }); } testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); var testResult = new QualityMeasuresTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventTestStandardFindingEntities = customerEventScreeningTestEntity.CustomerEventTestStandardFinding.ToList(); var standardFindingTestReadingEntities = customerEventScreeningTestEntity.StandardFindingTestReadingCollectionViaCustomerEventTestStandardFinding.ToList(); if (customerEventTestStandardFindingEntities.Any()) { var testResultService = new TestResultService(); var functionalAssessmentScore = testResultService.GetAllStandardFindings <int?>((int)TestType.QualityMeasures, (int)ReadingLabels.FunctionalAssessmentScore); var painAssessmentScore = testResultService.GetAllStandardFindings <int?>((int)TestType.QualityMeasures, (int)ReadingLabels.PainAssessmentScore); customerEventTestStandardFindingEntities.ForEach(customerEventTestStandardFindingEntity => { var standardFindingTestReadingEntity = standardFindingTestReadingEntities.Find(entity => entity.StandardFindingTestReadingId == customerEventTestStandardFindingEntity.StandardFindingTestReadingId); if (standardFindingTestReadingEntity == null) { return; } var finding = CreateFindingObject(customerEventTestStandardFindingEntity, functionalAssessmentScore, standardFindingTestReadingEntity, (int)ReadingLabels.FunctionalAssessmentScore); if (finding != null) { testResult.FunctionalAssessmentScore = finding; return; } finding = CreateFindingObject(customerEventTestStandardFindingEntity, painAssessmentScore, standardFindingTestReadingEntity, (int)ReadingLabels.PainAssessmentScore); if (finding != null) { testResult.PainAssessmentScore = finding; return; } }); } testResult.MemoryRecallScore = CreateResultReadingforNullableInt((int)ReadingLabels.MemoryRecallScore, customerEventReadingEntities); testResult.ClockPass = CreateResultReading((int)ReadingLabels.ClockPass, customerEventReadingEntities); testResult.ClockFail = CreateResultReading((int)ReadingLabels.ClockFail, customerEventReadingEntities); testResult.GaitPass = CreateResultReading((int)ReadingLabels.GaitPass, customerEventReadingEntities); testResult.GaitFail = CreateResultReading((int)ReadingLabels.GaitFail, customerEventReadingEntities); testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new WomenBloodPanelTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.LCRP = CreateResultReadingforInputValues((int)ReadingLabels.LCRP, customerEventReadingEntities); testResult.TSHSCR = CreateResultReadingforInputValues((int)ReadingLabels.TSHSCR, customerEventReadingEntities); testResult.VitD = CreateResultReadingforInputValues((int)ReadingLabels.VitD, customerEventReadingEntities); testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities); testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities); return(testResult); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); var testResult = new PneumococcalTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId) { Manufacturer = CreateResultReadingforInputValues((int)ReadingLabels.PneumococcalManufacturer, customerEventReadingEntities), LotNumber = CreateResultReadingforInputValues((int)ReadingLabels.PneumococcalLotNumber, customerEventReadingEntities), TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities), RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities) }; return(testResult); }