When the liberty and custody judge decides to refer the matter to himself pursuant to the last paragraph of I of article L. 3211-12, he shall give the person undergoing psychiatric care, his lawyer as soon as he has been appointed and, where applicable, the person in charge of the legal protection measure relating to the person or his legal representatives if he is a minor, the third party who requested the admission for psychiatric care, the prefect who ordered or maintained it, the director of the establishment who ordered the admission for psychiatric care in the event of imminent danger, as well as the public prosecutor, the opportunity to make observations. He notifies them of the date, time and place of the hearing. The notice of the hearing contains the information provided for in the last two paragraphs of article R. 3211-13. The director of the institution shall send the judge the documents mentioned in article R. 3211-12 within five days of the notice of referral.