Welsh Ministers v PJ [2018] UKSC 66

CTO and DOL (1) There is no power to impose conditions in a CTO which have the effect of depriving a patient of his liberty. (2) The patient's situation may be relevant to the tribunal's discharge criteria, and the tribunal may explain the true legal effect of a CTO (for the RC to act on that information), but if a patient is being unlawfully detained then the remedy is either habeas corpus or judicial review.