In the case Washington v Harper, the US Supreme Court ruled that states could forcibly medicate their seriously mentally ill prisoners if the the medical practitioners on staff could demonstrate that the prisoner is a threat to themselves or others (Just FYI, outside the prison walls a judge is the only person who can rule a person incompetent and pave the way for forcible medication).