/// <summary>
        /// Validates this Person as an IPersonPrescriberInstructionRecipient
        /// </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>
        void IPersonPrescriberInstructionRecipient.Validate(string path, List <ValidationMessage> messages)
        {
            var vb = new ValidationBuilder(path, messages);

            if (vb.ArgumentRequiredCheck("Identifiers", Identifiers))
            {
                vb.RangeCheck("Identifiers", Identifiers, 1, 1);

                for (var x = 0; x < Identifiers.Count; x++)
                {
                    Identifiers[x].Validate(
                        vb.Path + string.Format("Identifiers[{0}]", x), vb.Messages);
                }
            }

            if (vb.ArgumentRequiredCheck("PersonNames", PersonNames))
            {
                vb.RangeCheck("PersonNames", PersonNames, 1, 1);

                if (PersonNames != null)
                {
                    for (var x = 0; x < PersonNames.Count; x++)
                    {
                        PersonNames[x].Validate(vb.Path + string.Format("PersonName[{0}]", x), vb.Messages);
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Validates this result group
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages to date, these may be added to within this method</param>
        void IImagingResultGroup.Validate(string path, List <ValidationMessage> messages)
        {
            var resultGroup = (IImagingResultGroup)this;
            var results     = resultGroup.Results;

            var validationBuilder = new ValidationBuilder(path, messages);

            if (validationBuilder.ArgumentRequiredCheck("ResultGroupName", ResultGroupName))
            {
                if (ResultGroupName != null)
                {
                    ResultGroupName.ValidateMandatory(validationBuilder.Path + "ResultGroupName", messages);
                }
            }

            if (validationBuilder.ArgumentRequiredCheck("Results", results))
            {
                if (validationBuilder.RangeCheck("Results", results, 1, Int32.MaxValue))
                {
                    if (results != null)
                    {
                        results.ForEach(testResult => testResult.Validate(validationBuilder.Path + "Results", messages));
                    }
                }
            }

            if (AnatomicalSite != null)
            {
                if (AnatomicalSite != null)
                {
                    AnatomicalSite.Validate(validationBuilder.Path + "AnatomicalSite", messages);
                }
            }
        }
Example #3
0
        /// <summary>
        /// Validates this result group
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages to date, these may be added to within this method</param>
        void ITestResultGroup.Validate(string path, List <ValidationMessage> messages)
        {
            var resultGroup = (ITestResultGroup)this;
            var results     = resultGroup.Results;

            var validationBuilder = new ValidationBuilder(path, messages);

            if (validationBuilder.ArgumentRequiredCheck("ResultGroupName", ResultGroupName))
            {
                if (ResultGroupName != null)
                {
                    ResultGroupName.Validate(validationBuilder.Path + "ResultGroupName", messages);
                }
            }

            if (validationBuilder.ArgumentRequiredCheck("Results", results))
            {
                if (validationBuilder.RangeCheck("Results", results, 1, Int32.MaxValue))
                {
                    if (results != null)
                    {
                        results.ForEach(testResult => testResult.Validate(validationBuilder.Path + "Results", messages));
                    }
                }
            }

            if (ResultGroupSpecimenDetail != null)
            {
                ResultGroupSpecimenDetail.Validate(validationBuilder.Path + "ResultGroupSpecimenDetail", messages);
            }
        }
        /// <summary>
        /// Validates this electronic communication detail
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages to date, these may be added to within this method</param>
        public void Validate(string path, List <ValidationMessage> messages)
        {
            var vb = new ValidationBuilder(path, messages);

            vb.ArgumentRequiredCheck("Address", Address);

            if (vb.ArgumentRequiredCheck("Usage", Usage))
            {
                vb.RangeCheck("Usage", Usage, 1, Int32.MaxValue);
            }
        }