This varies so widely from state to state, due to regulations unique to each--as well as school to school--and hospital to hospital,
These are questions that should be asked of both your specific school, as well as the inpatient facility to which you'd be assigned.
Many schools provide "take home" materials for students who are forced to discontinue attendance for necessary reasons, however. And your school would be the only source of an answer to this question...but I'm sure it would be as easy as contacting the secretary, and requesting to speak to the principal, after describing your situation, and desire to continue coursework independently.
I would venture to guess, however, that most facilities would be unlikely to offer academic coursework to inpatient clients. They generally are focused on activities specific to client's mental health needs, as well as discourage distractions for this focus...as well as any added stress that such work would represent. Of course, that is only my personal, in no way authoritative, opinion.
However, it is now generally fairly easy to arrange for summer school in order to make up most missed course credits, and taking the G.E.D. test is also an option to receive a high school degree. I would also think it would be likely that, especially considering the circumstances are related to a medical illness beyond your control, and assessed by a medical professional--that your school would allow you to simply continue in the following fall semester, if nothing else. However only your school authorities can answer this question.
I think you should focus on yourself, and getting well, also. Until you do so, any attempts to apply yourself to other obligations or pursuits would be likely to not end well, or at least not receive your best efforts.
Best wishes