Only a handful or protected classes exist regarding at will employment
Gender, age, race, religion discrimination are protected. In all other respects, an at will employee may be legally fired.
It would be nice of the employer had been more flexible and understanding, yet it was not illegal for the employer to have been rigid and firm in firing you
You may have rights to medical leave under the Family and Medical Leave Act (FMLA) to medical leave if you are unable to perform your work functions for medical reasons. However, the FMLA does not apply to all employers or all employees. Specifically, the FMLA only applies to employers that have 50 or more employees. Employees of employers that are covered by the FMLA must meet requirements including being a full-time employee and having worked for the employer for over one year.
From you question it's impossible to say, but if you might meet the requirements to be covered by the FMLA you should contact an attorney.