Association between exposure to surgery and development of permanent cognitive impairment