public DiseaseDistroCmVm(AdminLevel a, int did, ICalcIndicators c)
 {
     adminLevel = a;
     r = new DiseaseRepository();
     model = r.CreateCm((DiseaseType)did);
     model.AdminLevelId = adminLevel.Id;
     calc = c;
 }
        public List<ReportIndicator> GetDiseaseDistroIndicators()
        {
            List<ReportIndicator> indicators = new List<ReportIndicator>();
            DiseaseRepository repo = new DiseaseRepository();
            var types = repo.GetSelectedDiseases();
            var pc = new ReportIndicator { Name = TranslationLookup.GetValue("PcNtds"), IsCategory = true };
            var cm = new ReportIndicator { Name = TranslationLookup.GetValue("OtherNtds"), IsCategory = true };
            indicators.Add(pc);
            indicators.Add(cm);
            foreach (var t in types.Where(i => i.DiseaseType == TranslationLookup.GetValue("PC")).OrderBy(t => t.DisplayName))
            {
                var cat = new ReportIndicator { Name = t.DisplayName, IsCategory = true };
                DiseaseDistroPc dd = repo.Create((DiseaseType)t.Id);
                foreach (var i in dd.Indicators)
                    cat.Children.Add(CreateReportIndicator(t.Id, i, t.DisplayName, t.DisplayNameKey));
                cat.Children = cat.Children.OrderBy(c => c.Name).ToList();
                pc.Children.Add(cat);
            }
            foreach (var t in types.Where(i => i.DiseaseType == TranslationLookup.GetValue("CM")).OrderBy(t => t.DisplayName))
            {
                var cat = new ReportIndicator { Name = t.DisplayName, IsCategory = true };
                DiseaseDistroCm dd = repo.CreateCm((DiseaseType)t.Id);
                foreach (var i in dd.Indicators)
                    cat.Children.Add(CreateReportIndicator(t.Id, i, t.DisplayName, t.DisplayNameKey));
                cat.Children = cat.Children.OrderBy(c => c.Name).ToList();
                cm.Children.Add(cat);
            }

            return indicators;
        }