When you are healthy and strong enough, then you will have the go-ahead and the strength to take care of another. So in my opinion it is not selfish.
You're right, you can't give others what you don't have, this a simple explanation of what self-care really means.
Congrat.