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

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (SystemElement != null)
            {
                dest.SystemElement = (Code <Hl7.Fhir.Model.ContactPoint.ContactPointSystem>)SystemElement.DeepCopy();
            }
            if (ValueElement != null)
            {
                dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy();
            }
            if (UseElement != null)
            {
                dest.UseElement = (Code <Hl7.Fhir.Model.ContactPoint.ContactPointUse>)UseElement.DeepCopy();
            }
            if (RankElement != null)
            {
                dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy();
            }
            if (Period != null)
            {
                dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
            }
            return(dest);
        }
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as DiagnosisComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (Condition != null)
                {
                    dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy();
                }
                if (Role != null)
                {
                    dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy();
                }
                if (RankElement != null)
                {
                    dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy();
                }
                return(dest);
            }