There is nothing stopping you from coming in on a tourist visa, or exempt and just having the surgery. You can set all that up before you get to Thailand.
I THINK it is the form you fill out for the hospital that puts you in their system. You will need your passport. I had a routine eye checkup at Bangkok Hospital, and although it was all booked online, I had to fill out the form once I physically arrived. I was told to come early because I had to register before any treatment starts. So, I would guess "the certificate" just says you are in the system as a patient??
Haven't seen this one in a while. There was a covid insurance policy needed if you had to get tested in Thailand for your next destination (Mainly India and China), and if you tested positive, that means you had to either stay in Thailand, or go somewhere else.
But I think all of that is done away with in India, and maybe even China?
You could also take a side trip on the 45 day exemption (2 nights in Kuala Lumpur for example), then come back for another exemption period. Just a thought in case you were thinking of visiting another country.