You have some legal rights, but they may not be enough to help you:1) If the company is covered by the Family and Medical Leave Act (FMLA)--which it might be; the basic cut off is 50 employees or more--you may use FMLA leave to take up to 12 weeks of leave per year for medical reasons; that leave may be split up, so it may be a day here and there as you need it; but it is unpaid leave, and once it's all used for the year,  you can't invoke it. Also, you have to specifically say you are taking FMLA leave.2) A company cannot discriminate against an employee with a disabilty, but not discriminating means only making "reasonable accomodations." Reasonable accomodations are ones which are not too costly, in terms of money or disrupttion, to the employer. If you have been missing many days (and especially if doing so without prior notice or warning) and/or can't do the duties you were hired to do, it may be that it would be unreasonable to expect the company to keep employing you.