30.1. A judgment authorizing confinement must also set the duration of confinement.
However, the person under confinement must be released as soon as confinement is no longer justified, even if the set period of confinement has not elapsed.
Any confinement required beyond the duration set by the judgment must be authorized by the court, in accordance with the provisions of article 30.