public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DeviceComponent; if (dest != null) { base.CopyTo(dest); if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (Identifier != null) { dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); } if (LastSystemChangeElement != null) { dest.LastSystemChangeElement = (Hl7.Fhir.Model.Instant)LastSystemChangeElement.DeepCopy(); } if (Source != null) { dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); } if (Parent != null) { dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); } if (OperationalStatus != null) { dest.OperationalStatus = new List <Hl7.Fhir.Model.CodeableConcept>(OperationalStatus.DeepCopy()); } if (ParameterGroup != null) { dest.ParameterGroup = (Hl7.Fhir.Model.CodeableConcept)ParameterGroup.DeepCopy(); } if (MeasurementPrincipleElement != null) { dest.MeasurementPrincipleElement = (Code <Hl7.Fhir.Model.DeviceComponent.Measmnt_Principle>)MeasurementPrincipleElement.DeepCopy(); } if (ProductionSpecification != null) { dest.ProductionSpecification = new List <Hl7.Fhir.Model.DeviceComponent.ProductionSpecificationComponent>(ProductionSpecification.DeepCopy()); } if (LanguageCode != null) { dest.LanguageCode = (Hl7.Fhir.Model.CodeableConcept)LanguageCode.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }