public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Goal; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (LifecycleStatusElement != null) { dest.LifecycleStatusElement = (Code <Hl7.Fhir.Model.Goal.GoalLifecycleStatus>)LifecycleStatusElement.DeepCopy(); } if (AchievementStatus != null) { dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopy(); } if (Category != null) { dest.Category = new List <Hl7.Fhir.Model.CodeableConcept>(Category.DeepCopy()); } if (ContinuousElement != null) { dest.ContinuousElement = (Hl7.Fhir.Model.FhirBoolean)ContinuousElement.DeepCopy(); } if (Priority != null) { dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); } if (Description != null) { dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Start != null) { dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopy(); } if (Target != null) { dest.Target = new List <Hl7.Fhir.Model.Goal.TargetComponent>(Target.DeepCopy()); } if (StatusDateElement != null) { dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopy(); } if (StatusReasonElement != null) { dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopy(); } if (ExpressedBy != null) { dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopy(); } if (Addresses != null) { dest.Addresses = new List <Hl7.Fhir.Model.ResourceReference>(Addresses.DeepCopy()); } if (Note != null) { dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy()); } if (Outcome != null) { dest.Outcome = new List <Hl7.Fhir.Model.CodeableReference>(Outcome.DeepCopy()); } return(dest); }