Exemple #1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as SupplyRequest;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (Source != null)
                {
                    dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.SupplyRequest.SupplyRequestStatus>)StatusElement.DeepCopy();
                }
                if (Kind != null)
                {
                    dest.Kind = (Hl7.Fhir.Model.CodeableConcept)Kind.DeepCopy();
                }
                if (OrderedItem != null)
                {
                    dest.OrderedItem = (Hl7.Fhir.Model.ResourceReference)OrderedItem.DeepCopy();
                }
                if (Supplier != null)
                {
                    dest.Supplier = new List <Hl7.Fhir.Model.ResourceReference>(Supplier.DeepCopy());
                }
                if (Reason != null)
                {
                    dest.Reason = (Hl7.Fhir.Model.Element)Reason.DeepCopy();
                }
                if (When != null)
                {
                    dest.When = (Hl7.Fhir.Model.SupplyRequest.WhenComponent)When.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Exemple #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Supply;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Kind != null)
                {
                    dest.Kind = (Hl7.Fhir.Model.CodeableConcept)Kind.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.Supply.SupplyStatus>)StatusElement.DeepCopy();
                }
                if (OrderedItem != null)
                {
                    dest.OrderedItem = (Hl7.Fhir.Model.ResourceReference)OrderedItem.DeepCopy();
                }
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (Dispense != null)
                {
                    dest.Dispense = new List <Hl7.Fhir.Model.Supply.SupplyDispenseComponent>(Dispense.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }