Sadly, like most truly terrifying things, the events in "Unsane" are not without a basis in reality. It is true that once the state, on the advice of the medical establishment, designates someone to be dangerous, the most basic rights you and I take for granted fly quickly out the window. People who have never committed a crime can be, and are, deprived of their liberty with relative ease.
Source