
190 Cal.App.2d 253 (1961)
RALPH D. CAMPBELL, Appellant,
v.
THE PEOPLE, Respondent.
Civ. No. 19369. 
California Court of Appeals. First Dist., Div. Two.  
Mar. 20, 1961.
 Charles J. Seifert, Jr., for Appellant.
 John A. Nejedly, District Attorney, and George W. McClure, Deputy District Attorney, for Respondent.
 KAUFMAN, P. J.
 This is an appeal by Ralph D. Campbell from a judgment denying his motion to vacate and expunge a judgment of mental illness. He argues that his motion should have been granted as the court was without jurisdiction to render a judgment of mental illness, and requests that this court issue an extraordinary writ of mandamus to enforce the ministerial act necessary to correct the record.
 The facts are not in dispute. On the evening of December 10, 1958, the appellant was injured by an assailant and taken to the Pittsburg Community Hospital. He left the Pittsburg hospital on December 19, traveled to Stockton with a driver, and stayed at a hotel there. As a result of a dispute about the whereabouts of the driver with the Stockton police, the appellant was taken into custody by the Stockton police and taken to the Stockton State Hospital on December 20. While there, he contacted legal counsel. On December 22, 1958, appellant's wife, P. Agnes Campbell, the respondent herein, executed a petition pursuant to section 5049 of the Welfare and Institutions Code, alleging that her husband was believed to be mentally ill and in need of supervision, care or treatment. On the same day, an order for the examination or detention of the appellant was made. On December 23, 1958, pending an examination and hearing on the respondent's petition, the appellant was transferred from the Stockton State Hospital to the Contra Costa County Hospital. The order for examination and detention, a copy of the petition, and the notice prescribed by section 5050.5 of the Welfare and Institutions Code were served on the appellant on December 23, at the Contra Costa County Hospital. *255
 On December 26, 1958, an order for hearing and examination was made in open court and served on the appellant. The hearing was held on the same day at 9:30 a. m. at the Contra Costa County Hospital. After the duly appointed medical examiners certified that the appellant was mentally ill, and other witnesses appeared, it was adjudged that the appellant was a mentally ill person and that he be detained for treatment and committed to the Agnew State Hospital at Agnew, California. While he was at Agnew, the appellant signed the papers for a habeas corpus action but then decided to abandon the proceeding. On December 21, 1959, appellant was discharged from the Agnew State Hospital and given a certificate restoring his competency. Thereafter, on January 25, 1960, appellant was fully restored to capacity by an order of the Superior Court of Santa Clara County.
 On March 11, 1960, the appellant filed his motion for an order to vacate and expunge the judgment of mental illness previously made on December 26, 1958. This petition was heard on March 28, 1960, and the court thereafter denied the motion to vacate and expunge the judgment of mental illness. On this appeal, the appellant raises substantially the same arguments as were made to the court below, to wit: that the judgment of mental illness made on December 26, 1958, was illegal as the court was without jurisdiction because: (1) the appellant was denied procedural due process in that he was not given a reasonable notice of the hearing pursuant to section 5050.9 of the Welfare and Institutions Code, and denied his right to be represented by counsel and his right to produce witnesses, and his right to defend himself at the hearing for commitment and at the time of the hearing, he was under the influence of drugs and sedation so that he was incapable of participating in the hearing and unable to defend himself against the charges made against him; and (2) that the judgment is causing a substantial legal detriment to the appellant at this time.
 Appellant's first and major argument is that he was not given proper notice of the hearing on December 26, was not permitted to obtain counsel, and thus was denied his right to counsel and to produce witnesses.
 Section 5050 provides that the order for examination shall be served as provided by section 5050.2 at least one day before the time fixed for the examination. There is no similar provision relating to the order for the hearing. Section 5050.9 merely provides that notice shall be given, and section 5052 of the Welfare and Institutions Code provides: *256
 "For the purpose of conducting hearings pursuant to this chapter the court may be convened at any time and place within the county, suitable to the mental and physical health of the person, except that the time and place for hearing shall not be different from the time and place for the trial of civil actions if any party to the proceeding, prior to the hearing, objects to any different time or place; and provided, that if the hearing is held at any place other than a regular courtroom of the superior court five days' notice be given thereof to the patient and the petitioner, unless waived by the person or his representative, and appropriate minute order made thereof on the records of the court."
 "Any such hearing may be held in the psychiatric ward or unit of a county hospital and it shall be deemed that such hearing is held in a place for the trial of civil actions and in a regular courtroom of the superior court. [Amended by Stats. 1957, ch. 1335,  1.]"
 [1] Appellant concedes that he is not entitled to the five-day notice mentioned by the statute, as the hearing was held at the psychiatric ward of the Contra Costa County Hospital, but argues that he did not receive any advance notice of the hearing. There is no merit in this argument. The record shows that the order for detention was served on the appellant on December 23, and the order for hearing was served on the appellant on December 26. The order for hearing recites that on December 23, the appellant was "notified of the charge in the said petition, and having been further informed of his rights to demand a hearing on such charge, and to be represented by counsel, and to produce witnesses in relation to such charge."
 [2] Appellant also is particularly concerned with the fact that he had received medication a few hours before the hearing was held. He argues that as a result of this fact, he was denied his right to participate in the hearing and defend himself. However, the validity of commitments cannot be made dependent upon the ability of a patient to participate in the hearing. Very often, drugs and medication are necessary. The requirements of the Welfare and Institutions Code include the consideration of the best interests and protection of the patient ( 5050.1). Thus, if the prescribed statutory commitment procedure is followed, it must be left to the sound discretion of the trial court to determine what is a reasonable opportunity for the exercise of the patient's rights. This has long been the law (In re Lewis, 11 Cal.App. 530, 532 [105 P. 774]). *257 In the Lewis case, the petition, the warrant of apprehension, the apprehension itself, delivery of copies to the patient all occurred on the same day, February 25, 1909; the next day, the patient was examined as to his sanity and committed, the commitment order reciting that he had been duly advised of all his rights. In denying the patient's petition for a writ of habeas corpus, the appellate court said at page 532:
 "It will thus be seen that the commitment upon its face discloses that all the statutory requirements essential to a legal arrest, hearing and commitment were observed, and that the court acquired jurisdiction to hear and determine the question of Robinson's sanity (section 2168 to section 2174 of the Political Code, inclusive), unless it can be said that it appears from the face of the commitment itself that the court failed to accord to Robinson the 'reasonable opportunity' for the production and examination of witnesses contemplated by the statute. But we cannot, from the commitment, say that the alleged insane person was not given a reasonable opportunity to produce witnesses for examination in his behalf. Upon a collateral attack, where it is clear that the court had jurisdiction of the person adjudged insane, the presumptions are all in favor of the regularity of the proceedings leading to the judgment and the order of commitment. (Ex parte Clary, 149 Cal. 735 [81 P. 580]; State Commission in Lunacy v. Eldridge, 7 Cal.App. 298 [94 P. 597, 600].)"
 [3] Appellant also argues that he was denied his right to counsel. Section 5054 of the Welfare and Institutions Code provides:
 "The alleged mentally ill person shall be present at the hearing, and if he has no attorney, the judge may appoint an attorney to represent him, or if a request is made for an attorney by the alleged mentally ill person, the judge shall appoint an attorney to represent him and in a county where there is no public defender fix the compensation to be paid by the county for such services, or the judge may order the county public defender to represent him at the hearing if he determines the person is not financially able to employ counsel. [Amended by Stats. 1957, ch. 1261,  1.]" (Emphasis supplied.)
 The statute clearly leaves the matter of appointment of counsel in the discretion of the court where no request is made. The record here discloses that the appellant was advised of his right to counsel and that no request was made. We must therefore indulge in the presumptions in favor of the regularity *258 of the proceedings leading to the judgment and order of commitment (In re Lewis, supra).
 [4] In addition, the Legislature has provided a series of procedural safeguards in commitment proceedings. If a person has been adjudged mentally ill and committed under the provisions of section 5100, and he, or any friend on his behalf, is dissatisfied with the order of commitment, a demand for a jury trial may be made within 10 days after the commitment (Welf. & Inst. Code,  5100.5, 5125 et seq.). In the instant case, the appellant did not demand a formal trial. If the appellant was not mentally ill, he should have asked for a prompt trial pursuant to section 5125; otherwise, he was duly committed. (Cf. Baer v. Smith, 68 Cal.App.2d 716 [157 P.2d 646].) Furthermore, any person in custody as an insane person is entitled to a writ of habeas corpus (Welf. & Inst. Code,  6620). The appellant here abandoned his habeas corpus proceeding and also apparently made no move to oppose the guardianship proceedings brought by his wife. Instead, he waited more than one year before making any complaint that he was unlawfully committed.
 It appears that the real reason for this proceeding is that the judgment of mental illness is causing him a substantial legal detriment. The statutory procedure for the official announcement and recording of the discharge and recovery of competency of a patient previously committed to a state mental institution has been followed in the instant case (Welf. & Inst. Code,  6725.5 et seq., 6728, 6729). Appellant has not cited any authority for requesting that this court issue a writ of mandamus under these circumstances, except Andrews v. Superior Court, 29 Cal.2d 208 [174 P.2d 313]. In that case, the facts are markedly different and involved a criminal proceeding and is not here in point.
 Furthermore, it is very clear that in the instant case, the appellant had other proper remedies. In In re Sprague, 37 Cal.2d 110 [230 P.2d 633], the patient applied for a writ of error coram nobis to expunge the record of her commitment because it adversely affected her earning power. The Supreme Court denied the writ and stated that her proper remedy was a motion for a new trial or an appeal, even though subsequently known facts would have resulted in a release at the time of the first trial, and the patient was found sane by a subsequent jury trial.
 Judgment affirmed.
 Draper, J., and Shoemaker, J., concurred.
