It's recommended that people wait a few weeks after recovering before getting the COVID vaccine, so they probably wouldn't offer it to you immediately in the hospital if you tested positive: https://www.who.int/emergencies/diseases/novel-coronavirus-2...