Ejemplo n.º 1
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 (ActiveElement != null)
                {
                    dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy();
                }
                if (Name != null)
                {
                    dest.Name = (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 (PractitionerRole != null)
                {
                    dest.PractitionerRole = new List <Hl7.Fhir.Model.Practitioner.PractitionerRoleComponent>(PractitionerRole.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);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }