示例#1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ClinicalImpression;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (Assessor != null)
                {
                    dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.ClinicalImpression.ClinicalImpressionStatus>)StatusElement.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (Previous != null)
                {
                    dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopy();
                }
                if (Problem != null)
                {
                    dest.Problem = new List <Hl7.Fhir.Model.ResourceReference>(Problem.DeepCopy());
                }
                if (Trigger != null)
                {
                    dest.Trigger = (Hl7.Fhir.Model.Element)Trigger.DeepCopy();
                }
                if (Investigations != null)
                {
                    dest.Investigations = new List <Hl7.Fhir.Model.ClinicalImpression.InvestigationsComponent>(Investigations.DeepCopy());
                }
                if (ProtocolElement != null)
                {
                    dest.ProtocolElement = (Hl7.Fhir.Model.FhirUri)ProtocolElement.DeepCopy();
                }
                if (SummaryElement != null)
                {
                    dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopy();
                }
                if (Finding != null)
                {
                    dest.Finding = new List <Hl7.Fhir.Model.ClinicalImpression.FindingComponent>(Finding.DeepCopy());
                }
                if (Resolved != null)
                {
                    dest.Resolved = new List <Hl7.Fhir.Model.CodeableConcept>(Resolved.DeepCopy());
                }
                if (RuledOut != null)
                {
                    dest.RuledOut = new List <Hl7.Fhir.Model.ClinicalImpression.RuledOutComponent>(RuledOut.DeepCopy());
                }
                if (PrognosisElement != null)
                {
                    dest.PrognosisElement = (Hl7.Fhir.Model.FhirString)PrognosisElement.DeepCopy();
                }
                if (Plan != null)
                {
                    dest.Plan = new List <Hl7.Fhir.Model.ResourceReference>(Plan.DeepCopy());
                }
                if (Action != null)
                {
                    dest.Action = new List <Hl7.Fhir.Model.ResourceReference>(Action.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }