My question involves civil rights in the State of: Michigan

I've read that habeas corpus (supposedly) applies to patients detained under mental health legislation. There's a form for the petition of habeas corpus at uscourts.gov.

To be specific, I'm talking about it with regards to people who get detained by law enforcement and are brought to a hospital setting due to a perceived risk of harm to self/others.

The only problem is that the habeas corpus form on the site looks like mental health detentions would not really fit. I'll give examples:

10. Motion under 28 U.S.C. § 2255 In this petition, are you challenging the validity of your conviction or sentence as imposed?

A mental health detention is neither a conviction nor a sentence, I think. What would one put here? Or could it be that the documents that said habeas corpus applies are lying?

Last part: Declaration Under Penalty Of Perjury : If you are incarcerated, on what date did you place this petition in the prison mail system:

So, in a hospital setting it wouldn't really be a prison mail system. It looks like the form is clearly designed only for prisons and jails, not mental health detentions?

I'm very interested in what people come up with.