It is possible to get a residence permit due to illness (§ 25.5. AufenthG). However, this is very difficult and you need good medical reports. Perhaps there are other ways for you to stay in Germany. This may include a Beschäftigungsduldung or a Ausbildungsduldung. Do you have a Duldung or a residence permit?