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

            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 (ActiveElement != null)
            {
                dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy();
            }
            if (Name != null)
            {
                dest.Name = new List <Hl7.Fhir.Model.HumanName>(Name.DeepCopy());
            }
            if (Telecom != null)
            {
                dest.Telecom = new List <Hl7.Fhir.Model.ContactPoint>(Telecom.DeepCopy());
            }
            if (Address != null)
            {
                dest.Address = new List <Hl7.Fhir.Model.Address>(Address.DeepCopy());
            }
            if (GenderElement != null)
            {
                dest.GenderElement = (Code <Hl7.Fhir.Model.AdministrativeGender>)GenderElement.DeepCopy();
            }
            if (BirthDateElement != null)
            {
                dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy();
            }
            if (Photo != null)
            {
                dest.Photo = new List <Hl7.Fhir.Model.Attachment>(Photo.DeepCopy());
            }
            if (Qualification != null)
            {
                dest.Qualification = new List <Hl7.Fhir.Model.Practitioner.QualificationComponent>(Qualification.DeepCopy());
            }
            if (Communication != null)
            {
                dest.Communication = new List <Hl7.Fhir.Model.CodeableConcept>(Communication.DeepCopy());
            }
            return(dest);
        }
Example #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Practitioner;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Name != null)
                {
                    dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy();
                }
                if (Telecom != null)
                {
                    dest.Telecom = new List <Hl7.Fhir.Model.Contact>(Telecom.DeepCopy());
                }
                if (Address != null)
                {
                    dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy();
                }
                if (Gender != null)
                {
                    dest.Gender = (Hl7.Fhir.Model.CodeableConcept)Gender.DeepCopy();
                }
                if (BirthDateElement != null)
                {
                    dest.BirthDateElement = (Hl7.Fhir.Model.FhirDateTime)BirthDateElement.DeepCopy();
                }
                if (Photo != null)
                {
                    dest.Photo = new List <Hl7.Fhir.Model.Attachment>(Photo.DeepCopy());
                }
                if (Organization != null)
                {
                    dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy();
                }
                if (Role != null)
                {
                    dest.Role = new List <Hl7.Fhir.Model.CodeableConcept>(Role.DeepCopy());
                }
                if (Specialty != null)
                {
                    dest.Specialty = new List <Hl7.Fhir.Model.CodeableConcept>(Specialty.DeepCopy());
                }
                if (Period != null)
                {
                    dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                }
                if (Location != null)
                {
                    dest.Location = new List <Hl7.Fhir.Model.ResourceReference>(Location.DeepCopy());
                }
                if (Qualification != null)
                {
                    dest.Qualification = new List <Hl7.Fhir.Model.Practitioner.PractitionerQualificationComponent>(Qualification.DeepCopy());
                }
                if (Communication != null)
                {
                    dest.Communication = new List <Hl7.Fhir.Model.CodeableConcept>(Communication.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }