You do not have to be a resident of Thailand to access public hospitals, you will have to pay for your care there.