Nothing whatsoever in the law prohibits your employer from firing you "while under a doctor's care". There are some, limited, medical leaves that offer job protection in the short term but we can't, based on what you've posted, tell if they apply. But since you got your job back, even if they did apply you seem to be all set.
If this does not answer your question, please provide some details and don't use the preview feature - it doesn't work well.