private static bool BeAvalidStyle(PatientRxExamDetails patientExamDetails, LensRightLeft rightLeft)
        {
            var patientExam   = patientExamDetails.PatientExam;
            var lensRightLeft = rightLeft == LensRightLeft.Right ? 0 : 1;

            if (patientExam == null || patientExam.Details == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower.Style == null)
            {
                return(false);
            }

            var styles = rightLeft == LensRightLeft.Right ? patientExamDetails.RightLensStyles : patientExamDetails.LeftLenStyles;

            return(styles.Any(x => x.Key == patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower.Style.ID));
        }
        private static bool BeAvalidColor(PatientRxExamDetails patientExamDetails, LensRightLeft rightLeft)
        {
            var patientExam   = patientExamDetails.PatientExam;
            var lensRightLeft = rightLeft == LensRightLeft.Right ? 0 : 1;

            if (patientExam == null || patientExam.Details == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLColor == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLColor.ID == null)
            {
                return(false);
            }

            var colors = rightLeft == LensRightLeft.Right ? patientExamDetails.RightColors : patientExamDetails.LeftColors;

            return(colors.Any(x => x.KeyStr == patientExam.Details[lensRightLeft].ContactLensStockItem.CLColor.ID));
        }
        private static bool BeAvalidManufacturer(PatientRxExamDetails patientExamDetails, LensRightLeft rightLeft)
        {
            var patientExam   = patientExamDetails.PatientExam;
            var lensRightLeft = rightLeft == LensRightLeft.Right ? 0 : 1;

            if (patientExam == null || patientExam.Details == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower == null)
            {
                return(false);
            }

            if (patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower.Style == null)
            {
                return(false);
            }

            return(patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower.Style.Manufacturer != null && patientExamDetails.Manufacturers.Any(x => x.KeyStr.Contains(patientExam.Details[lensRightLeft].ContactLensStockItem.CLPower.Style.Manufacturer.ID)));
        }