Exemplo n.º 1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as MedicinalProductPharmaceutical;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (AdministrableDoseForm != null)
            {
                dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopy();
            }
            if (UnitOfPresentation != null)
            {
                dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy();
            }
            if (Ingredient != null)
            {
                dest.Ingredient = new List <Hl7.Fhir.Model.ResourceReference>(Ingredient.DeepCopy());
            }
            if (Device != null)
            {
                dest.Device = new List <Hl7.Fhir.Model.ResourceReference>(Device.DeepCopy());
            }
            if (Characteristics != null)
            {
                dest.Characteristics = new List <Hl7.Fhir.Model.MedicinalProductPharmaceutical.CharacteristicsComponent>(Characteristics.DeepCopy());
            }
            if (RouteOfAdministration != null)
            {
                dest.RouteOfAdministration = new List <Hl7.Fhir.Model.MedicinalProductPharmaceutical.RouteOfAdministrationComponent>(RouteOfAdministration.DeepCopy());
            }
            return(dest);
        }