Confinement under the provisions of the preceding Article may be carried out only after the reasons have been told to the person who has received a ruling under the provisions of Article 345-2 or Article 494-3 and the person has been heard on the matter; provided, however, that this does not apply if the person has fled.
Read this with the articles around it