public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (NameElement != null)
            {
                result.AddRange(NameElement.Validate());
            }
            if (Code != null)
            {
                result.AddRange(Code.Validate());
            }
            if (IsBrandElement != null)
            {
                result.AddRange(IsBrandElement.Validate());
            }
            if (Manufacturer != null)
            {
                result.AddRange(Manufacturer.Validate());
            }
            if (KindElement != null)
            {
                result.AddRange(KindElement.Validate());
            }
            if (Product != null)
            {
                result.AddRange(Product.Validate());
            }
            if (Package != null)
            {
                result.AddRange(Package.Validate());
            }

            return(result);
        }
Beispiel #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as NamingSystem;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (NameElement != null)
                {
                    dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.ConformanceResourceStatus>)StatusElement.DeepCopy();
                }
                if (KindElement != null)
                {
                    dest.KindElement = (Code <Hl7.Fhir.Model.NamingSystem.NamingSystemType>)KindElement.DeepCopy();
                }
                if (PublisherElement != null)
                {
                    dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy();
                }
                if (Contact != null)
                {
                    dest.Contact = new List <Hl7.Fhir.Model.NamingSystem.ContactComponent>(Contact.DeepCopy());
                }
                if (ResponsibleElement != null)
                {
                    dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (UseContext != null)
                {
                    dest.UseContext = new List <Hl7.Fhir.Model.CodeableConcept>(UseContext.DeepCopy());
                }
                if (UsageElement != null)
                {
                    dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy();
                }
                if (UniqueId != null)
                {
                    dest.UniqueId = new List <Hl7.Fhir.Model.NamingSystem.UniqueIdComponent>(UniqueId.DeepCopy());
                }
                if (ReplacedBy != null)
                {
                    dest.ReplacedBy = (Hl7.Fhir.Model.ResourceReference)ReplacedBy.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 NamingSystem;

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

            base.CopyTo(dest);
            if (NameElement != null)
            {
                dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.PublicationStatus>)StatusElement.DeepCopy();
            }
            if (KindElement != null)
            {
                dest.KindElement = (Code <Hl7.Fhir.Model.NamingSystem.NamingSystemType>)KindElement.DeepCopy();
            }
            if (DateElement != null)
            {
                dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
            }
            if (PublisherElement != null)
            {
                dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy();
            }
            if (Contact != null)
            {
                dest.Contact = new List <Hl7.Fhir.Model.ContactDetail>(Contact.DeepCopy());
            }
            if (ResponsibleElement != null)
            {
                dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopy();
            }
            if (Type != null)
            {
                dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
            }
            if (Description != null)
            {
                dest.Description = (Hl7.Fhir.Model.Markdown)Description.DeepCopy();
            }
            if (UseContext != null)
            {
                dest.UseContext = new List <Hl7.Fhir.Model.UsageContext>(UseContext.DeepCopy());
            }
            if (Jurisdiction != null)
            {
                dest.Jurisdiction = new List <Hl7.Fhir.Model.CodeableConcept>(Jurisdiction.DeepCopy());
            }
            if (UsageElement != null)
            {
                dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy();
            }
            if (UniqueId != null)
            {
                dest.UniqueId = new List <Hl7.Fhir.Model.NamingSystem.UniqueIdComponent>(UniqueId.DeepCopy());
            }
            return(dest);
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Medication;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (NameElement != null)
                {
                    dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
                }
                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 (KindElement != null)
                {
                    dest.KindElement = (Code <Hl7.Fhir.Model.Medication.MedicationKind>)KindElement.DeepCopy();
                }
                if (Product != null)
                {
                    dest.Product = (Hl7.Fhir.Model.Medication.MedicationProductComponent)Product.DeepCopy();
                }
                if (Package != null)
                {
                    dest.Package = (Hl7.Fhir.Model.Medication.MedicationPackageComponent)Package.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }