You cannot get a Tourist Visa in Thailand but if you are on one you can get your hospital to apply for a Medical Extension which, if accepted, can get you up to 90 days extra per application
Some get their first application accepted online and likewise the first when returning to Thailand. Some provinces will approve them but most won't hence Tod's post which will apply to most people, plan for the worst case.