public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DiagnosticReport; if (dest != null) { base.CopyTo(dest); if (Name != null) { dest.Name = (Hl7.Fhir.Model.CodeableConcept)Name.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.DiagnosticReport.DiagnosticReportStatus>)StatusElement.DeepCopy(); } if (IssuedElement != null) { dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Performer != null) { dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (RequestDetail != null) { dest.RequestDetail = new List <Hl7.Fhir.Model.ResourceReference>(RequestDetail.DeepCopy()); } if (ServiceCategory != null) { dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopy(); } if (Diagnostic != null) { dest.Diagnostic = (Hl7.Fhir.Model.Element)Diagnostic.DeepCopy(); } if (Specimen != null) { dest.Specimen = new List <Hl7.Fhir.Model.ResourceReference>(Specimen.DeepCopy()); } if (Result != null) { dest.Result = new List <Hl7.Fhir.Model.ResourceReference>(Result.DeepCopy()); } if (ImagingStudy != null) { dest.ImagingStudy = new List <Hl7.Fhir.Model.ResourceReference>(ImagingStudy.DeepCopy()); } if (Image != null) { dest.Image = new List <Hl7.Fhir.Model.DiagnosticReport.DiagnosticReportImageComponent>(Image.DeepCopy()); } if (ConclusionElement != null) { dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopy(); } if (CodedDiagnosis != null) { dest.CodedDiagnosis = new List <Hl7.Fhir.Model.CodeableConcept>(CodedDiagnosis.DeepCopy()); } if (PresentedForm != null) { dest.PresentedForm = new List <Hl7.Fhir.Model.Attachment>(PresentedForm.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }