Exemplo n.º 1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Media;

            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 (BasedOn != null)
            {
                dest.BasedOn = new List <Hl7.Fhir.Model.ResourceReference>(BasedOn.DeepCopy());
            }
            if (PartOf != null)
            {
                dest.PartOf = new List <Hl7.Fhir.Model.ResourceReference>(PartOf.DeepCopy());
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.EventStatus>)StatusElement.DeepCopy();
            }
            if (Type != null)
            {
                dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
            }
            if (Modality != null)
            {
                dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopy();
            }
            if (View != null)
            {
                dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopy();
            }
            if (Subject != null)
            {
                dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
            }
            if (Encounter != null)
            {
                dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
            }
            if (Created != null)
            {
                dest.Created = (Hl7.Fhir.Model.DataType)Created.DeepCopy();
            }
            if (IssuedElement != null)
            {
                dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy();
            }
            if (Operator != null)
            {
                dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopy();
            }
            if (ReasonCode != null)
            {
                dest.ReasonCode = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonCode.DeepCopy());
            }
            if (BodySite != null)
            {
                dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy();
            }
            if (DeviceNameElement != null)
            {
                dest.DeviceNameElement = (Hl7.Fhir.Model.FhirString)DeviceNameElement.DeepCopy();
            }
            if (Device != null)
            {
                dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy();
            }
            if (HeightElement != null)
            {
                dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopy();
            }
            if (WidthElement != null)
            {
                dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopy();
            }
            if (FramesElement != null)
            {
                dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopy();
            }
            if (DurationElement != null)
            {
                dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy();
            }
            if (Content != null)
            {
                dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopy();
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            return(dest);
        }