Ejemplo n.º 1
0
        private static List <IshiharaPlateModel> GetSet(IshiharaTestType testType)
        {
            var plates = new List <IshiharaPlateModel>();

            if (testType == IshiharaTestType.Ishihara6)
            {
                InitializeSixPlate(plates);
            }
            if (testType == IshiharaTestType.Ishihara10)
            {
                throw new NotImplementedException();
            }
            if (testType == IshiharaTestType.Ishihara14)
            {
                InitializeFourteenPlate(plates);
            }
            if (testType == IshiharaTestType.Ishihara24)
            {
                InitializeTwentyFourPlate(plates);
            }
            if (testType == IshiharaTestType.Ishihara38)
            {
                InitializeThirtyEightPlate(plates);
            }

            return(plates);
        }
 protected IshiharaColorVisionClassification(List <IshiharaPlateAnswer> ishiharaSixPlate,
                                             IshiharaTestType testType)
 {
     TestType   = testType;
     AnswerList = ishiharaSixPlate ?? throw new ArgumentNullException(nameof(ishiharaSixPlate));
     PlateSet   = GetPlateSet(testType);
     if (ishiharaSixPlate.Count != PlateSet.Count)
     {
         throw new IndexOutOfRangeException(
                   $"{nameof(ishiharaSixPlate)} has {ishiharaSixPlate.Count} items and it should have {PlateSet.Count}.");
     }
 }
 private static int DetermineLowerLimitOfPass(IshiharaTestType testType)
 {
     if (testType == IshiharaTestType.Ishihara6)
     {
         return(6);
     }
     if (testType == IshiharaTestType.Ishihara10)
     {
         throw new NotImplementedException();
     }
     if (testType == IshiharaTestType.Ishihara14)
     {
         return(10);
     }
     return(testType == IshiharaTestType.Ishihara24 ? 13 : 17);
 }
 private static int DetermineUpperLimitOfFail(IshiharaTestType testType)
 {
     if (testType == IshiharaTestType.Ishihara6)
     {
         return(4);
     }
     if (testType == IshiharaTestType.Ishihara10)
     {
         throw new NotImplementedException();
     }
     if (testType == IshiharaTestType.Ishihara14)
     {
         return(7);
     }
     return(testType == IshiharaTestType.Ishihara24 ? 9 : 13);
 }
 private static int DetermineNumberOfSlidesToEvaluate(IshiharaTestType testType)
 {
     if (testType == IshiharaTestType.Ishihara6)
     {
         return(6);
     }
     if (testType == IshiharaTestType.Ishihara10)
     {
         return(10);
     }
     if (testType == IshiharaTestType.Ishihara14)
     {
         return(14);
     }
     return(testType == IshiharaTestType.Ishihara24 ? 24 : 38);
 }
 private static List <IshiharaPlateModel> GetPlateSet(IshiharaTestType testType)
 {
     if (testType == IshiharaTestType.Ishihara6)
     {
         return(IshiharaPlateSetRepository.SixPlateScreen());
     }
     if (testType == IshiharaTestType.Ishihara10)
     {
         return(IshiharaPlateSetRepository.SixPlateScreen());
     }
     if (testType == IshiharaTestType.Ishihara14)
     {
         return(IshiharaPlateSetRepository.FourteenPlateScreen());
     }
     return(testType == IshiharaTestType.Ishihara24
         ? IshiharaPlateSetRepository.TwentyFourPlateScreen()
         : IshiharaPlateSetRepository.ThirtyEightPlateScreen());
 }
 public IshiharaPlateReadLimits(IshiharaTestType testType)
 {
     UpperLimitOfFail = DetermineUpperLimitOfFail(testType);
     LowerLimitOfPass = DetermineLowerLimitOfPass(testType);
     SlidesToEvaluate = DetermineNumberOfSlidesToEvaluate(testType);
 }