They cannot terminate you for having a medical condition or disability--such would be illegal disability-based discrimination--but they can terminate you for other reasons, including excessive absenteeism if you missed work without using FMLA leave (which you were apparently not eligible for) or paid time off you had earned  (e.g. sick or vacation days). Having a medical condition doesn't protect you from being terminated; it just means you can't be terminated for the condition, but unauthorized or excessive absence, even if due to the condition, is considered behavior (missing work) not a condition, and is grounds for termination.