Esempio n. 1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as RiskAssessment;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (Condition != null)
                {
                    dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Performer != null)
                {
                    dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                }
                if (Method != null)
                {
                    dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy();
                }
                if (Basis != null)
                {
                    dest.Basis = new List <Hl7.Fhir.Model.ResourceReference>(Basis.DeepCopy());
                }
                if (Prediction != null)
                {
                    dest.Prediction = new List <Hl7.Fhir.Model.RiskAssessment.PredictionComponent>(Prediction.DeepCopy());
                }
                if (MitigationElement != null)
                {
                    dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Esempio n. 2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as RiskAssessment;

            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 = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopy();
            }
            if (Parent != null)
            {
                dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.ObservationStatus>)StatusElement.DeepCopy();
            }
            if (Method != null)
            {
                dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy();
            }
            if (Code != null)
            {
                dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
            }
            if (Subject != null)
            {
                dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
            }
            if (Encounter != null)
            {
                dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
            }
            if (Occurrence != null)
            {
                dest.Occurrence = (Hl7.Fhir.Model.Element)Occurrence.DeepCopy();
            }
            if (Condition != null)
            {
                dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy();
            }
            if (Performer != null)
            {
                dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy();
            }
            if (Reason != null)
            {
                dest.Reason = new List <Hl7.Fhir.Model.CodeableReference>(Reason.DeepCopy());
            }
            if (Basis != null)
            {
                dest.Basis = new List <Hl7.Fhir.Model.ResourceReference>(Basis.DeepCopy());
            }
            if (Prediction != null)
            {
                dest.Prediction = new List <Hl7.Fhir.Model.RiskAssessment.PredictionComponent>(Prediction.DeepCopy());
            }
            if (MitigationElement != null)
            {
                dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopy();
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            return(dest);
        }