I just checked on this, in iowa to get a court commital you have to prove that he is a danger to himself or others, if he goes to rehab he'll stay 2 weeks if he listens to them, if not it's 30 days, if you think he needs more time tell the judge he needs long term care. I'm going threw this myself right now.
Good luck, we both need it.