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

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

            base.CopyTo(dest);
            if (TypeElement != null)
            {
                dest.TypeElement = (Code <Hl7.Fhir.Model.RelatedArtifact.RelatedArtifactType>)TypeElement.DeepCopy();
            }
            if (LabelElement != null)
            {
                dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy();
            }
            if (DisplayElement != null)
            {
                dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy();
            }
            if (Citation != null)
            {
                dest.Citation = (Hl7.Fhir.Model.Markdown)Citation.DeepCopy();
            }
            if (UrlElement != null)
            {
                dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy();
            }
            if (Document != null)
            {
                dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopy();
            }
            if (ResourceElement != null)
            {
                dest.ResourceElement = (Hl7.Fhir.Model.Canonical)ResourceElement.DeepCopy();
            }
            return(dest);
        }
Beispiel #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Identifier;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (UseElement != null)
                {
                    dest.UseElement = (Code <Hl7.Fhir.Model.Identifier.IdentifierUse>)UseElement.DeepCopy();
                }
                if (LabelElement != null)
                {
                    dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy();
                }
                if (SystemElement != null)
                {
                    dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
                }
                if (ValueElement != null)
                {
                    dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy();
                }
                if (Period != null)
                {
                    dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                }
                if (Assigner != null)
                {
                    dest.Assigner = (Hl7.Fhir.Model.ResourceReference)Assigner.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }