Former England international Samit Patel is to leave Nottinghamshire after a 22-year professional career with the county.