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

            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 (ClinicalStatusElement != null)
            {
                dest.ClinicalStatusElement = (Code <Hl7.Fhir.Model.Condition.ConditionClinicalStatusCodes>)ClinicalStatusElement.DeepCopy();
            }
            if (VerificationStatusElement != null)
            {
                dest.VerificationStatusElement = (Code <Hl7.Fhir.Model.Condition.ConditionVerificationStatus>)VerificationStatusElement.DeepCopy();
            }
            if (Category != null)
            {
                dest.Category = new List <Hl7.Fhir.Model.CodeableConcept>(Category.DeepCopy());
            }
            if (Severity != null)
            {
                dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy();
            }
            if (Code != null)
            {
                dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
            }
            if (BodySite != null)
            {
                dest.BodySite = new List <Hl7.Fhir.Model.CodeableConcept>(BodySite.DeepCopy());
            }
            if (Subject != null)
            {
                dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
            }
            if (Context != null)
            {
                dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy();
            }
            if (Onset != null)
            {
                dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy();
            }
            if (Abatement != null)
            {
                dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopy();
            }
            if (AssertedDateElement != null)
            {
                dest.AssertedDateElement = (Hl7.Fhir.Model.FhirDateTime)AssertedDateElement.DeepCopy();
            }
            if (Asserter != null)
            {
                dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy();
            }
            if (Stage != null)
            {
                dest.Stage = (Hl7.Fhir.Model.Condition.StageComponent)Stage.DeepCopy();
            }
            if (Evidence != null)
            {
                dest.Evidence = new List <Hl7.Fhir.Model.Condition.EvidenceComponent>(Evidence.DeepCopy());
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            return(dest);
        }
Example #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Condition;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Asserter != null)
                {
                    dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy();
                }
                if (DateRecordedElement != null)
                {
                    dest.DateRecordedElement = (Hl7.Fhir.Model.Date)DateRecordedElement.DeepCopy();
                }
                if (Code != null)
                {
                    dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
                }
                if (Category != null)
                {
                    dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy();
                }
                if (ClinicalStatusElement != null)
                {
                    dest.ClinicalStatusElement = (Hl7.Fhir.Model.Code)ClinicalStatusElement.DeepCopy();
                }
                if (VerificationStatusElement != null)
                {
                    dest.VerificationStatusElement = (Code <Hl7.Fhir.Model.Condition.ConditionVerificationStatus>)VerificationStatusElement.DeepCopy();
                }
                if (Severity != null)
                {
                    dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy();
                }
                if (Onset != null)
                {
                    dest.Onset = (Hl7.Fhir.Model.Element)Onset.DeepCopy();
                }
                if (Abatement != null)
                {
                    dest.Abatement = (Hl7.Fhir.Model.Element)Abatement.DeepCopy();
                }
                if (Stage != null)
                {
                    dest.Stage = (Hl7.Fhir.Model.Condition.StageComponent)Stage.DeepCopy();
                }
                if (Evidence != null)
                {
                    dest.Evidence = new List <Hl7.Fhir.Model.Condition.EvidenceComponent>(Evidence.DeepCopy());
                }
                if (BodySite != null)
                {
                    dest.BodySite = new List <Hl7.Fhir.Model.CodeableConcept>(BodySite.DeepCopy());
                }
                if (NotesElement != null)
                {
                    dest.NotesElement = (Hl7.Fhir.Model.FhirString)NotesElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Example #3
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Condition;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Asserter != null)
                {
                    dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy();
                }
                if (DateAssertedElement != null)
                {
                    dest.DateAssertedElement = (Hl7.Fhir.Model.Date)DateAssertedElement.DeepCopy();
                }
                if (Code != null)
                {
                    dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
                }
                if (Category != null)
                {
                    dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.Condition.ConditionStatus>)StatusElement.DeepCopy();
                }
                if (Certainty != null)
                {
                    dest.Certainty = (Hl7.Fhir.Model.CodeableConcept)Certainty.DeepCopy();
                }
                if (Severity != null)
                {
                    dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy();
                }
                if (Onset != null)
                {
                    dest.Onset = (Hl7.Fhir.Model.Element)Onset.DeepCopy();
                }
                if (Abatement != null)
                {
                    dest.Abatement = (Hl7.Fhir.Model.Element)Abatement.DeepCopy();
                }
                if (Stage != null)
                {
                    dest.Stage = (Hl7.Fhir.Model.Condition.ConditionStageComponent)Stage.DeepCopy();
                }
                if (Evidence != null)
                {
                    dest.Evidence = new List <Hl7.Fhir.Model.Condition.ConditionEvidenceComponent>(Evidence.DeepCopy());
                }
                if (Location != null)
                {
                    dest.Location = new List <Hl7.Fhir.Model.Condition.ConditionLocationComponent>(Location.DeepCopy());
                }
                if (RelatedItem != null)
                {
                    dest.RelatedItem = new List <Hl7.Fhir.Model.Condition.ConditionRelatedItemComponent>(RelatedItem.DeepCopy());
                }
                if (NotesElement != null)
                {
                    dest.NotesElement = (Hl7.Fhir.Model.FhirString)NotesElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }