๐๐ผ๐ถ๐ป๐ด ๐๐ผ ๐๐ต๐ฒ ๐ฒ๐บ๐ฏ๐ฎ๐๐๐ ๐ถ๐ป ๐บ๐ ๐ต๐ผ๐บ๐ฒ ๐ฐ๐ผ๐๐ป๐๐ฟ๐ ๐ถ๐ ๐ธ๐ถ๐ป๐ฑ๐ฎ ๐ฐ๐ผ๐บ๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ฒ๐ฑ,
you're a bit mixed up about visa issuing ๐
ALL thai consulates in the world are online eVisa thru the web-portal, there is no 'go to an embassy', You apply online, you upload your documents, pay, they email you the visa if it's approved in a PDF file that you print and show with your passport when you stamp in
********************
If it's only 3-4 months, you could certainly fly in free stamp for 60 days (visa exempt) take the one 30 day extension for 1900baht, then check with your immigration office if you can do the "visit thai family 60 day extension (if you're married to a thai) OR get the documents from the hospital and apply for a medical extension (which can be granted from 30-90 days depending on immigrations)
Another option is;
If you're married to a thai you could apply online for a 90 day Non-O visa based on marriage thru the thai consulate in your country before you come here, that would get you stamped in for 90 days when you arrive and then you could take the 60 day visit thai family extension after that