public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (ReactionDateElement != null) { result.AddRange(ReactionDateElement.Validate()); } if (Subject != null) { result.AddRange(Subject.Validate()); } if (DidNotOccurFlagElement != null) { result.AddRange(DidNotOccurFlagElement.Validate()); } if (Recorder != null) { result.AddRange(Recorder.Validate()); } if (Symptom != null) { Symptom.ForEach(elem => result.AddRange(elem.Validate())); } if (Exposure != null) { Exposure.ForEach(elem => result.AddRange(elem.Validate())); } return(result); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as AdverseReaction; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (DateElement != null) { dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (DidNotOccurFlagElement != null) { dest.DidNotOccurFlagElement = (Hl7.Fhir.Model.FhirBoolean)DidNotOccurFlagElement.DeepCopy(); } if (Recorder != null) { dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); } if (Symptom != null) { dest.Symptom = new List <Hl7.Fhir.Model.AdverseReaction.AdverseReactionSymptomComponent>(Symptom.DeepCopy()); } if (Exposure != null) { dest.Exposure = new List <Hl7.Fhir.Model.AdverseReaction.AdverseReactionExposureComponent>(Exposure.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }