I realize this is an old question.
This is covered in Title 42 Section 422.264 of the Code of Federal Regulations as far as CMS (Medicare) goes. https://www.gpo.gov/fdsys/pkg/CFR-2001-title42-vol2/pdf/CFR-2001-title42-vol2-sec422-264.pdf see pages 846-847. The insurance at the time of admission would be responsible through the inpatient stay.
I'm not sure whether commercial payers play by the same rules.