Article D47-29-4 of the French Code of Criminal Procedure
When the investigating chamber or the trial court that pronounces a decision that a person is not criminally responsible orders, in accordance with Article 706-135 of this Code, the compulsory hospitalisation of the person when this has already been decided by the State representative in application of the provisions of article L. 3213-1 of the Public Health Code, the judicial decision replaces the hospitalisation order issued by the State representative….