Legally you cannot be fired from your job. They would get sued of their butts for that. Pregnancy is considered a medical disability. If you are on doctors orders to be on bedrest, you can provide them with that information. Most places are willing to work with you in order that they may cover their asses. See what your company policy is and check out this government website concerning this matter:
http://www.Dol.Gov/esa/whd/fmla/
particularly this part as well as that of maternity leave:
to take medical leave when the employee is unable to work because of a serious health condition.