private AgeGroupMix CopyCalculatedAgeGroupMix(AgeGroupMix calculatedAgeGroupMix)
        {
            var ageGroupCounts = new List<AgeGroupCount>();
            

            foreach (var ageGroupCount in calculatedAgeGroupMix.AgeGroupCounts)
            {
                var _ageGroupCount = new AgeGroupCount
                {
                    AgeGroup = ageGroupCount.AgeGroup,
                    MemberCount = ageGroupCount.MemberCount
                };
                ageGroupCounts.Add(_ageGroupCount);
            }

            var addCalculatedAgeGroupMix = new AgeGroupMix
            {
                AgeGroupCounts = ageGroupCounts
            };
            return addCalculatedAgeGroupMix;
        }
        private void Combination(int index, AgeGroupMix calculatedAgeGroupMix)
        {
            if (index == SortedAgeGroupVisits.Count)
                return;
            
            var ageGroupCount = new AgeGroupCount
            {
                AgeGroup = SortedAgeGroupVisits[index]
            };
            for (var i = 0;; i++)
            {
                var existingAgeGroup =
                    calculatedAgeGroupMix.AgeGroupCounts.Find(
                        cag => cag.AgeGroup.AgeGroupId == ageGroupCount.AgeGroup.AgeGroupId);
               
                if (existingAgeGroup != null)
                    existingAgeGroup.MemberCount = i;
                else
                {
                    ageGroupCount.MemberCount = i;
                    calculatedAgeGroupMix.AgeGroupCounts.Add(ageGroupCount);
                }

                if (calculatedAgeGroupMix.TotalVisits == TargetPhysicianVisit)
                {
                    calculatedAgeGroupMix.AgeGroupCounts.RemoveAll(agc => agc.MemberCount == 0);
                    ResultSet.Add(CopyCalculatedAgeGroupMix(calculatedAgeGroupMix));
                    calculatedAgeGroupMix.AgeGroupCounts.Remove(ageGroupCount);
                    return;
                }
                else if (calculatedAgeGroupMix.TotalVisits < TargetPhysicianVisit)
                    Combination(index + 1, calculatedAgeGroupMix);
                else if (calculatedAgeGroupMix.TotalVisits > TargetPhysicianVisit)
                {
                    calculatedAgeGroupMix.AgeGroupCounts.Remove(ageGroupCount);
                    return;
                }
            }

        }