Exemplo n.º 1
0
        /// <summary>
        /// Validates this AdverseReactions
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages, these may be added to within this method</param>
        public void Validate(string path, List <ValidationMessage> messages)
        {
            var vb = new ValidationBuilder(path, messages);

            if (Reactions != null)
            {
                Reactions.ForEach(adverseReactions => adverseReactions.Validate(vb.Path + "Reactions", vb.Messages));
            }

            // Exclusion statement choice
            var choiceCheck = new Dictionary <string, object>()
            {
                { "Reactions", Reactions },
                { "GeneralStatement", ExclusionStatement }
            };

            vb.ChoiceCheck(choiceCheck);

            if (ExclusionStatement != null)
            {
                ExclusionStatement.Validate(vb.Path + "GeneralStatement", vb.Messages);
            }
        }