public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as FamilyMemberHistory; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (DateElement != null) { dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.FamilyMemberHistory.FamilyHistoryStatus>)StatusElement.DeepCopy(); } if (NameElement != null) { dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); } if (Relationship != null) { dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); } if (GenderElement != null) { dest.GenderElement = (Code <Hl7.Fhir.Model.AdministrativeGender>)GenderElement.DeepCopy(); } if (Born != null) { dest.Born = (Hl7.Fhir.Model.Element)Born.DeepCopy(); } if (Age != null) { dest.Age = (Hl7.Fhir.Model.Element)Age.DeepCopy(); } if (Deceased != null) { dest.Deceased = (Hl7.Fhir.Model.Element)Deceased.DeepCopy(); } if (Note != null) { dest.Note = (Hl7.Fhir.Model.Annotation)Note.DeepCopy(); } if (Condition != null) { dest.Condition = new List <Hl7.Fhir.Model.FamilyMemberHistory.ConditionComponent>(Condition.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }