The balance as shall remain after the amount due the department of behavioral healthcare, developmental disabilities and hospitals for the care and treatment of a discharged or deceased patient or inmate is applied in payment thereof shall be paid over to the general treasurer by the fiscal agent.