public DnsResult ValidateForSubmission(IDnsRequestContext context) { I2B2Model m = GetModel(context); IList <string> errorMessages; if (Validate(m, out errorMessages)) { return(DnsResult.Success); } else { return(DnsResult.Failed(errorMessages.ToArray <string>())); } }
private static I2B2Model InitializeModel(I2B2Model m, IDnsRequestContext context) { m.RaceSelections = RaceSelectionList.races.Select(race => new StratificationCategoryLookUp { CategoryText = race.Name, StratificationCategoryId = race.Code }); m.SexSelections = SexSelectionList.sexes.Select(sex => new StratificationCategoryLookUp { CategoryText = sex.Name, StratificationCategoryId = sex.Code }); m.DiseaseSelections = DiseaseSelectionList.diseases.Select(disease => new ESPRequestBuilderSelection { Name = disease.Name, Display = disease.Display, Value = disease.Code }); var periodStratification = PeriodStratificationSelectionList.periods.Select(period => new StratificationCategoryLookUp { CategoryText = period.Name, StratificationCategoryId = period.Code }); var ageStratification = AgeStratificationSelectionList.ages.Select(age => new StratificationCategoryLookUp { CategoryText = age.Display, StratificationCategoryId = age.Code }); m.ReportSelections = new[] { new ReportSelection { Name = "AgeStratification", Display = "Age", Value = 1, SelectionList = ageStratification.ToList() }, new ReportSelection { Name = "SexStratification", Display = "Sex", Value = 2 }, new ReportSelection { Name = "PeriodStratification", Display = "Period", Value = 3, SelectionList = periodStratification.ToList() }, new ReportSelection { Name = "RaceStratification", Display = "Race", Value = 4 }, new ReportSelection { Name = "CenterStratification", Display = "Center", Value = 5 }, }; m.RequestType = I2B2RequestType.All.FirstOrDefault(rt => rt.Id == context.RequestType.ID); return(m); }
private bool Validate(I2B2Model m, out IList <string> errorMessages) { errorMessages = new List <string>(); return(true); }