public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Device; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Device.DeviceStatus>)StatusElement.DeepCopy(); } if (ManufacturerElement != null) { dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopy(); } if (ModelElement != null) { dest.ModelElement = (Hl7.Fhir.Model.FhirString)ModelElement.DeepCopy(); } if (VersionElement != null) { dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); } if (ManufactureDateElement != null) { dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopy(); } if (ExpiryElement != null) { dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); } if (UdiElement != null) { dest.UdiElement = (Hl7.Fhir.Model.FhirString)UdiElement.DeepCopy(); } if (LotNumberElement != null) { dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); } if (Owner != null) { dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); } if (Location != null) { dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Contact != null) { dest.Contact = new List <Hl7.Fhir.Model.ContactPoint>(Contact.DeepCopy()); } if (UrlElement != null) { dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }