public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as AllergyIntolerance;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Criticality_Element != null)
                {
                    dest.Criticality_Element = (Code <Hl7.Fhir.Model.AllergyIntolerance.Criticality>)Criticality_Element.DeepCopy();
                }
                if (SensitivityType_Element != null)
                {
                    dest.SensitivityType_Element = (Code <Hl7.Fhir.Model.AllergyIntolerance.SensitivityType>)SensitivityType_Element.DeepCopy();
                }
                if (RecordedDateElement != null)
                {
                    dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.AllergyIntolerance.SensitivityStatus>)StatusElement.DeepCopy();
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Recorder != null)
                {
                    dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy();
                }
                if (Substance != null)
                {
                    dest.Substance = (Hl7.Fhir.Model.ResourceReference)Substance.DeepCopy();
                }
                if (Reaction != null)
                {
                    dest.Reaction = new List <Hl7.Fhir.Model.ResourceReference>(Reaction.DeepCopy());
                }
                if (SensitivityTest != null)
                {
                    dest.SensitivityTest = new List <Hl7.Fhir.Model.ResourceReference>(SensitivityTest.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (Identifier != null)
            {
                result.AddRange(Identifier.Validate());
            }
            if (Criticality_Element != null)
            {
                result.AddRange(Criticality_Element.Validate());
            }
            if (SensitivityType_Element != null)
            {
                result.AddRange(SensitivityType_Element.Validate());
            }
            if (RecordedDateElement != null)
            {
                result.AddRange(RecordedDateElement.Validate());
            }
            if (StatusElement != null)
            {
                result.AddRange(StatusElement.Validate());
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (Recorder != null)
            {
                result.AddRange(Recorder.Validate());
            }
            if (Substance != null)
            {
                result.AddRange(Substance.Validate());
            }
            if (Reaction != null)
            {
                Reaction.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (SensitivityTest != null)
            {
                SensitivityTest.ForEach(elem => result.AddRange(elem.Validate()));
            }

            return(result);
        }
示例#3
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 (ClinicalStatus != null)
            {
                dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy();
            }
            if (VerificationStatus != null)
            {
                dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.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 (Encounter != null)
            {
                dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
            }
            if (Onset != null)
            {
                dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy();
            }
            if (Abatement != null)
            {
                dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopy();
            }
            if (RecordedDateElement != null)
            {
                dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy();
            }
            if (Recorder != null)
            {
                dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy();
            }
            if (Asserter != null)
            {
                dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy();
            }
            if (Stage != null)
            {
                dest.Stage = new List <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);
        }
    public override IDeepCopyable CopyTo(IDeepCopyable other)
    {
      var dest = other as AllergyIntolerance;

      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(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy();
      if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy();
      if(TypeElement != null) dest.TypeElement = (Code<Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceType>)TypeElement.DeepCopy();
      if(CategoryElement != null) dest.CategoryElement = new List<Code<Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceCategory>>(CategoryElement.DeepCopy());
      if(CriticalityElement != null) dest.CriticalityElement = (Code<Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceCriticality>)CriticalityElement.DeepCopy();
      if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
      if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
      if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
      if(Onset != null) dest.Onset = (Hl7.Fhir.Model.Element)Onset.DeepCopy();
      if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy();
      if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy();
      if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy();
      if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopy();
      if(Note != null) dest.Note = new List<Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
      if(Reaction != null) dest.Reaction = new List<Hl7.Fhir.Model.AllergyIntolerance.ReactionComponent>(Reaction.DeepCopy());
      return dest;
    }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as AllergyIntolerance;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (OnsetElement != null)
                {
                    dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopy();
                }
                if (RecordedDateElement != null)
                {
                    dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy();
                }
                if (Recorder != null)
                {
                    dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy();
                }
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (Reporter != null)
                {
                    dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopy();
                }
                if (Substance != null)
                {
                    dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceStatus>)StatusElement.DeepCopy();
                }
                if (CriticalityElement != null)
                {
                    dest.CriticalityElement = (Code <Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceCriticality>)CriticalityElement.DeepCopy();
                }
                if (TypeElement != null)
                {
                    dest.TypeElement = (Code <Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceType>)TypeElement.DeepCopy();
                }
                if (CategoryElement != null)
                {
                    dest.CategoryElement = (Code <Hl7.Fhir.Model.AllergyIntolerance.AllergyIntoleranceCategory>)CategoryElement.DeepCopy();
                }
                if (LastOccurenceElement != null)
                {
                    dest.LastOccurenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurenceElement.DeepCopy();
                }
                if (Note != null)
                {
                    dest.Note = (Hl7.Fhir.Model.Annotation)Note.DeepCopy();
                }
                if (Reaction != null)
                {
                    dest.Reaction = new List <Hl7.Fhir.Model.AllergyIntolerance.ReactionComponent>(Reaction.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }