示例#1
0
        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 (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (Code != null)
            {
                dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.Medication.MedicationStatusCodes>)StatusElement.DeepCopy();
            }
            if (Manufacturer != null)
            {
                dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy();
            }
            if (Form != null)
            {
                dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy();
            }
            if (Amount != null)
            {
                dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopy();
            }
            if (Ingredient != null)
            {
                dest.Ingredient = new List <Hl7.Fhir.Model.Medication.IngredientComponent>(Ingredient.DeepCopy());
            }
            if (Batch != null)
            {
                dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopy();
            }
            return(dest);
        }
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as MedicationProductComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (Form != null)
                    {
                        dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy();
                    }
                    if (Ingredient != null)
                    {
                        dest.Ingredient = new List <Hl7.Fhir.Model.Medication.MedicationProductIngredientComponent>(Ingredient.DeepCopy());
                    }
                    if (Batch != null)
                    {
                        dest.Batch = new List <Hl7.Fhir.Model.Medication.MedicationProductBatchComponent>(Batch.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
示例#3
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as NutritionProduct;

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

            base.CopyTo(dest);
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.NutritionProduct.NutritionProductStatus>)StatusElement.DeepCopy();
            }
            if (Category != null)
            {
                dest.Category = new List <Hl7.Fhir.Model.CodeableConcept>(Category.DeepCopy());
            }
            if (Code != null)
            {
                dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
            }
            if (Manufacturer != null)
            {
                dest.Manufacturer = new List <Hl7.Fhir.Model.ResourceReference>(Manufacturer.DeepCopy());
            }
            if (Nutrient != null)
            {
                dest.Nutrient = new List <Hl7.Fhir.Model.NutritionProduct.NutrientComponent>(Nutrient.DeepCopy());
            }
            if (Ingredient != null)
            {
                dest.Ingredient = new List <Hl7.Fhir.Model.NutritionProduct.IngredientComponent>(Ingredient.DeepCopy());
            }
            if (KnownAllergen != null)
            {
                dest.KnownAllergen = new List <Hl7.Fhir.Model.CodeableReference>(KnownAllergen.DeepCopy());
            }
            if (ProductCharacteristic != null)
            {
                dest.ProductCharacteristic = new List <Hl7.Fhir.Model.NutritionProduct.ProductCharacteristicComponent>(ProductCharacteristic.DeepCopy());
            }
            if (Instance != null)
            {
                dest.Instance = (Hl7.Fhir.Model.NutritionProduct.InstanceComponent)Instance.DeepCopy();
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            return(dest);
        }
        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);
        }