After leaving Buckingham Palace he was , for 12 years , secretary of the Medical Commission on Accident Prevention , a registered charity inspired by the precepts of Hahn , founded and run by doctors .