I.-Under the written procedure without a hearing provided for in III of Article L. 3211-12-2, the liberty and custody judge shall rule on applications to maintain or release the measure before the expiry, depending on the case, of the twenty-four hour period referred to in the third paragraph of II of Article L. 3222-5-1 applicable to seclusion or restraint measures or the seven day period referred to in the fifth paragraph of the same II applicable to seclusion measures. 3222-5-1 applicable to seclusion or restraint measures or the seven-day period referred to in the fifth paragraph of the same II applicable to seclusion measures.
However, the judge may rule within a period of twenty-four hours from the date on which the matter is referred to him or her for release, when this period expires after the end of the periods referred to in the first paragraph.
II. – In all cases, the measure is maintained for a period of one year.In all cases, the measure is lifted:
1° If the director of the establishment has not referred the matter to the court before the expiry of the periods provided for in the third and fifth paragraphs of II of article L. 3222-5-1;
2° If the judge has not given a ruling by the end of the time limits set.