you get a medical certificate from any clinic or hospital and you get the police back ground check from the Special Branch Police division.
This is the website for the Bangkok location, but I believe they have an office in Chiang Mai too (you'd have to post on a chiang mai related f/b group to find out where it is).
*****************************************