IRS refunds and state refunds are completed separate. The IRS could not take your state refund to them unless it was for a prior debt.
To see why IRS kept your refund for student
loans or other debt, call (800) 304-3107, for the US Treasury's
Bureau of Fiscal Services.
For IRS debt, call the FMS at 1-800-304-3107 to
find out if your refund was reduced because of an offset.
The IRS could even have collected on your hospital debt depending on where the debt was reported.
If the garnishment was for something else, the hospital debt remains in the collections process.