public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Medication; if (dest != null) { base.CopyTo(dest); if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (IsBrandElement != null) { dest.IsBrandElement = (Hl7.Fhir.Model.FhirBoolean)IsBrandElement.DeepCopy(); } if (Manufacturer != null) { dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); } if (Product != null) { dest.Product = (Hl7.Fhir.Model.Medication.ProductComponent)Product.DeepCopy(); } if (Package != null) { dest.Package = (Hl7.Fhir.Model.Medication.PackageComponent)Package.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Medication; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Medication.MedicationStatus>)StatusElement.DeepCopy(); } if (IsBrandElement != null) { dest.IsBrandElement = (Hl7.Fhir.Model.FhirBoolean)IsBrandElement.DeepCopy(); } if (IsOverTheCounterElement != null) { dest.IsOverTheCounterElement = (Hl7.Fhir.Model.FhirBoolean)IsOverTheCounterElement.DeepCopy(); } if (Manufacturer != null) { dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); } if (Form != null) { dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); } if (Ingredient != null) { dest.Ingredient = new List <Hl7.Fhir.Model.Medication.IngredientComponent>(Ingredient.DeepCopy()); } if (Package != null) { dest.Package = (Hl7.Fhir.Model.Medication.PackageComponent)Package.DeepCopy(); } if (Image != null) { dest.Image = new List <Hl7.Fhir.Model.Attachment>(Image.DeepCopy()); } return(dest); }