コード例 #1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DeviceUseStatement;

            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 (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.DeviceUseStatement.DeviceUseStatementStatus>)StatusElement.DeepCopy();
            }
            if (Subject != null)
            {
                dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
            }
            if (WhenUsed != null)
            {
                dest.WhenUsed = (Hl7.Fhir.Model.Period)WhenUsed.DeepCopy();
            }
            if (Timing != null)
            {
                dest.Timing = (Hl7.Fhir.Model.Element)Timing.DeepCopy();
            }
            if (RecordedOnElement != null)
            {
                dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopy();
            }
            if (Source != null)
            {
                dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy();
            }
            if (Device != null)
            {
                dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy();
            }
            if (Indication != null)
            {
                dest.Indication = new List <Hl7.Fhir.Model.CodeableConcept>(Indication.DeepCopy());
            }
            if (BodySite != null)
            {
                dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy();
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            return(dest);
        }
コード例 #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DeviceUseRequest;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (BodySite != null)
                {
                    dest.BodySite = (Hl7.Fhir.Model.Element)BodySite.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.DeviceUseRequest.DeviceUseRequestStatus>)StatusElement.DeepCopy();
                }
                if (Device != null)
                {
                    dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Indication != null)
                {
                    dest.Indication = new List <Hl7.Fhir.Model.CodeableConcept>(Indication.DeepCopy());
                }
                if (NotesElement != null)
                {
                    dest.NotesElement = new List <Hl7.Fhir.Model.FhirString>(NotesElement.DeepCopy());
                }
                if (PrnReason != null)
                {
                    dest.PrnReason = new List <Hl7.Fhir.Model.CodeableConcept>(PrnReason.DeepCopy());
                }
                if (OrderedOnElement != null)
                {
                    dest.OrderedOnElement = (Hl7.Fhir.Model.FhirDateTime)OrderedOnElement.DeepCopy();
                }
                if (RecordedOnElement != null)
                {
                    dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopy();
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Timing != null)
                {
                    dest.Timing = (Hl7.Fhir.Model.Element)Timing.DeepCopy();
                }
                if (PriorityElement != null)
                {
                    dest.PriorityElement = (Code <Hl7.Fhir.Model.DeviceUseRequest.DeviceUseRequestPriority>)PriorityElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }