You can apply for a stay permit on humanitarian grounds. The law allows a stay permit for humanitarian reasons, and you need medical proof of your condition. This lets you remain lawfully while you recover, instead of falling into illegal stay because you could not process the paperwork in time.
Nationwide (all cities)
A legal route exists
There is a legal route for exactly this situation. The Exit-Entry Administration Law provides that a foreigner who needs to change from residence to stay for humanitarian reasons — or who otherwise needs a stay permit — can apply for one with approval from the exit-entry administration. The stay-permit service guide likewise lists humanitarian circumstances among the grounds.
The key evidence is medical
The key evidence is medical. To apply on humanitarian grounds you submit proof of your condition — hospital records, a diagnosis, or a doctor's certificate — together with the standard stay-permit application materials.
Do it before your stay runs out
The practical point: do this before your lawful stay runs out. A stay permit for humanitarian reasons keeps you legal while you recover, and it can be extended if the situation continues. Without it, an inability to process the paperwork in time does not by itself protect you from overstaying.