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. It immediately produces the effects referred to in article D. 47-29-3 of this code.