public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DispenseComponent; if (dest != null) { base.CopyTo(dest); if (Product != null) { dest.Product = (Hl7.Fhir.Model.Coding)Product.DeepCopy(); } if (EyeElement != null) { dest.EyeElement = (Code <Hl7.Fhir.Model.VisionPrescription.VisionEyes>)EyeElement.DeepCopy(); } if (SphereElement != null) { dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopy(); } if (CylinderElement != null) { dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopy(); } if (AxisElement != null) { dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopy(); } if (PrismElement != null) { dest.PrismElement = (Hl7.Fhir.Model.FhirDecimal)PrismElement.DeepCopy(); } if (BaseElement != null) { dest.BaseElement = (Code <Hl7.Fhir.Model.VisionPrescription.VisionBase>)BaseElement.DeepCopy(); } if (AddElement != null) { dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopy(); } if (PowerElement != null) { dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopy(); } if (BackCurveElement != null) { dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopy(); } if (DiameterElement != null) { dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopy(); } if (Duration != null) { dest.Duration = (Hl7.Fhir.Model.SimpleQuantity)Duration.DeepCopy(); } if (ColorElement != null) { dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopy(); } if (BrandElement != null) { dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopy(); } if (NotesElement != null) { dest.NotesElement = (Hl7.Fhir.Model.FhirString)NotesElement.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }