public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as CarePlanActivityComponent; if (dest != null) { base.CopyTo(dest); if (GoalElement != null) { dest.GoalElement = new List <Hl7.Fhir.Model.IdRef>(GoalElement.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.CarePlan.CarePlanActivityStatus>)StatusElement.DeepCopy(); } if (ProhibitedElement != null) { dest.ProhibitedElement = (Hl7.Fhir.Model.FhirBoolean)ProhibitedElement.DeepCopy(); } if (ActionResulting != null) { dest.ActionResulting = new List <Hl7.Fhir.Model.ResourceReference>(ActionResulting.DeepCopy()); } if (NotesElement != null) { dest.NotesElement = (Hl7.Fhir.Model.FhirString)NotesElement.DeepCopy(); } if (Detail != null) { dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopy(); } if (Simple != null) { dest.Simple = (Hl7.Fhir.Model.CarePlan.CarePlanActivitySimpleComponent)Simple.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (CategoryElement != null) { result.AddRange(CategoryElement.Validate()); } if (Code != null) { result.AddRange(Code.Validate()); } if (StatusElement != null) { result.AddRange(StatusElement.Validate()); } if (ProhibitedElement != null) { result.AddRange(ProhibitedElement.Validate()); } if (Timing != null) { result.AddRange(Timing.Validate()); } if (Location != null) { result.AddRange(Location.Validate()); } if (Performer != null) { Performer.ForEach(elem => result.AddRange(elem.Validate())); } if (Product != null) { result.AddRange(Product.Validate()); } if (DailyAmount != null) { result.AddRange(DailyAmount.Validate()); } if (Quantity != null) { result.AddRange(Quantity.Validate()); } if (DetailsElement != null) { result.AddRange(DetailsElement.Validate()); } if (ActionTaken != null) { ActionTaken.ForEach(elem => result.AddRange(elem.Validate())); } if (NotesElement != null) { result.AddRange(NotesElement.Validate()); } return(result); }