public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (ExposureDateElement != null)
                {
                    result.AddRange(ExposureDateElement.Validate());
                }
                if (ExposureTypeElement != null)
                {
                    result.AddRange(ExposureTypeElement.Validate());
                }
                if (CausalityExpectationElement != null)
                {
                    result.AddRange(CausalityExpectationElement.Validate());
                }
                if (Substance != null)
                {
                    result.AddRange(Substance.Validate());
                }

                return(result);
            }
예제 #2
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as AdverseReactionExposureComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (DateElement != null)
                    {
                        dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                    }
                    if (TypeElement != null)
                    {
                        dest.TypeElement = (Code <Hl7.Fhir.Model.AdverseReaction.ExposureType>)TypeElement.DeepCopy();
                    }
                    if (CausalityExpectationElement != null)
                    {
                        dest.CausalityExpectationElement = (Code <Hl7.Fhir.Model.AdverseReaction.CausalityExpectation>)CausalityExpectationElement.DeepCopy();
                    }
                    if (Substance != null)
                    {
                        dest.Substance = (Hl7.Fhir.Model.ResourceReference)Substance.DeepCopy();
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }