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

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

                base.CopyTo(dest);
                if (Quantity != null)
                {
                    dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (LotNumberElement != null)
                {
                    dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy();
                }
                if (ExpiryElement != null)
                {
                    dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy();
                }
                if (UseByElement != null)
                {
                    dest.UseByElement = (Hl7.Fhir.Model.FhirDateTime)UseByElement.DeepCopy();
                }
                return(dest);
            }
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as InstanceComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (Identifier != null)
                    {
                        dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                    }
                    if (ExpiryElement != null)
                    {
                        dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy();
                    }
                    if (Quantity != null)
                    {
                        dest.Quantity = (Hl7.Fhir.Model.SimpleQuantity)Quantity.DeepCopy();
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
Beispiel #3
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (Type != null)
            {
                result.AddRange(Type.Validate());
            }
            if (ManufacturerElement != null)
            {
                result.AddRange(ManufacturerElement.Validate());
            }
            if (ModelElement != null)
            {
                result.AddRange(ModelElement.Validate());
            }
            if (VersionElement != null)
            {
                result.AddRange(VersionElement.Validate());
            }
            if (ExpiryElement != null)
            {
                result.AddRange(ExpiryElement.Validate());
            }
            if (Identity != null)
            {
                result.AddRange(Identity.Validate());
            }
            if (Owner != null)
            {
                result.AddRange(Owner.Validate());
            }
            if (AssignedId != null)
            {
                AssignedId.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Location != null)
            {
                result.AddRange(Location.Validate());
            }
            if (Patient != null)
            {
                result.AddRange(Patient.Validate());
            }
            if (Contact != null)
            {
                Contact.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (UrlElement != null)
            {
                result.AddRange(UrlElement.Validate());
            }

            return(result);
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Device;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.Device.DeviceStatus>)StatusElement.DeepCopy();
                }
                if (ManufacturerElement != null)
                {
                    dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopy();
                }
                if (ModelElement != null)
                {
                    dest.ModelElement = (Hl7.Fhir.Model.FhirString)ModelElement.DeepCopy();
                }
                if (VersionElement != null)
                {
                    dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy();
                }
                if (ManufactureDateElement != null)
                {
                    dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopy();
                }
                if (ExpiryElement != null)
                {
                    dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy();
                }
                if (UdiElement != null)
                {
                    dest.UdiElement = (Hl7.Fhir.Model.FhirString)UdiElement.DeepCopy();
                }
                if (LotNumberElement != null)
                {
                    dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy();
                }
                if (Owner != null)
                {
                    dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy();
                }
                if (Location != null)
                {
                    dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy();
                }
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (Contact != null)
                {
                    dest.Contact = new List <Hl7.Fhir.Model.ContactPoint>(Contact.DeepCopy());
                }
                if (UrlElement != null)
                {
                    dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }