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 PcpResultExportModel SetVisionData(PcpResultExportModel model, VisionTestResult testResult, bool useBlankValue = false) { var rightEyeCylindrical = (testResult.RightEyeCylindrical != null && testResult.RightEyeCylindrical.Reading.HasValue) ? testResult.RightEyeCylindrical.Reading.Value.ToString() : ""; var rightEyeSpherical = (testResult.RightEyeSpherical != null && testResult.RightEyeSpherical.Reading.HasValue) ? testResult.RightEyeSpherical.Reading.Value.ToString() : ""; model.VisionLevelRightEye = rightEyeCylindrical + "/" + rightEyeSpherical; var leftEyeCylindrical = (testResult.LeftEyeCylindrical != null && testResult.LeftEyeCylindrical.Reading.HasValue) ? testResult.LeftEyeCylindrical.Reading.Value.ToString() : ""; var leftEyeSpherical = (testResult.LeftEyeSpherical != null && testResult.LeftEyeSpherical.Reading.HasValue) ? testResult.LeftEyeSpherical.Reading.Value.ToString() : ""; model.VisionLevelLeftEye = leftEyeCylindrical + "/" + leftEyeSpherical; model.VisionUnabletoScreen = testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 ? PcpResultExportHelper.YesString : (useBlankValue ? "" : PcpResultExportHelper.NoString); if ((testResult.ResultStatus != null && testResult.ResultStatus.SelfPresent) || (testResult.PhysicianInterpretation != null && testResult.PhysicianInterpretation.IsCritical)) { model.VisionCritical = PcpResultExportHelper.YesString; } else if (!useBlankValue) { model.VisionCritical = PcpResultExportHelper.NoString; } if (testResult.PhysicianInterpretation != null) { model.VisionPhysicianNotes = testResult.PhysicianInterpretation.Remarks; } return(model); }