
74 Wis.2d 487 (1976)
247 N.W.2d 109
STATE EX REL. TERRY, Petitioner-Appellant,
v.
SCHUBERT, Respondent.[]
No. 75-503.
Supreme Court of Wisconsin.
Argued November 4, 1976.
Decided November 30, 1976.
*490 For the appellant there was a brief and oral argument by Charles Bennett Vetzner, of Madison, post-conviction defense project.
For the respondent there was a brief by Bronson C. La Follette, attorney general, and Gary L. Carlson, assistant attorney general, and oral argument by James H. Peterson, assistant attorney general.
HANLEY, J.
Three issues are presented on this appeal:
1. Is habeas corpus the proper remedy to challenge the continuing nature of a commitment under ch. 975, Stats.?
2. Do the present procedures for determination of whether a person committed under ch. 975, Stats., should be discharged from that commitment provide sufficient due process protections for persons so committed?
3. Are persons committed under ch. 975, Stats., denied equal protection in that judicial review is provided for reexamination of other types of commitments?
Habeas Corpus
In this case the trial court held that habeas corpus is not available to one who has been committed under ch. 975, Stats., the Wisconsin Sex Crimes Act. The rationale for so holding is that, although sec. 292.01 (2), Stats., provides for judicial determination of the "question of mental illness or need for treatment" upon a petition for a writ of habeas corpus by a person who is confined in an institution as mentally ill, that section only applies to persons committed in civil proceedings, and where one is committed in a criminal proceeding only the committing court may conduct judicial review. In support of this position, it is noted that under sec. 975.11, Stats., no committee convicted of a felony may be discharged prior to two years after the date of his commitment without written approval of the committing court.
*491 [1] Assuming, arguendo, that sec. 292.01 (2) is limited to persons committed in civil proceedings, the right to habeas corpus guaranteed by both the United States Constitution and the Wisconsin Constitution, cannot be denied a petitioner who inquires into the legal authority for his detention. The fact that the pro se petition in this case specifically referred to sec. 292.01 (2) should not serve to limit petitioner's remedy. It should be noted that sec. 292.01 (1), Stats., very generally provides the right to prosecute a writ of habeas corpus to "every person restrained of his liberty."
In this case, also, no approval of the committing court is necessary as petitioner has been committed for five years. Furthermore, the rationale that only the committing court may make judicial review of commitments in criminal proceedings cannot carry great weight where the petitioner's basic contention is that he is denied review by any court. He claims that he is unconstitutionally deprived of due process and equal protection in the opportunity to obtain release from confinement. This is, in effect, a challenge to the legality of that confinement.
[2] This court has consistently held that claims of constitutional error may be reviewed by means of a writ of habeas corpus. Babbitt v. State, 23 Wis.2d 446, 452, 127 N.W.2d 405, 409 (1964); Servonitz v. State, 133 Wis. 231, 113 N.W. 227 (1907). The scope and purpose of the writ of habeas corpus have been expanded to review violations of the constitutional rights of persons confined by the state in correctional institutions. State ex rel. Terry v. Traeger, 60 Wis.2d 490, 498-99, 211 N.W.2d 4, 9 (1973); State v. Kanieski, 30 Wis.2d 573, 576-77, 141 N.W.2d 196, 198 (1966). Here the petitioner does not question the validity of the commitments as originally imposed; therefore, a post-conviction *492 motion pursuant to sec. 974.06, Wis. Stats., is not available to petitioner.
Furthermore, in other actions commenced by petitions for writs of habeas corpus of persons committed under laws of this state, this court has made declarations of constitutional rights regarding procedures for original commitment and reexamination, even though the court's decision did not result in the immediate discharge from custody. State ex rel. Kovach v. Schubert, 64 Wis.2d 612, 219 N.W.2d 341 (1974) (commitment following acquittal by reason of insanity); State ex rel. Farrell v. Stovall, 59 Wis.2d 148, 207 N.W.2d 809 (1973) (commitment under Sec Crimes Act); State ex rel. Matalik v. Schubert, 57 Wis.2d 315, 204 N.W.2d 13 (1973) (Commitment upon determination of incompetency to stand trial). Thus, in this case, where the committee claims he is denied constitutional rights for review of his commitment, his claim is essentially that he is illegally detained by the state, and a court may properly declare rights upon a petition for a writ of habeas corpus, even though a determination favorable to the petitioner may not result in the immediate discharge from custody.
[3] From the above analysis we conclude that the trial court erred in holding that it was without jurisdiction to consider petitioner's claims. This conclusion would indicate that the case should be remanded to the trial court so that it may consider these claims. However, the written decision of the trial court shows that determinations were made as to the validity of petitioner's contentions with respect to due process and equal protection, and thus, this court may properly consider these contentions.
Due Process
Secs. 975.01 and 975.02, Stats., mandate a presentence social, physical and mental examination upon conviction of specified sex crimes and permit such examinations, *493 in the court's discretion, upon conviction of any sex offense not specified in 975.01. If after this examination, the department recommends specialized treatment for the defendant's mental or physical aberrations, the court shall order a hearing on the issue of the need for specialized treatment. Sec. 975.06 (1), Stats. Upon a determination that the defendant is in need of specialized treatment, the court shall commit him to the department. Sec. 975.06 (2), Stats. This commitment to the department practically amounts to a sentence of the maximum term for the crime committed by the defendant. At the expiration of the maximum term the department must discharge the person committed, unless control is continued pursuant to recommitment procedures under sec. 975.13, Stats.
The Sex Crimes Law has given rise to a number of challenges regarding the guarantee of the rights of due process and equal protection of those persons subject to its provisions. In Huebner v. State, 33 Wis.2d 505, 147 N.W.2d 464 (1967), this court held that a full judicial hearing was required at the initial commitment proceeding on the presentence report under the Sex Crimes Act. In accordance with the Huebner decision, sec. 975.06 (1), Stats., now provides:
"The defendant shall be afforded the opportunity to appear with counsel; process to compel attendance of witnesses and the production of evidence; and a physician, or clinical psychologist of his own choosing to examine him and testify in his behalf. If he is unable to provide his own counsel or expert witness, the court shall appoint such to represent or examine him."
In State ex rel. Farrell v. Stovall, supra, the holding of Huebner was expanded to require the right to a sixperson jury trial, on demand, at both the initial commitment hearing and the recommitment hearing after the maximum term has expired. In this case, petitioner asks the court to consider the constitutionality of the procedures *494 provided to review commitment between the time of initial commitment and the expiration of the maximum term of incarceration.
The statutes provide that the department shall discharge any person committed to it under the Sex Crimes Act "as soon as in its opinion there is a reasonable probability that he can be given full liberty without danger to the public. . . ." Sec. 975.11, Stats. Two procedures for this sort of determination are provided. One of these procedures is through departmental examination under sec. 975.09, Stats., which provides:
"The department shall make periodic examinations of all persons within its control under s. 975.06 for the purpose of determining whether existing orders and dispositions in individual cases should be modified or continued in force. These examinations may be made as frequently as the department considers desirable and shall be made with respect to every person at intervals not exceeding one year. The department shall keep records of all examinations and of conclusions predicated thereon, and of all orders concerning the disposition or treatment of every person under its control. Failure of the department to examine a person committed to it or to make periodic examination shall not entitle him to a discharge from the control of the department, but shall entitle him to petition the committing court for an order of discharge, and the court shall discharge him unless it appears in accordance with s. 975.13 that there is necessity for further control."
The other procedure for review is through the special review board provided for in sec. 975.10, Stats.:
"Any person committed as provided in this chapter may be paroled if it appears to the satisfaction of the department after recommendation by a special review board, appointed by the department, a majority of whose members shall not be connected with the department, that he is capable of making an acceptable adjustment in society."
*495 The record fails to disclose any information regarding the procedure which is followed for periodic examination by the department under sec. 975.09. The procedure before the special review board is only a little more discernible. The respondent states that procedure before this board has recently been modified to provide notice to the individual of the hearing, of the standards and criteria which will be considered, and of his right to present relevant materials for the board's consideration. He is to receive a packet containing the file documents which the board will consider and a written decision including the reasons for any disposition. Respondent states that these new procedures are the result of this court's decision in State v. Goulette, 65 Wis.2d 207, 222 N.W.2d 622 (1974), which held that the common law concepts of due process and fair play apply to parole hearings of the regular parole board. Whether or not these procedures before the special review board are actually provided is not of record, and it appears that they have not been adopted in any formalized manner. Two features of the procedures of the special board, which we think are critical, must be pointed out. One, the statutes make no requirement that the special review board perform its function on any periodic basis, as for example, once per year. Two, the decision of the special review board only constitutes a recommendation to the department, which then makes the final decision.
[4] There can be no doubt that the state may not constitutionally continue an involuntary commitment without affording the individual due process of law. O'Conner v. Donaldson, 422 U.S. 563, 575 (1975); Jackson v. Incliana, 406 U.S. 715, 738 (1972) . Due process basically requires that the state afford the opportunity to be heard at a meaningful time and in a meaningful manner. Matthews v. Eldridge, 424 U.S. 319, 333 (1976); State ex rel. Matalik v. Schubert, 57 Wis.2d 315, 324-25, 204 *496 N.W.2d 13, 17 (1973). The question, therefore, is whether the procedures provided afford such an opportunity.
Examination of the two procedures for review of a sex crimes commitment reveals that the determination to discharge an individual is placed within the sole discretion of the department. As previously stated, respondent has shown no formalized procedures which are followed in the periodic examination provided by sec. 975.09. This examination is apparently merely a unilateral determination made by the institutional staff.
[5] While procedure before the special review board offers more of an opportunity for the individual to be heard, two aspects of this procedure dilute whatever due process it affords. First, consideration for parole before the special review board is not required on a regular basis, and second, the decision is merely a recommendation to the department. Respondent asserts that the decision of the special review board is reviewable by certiorari, but such review of an advisory decision is meaningless. Therefore, we think that the present procedures fail to afford due process by not providing the opportunity to be heard at a meaningful time in a meaningful way.
A determination of what process is due must begin with consideration of the nature of the governmental function involved and the private interest which is effected. Morrissey v. Brewer, 408 U.S. 471, 481 (1972). This court has held that the commitment procedure under the Sex Crimes Act is an independent proceeding, essentially different from penal sentencing. Huebner v. State, supra at 526, 147 N.W.2d at 656. However, the court has also recognized that, unlike persons committed for mental illness under other laws of this state, a person committed under the Sex Crimes Act has been convicted of a sex related crime. State ex rel. Farrell v. Stovall, supra at 171, 207 N.W.2d at 820. The purpose of commitment under the Sex Crimes Law is primarily to protect *497 the public from the commission of dangerous sex crimes and also to provide treatment for the offender. State v. Torpy, 52 Wis.2d 101, 109, 187 N.W.2d 858, 863 (1971).
The interest of the person committed is obviously in his discharge or parole from departmental control. His interest in release from commitment, once the basis for that commitment no longer exists, is clearly a valuable one, the determination for which calls for some orderly procedure.
The State's interests are many, the most important interest being that of the protection of persons from dangerous criminal and deviated acts of sexual psychopaths. The state also has an interest in detaining such afflicted persons in order to rehabilitate them. The state, however, has no interest in continuing indefinitely the commitment of a sex offender without some informal procedural guarantees.
In State v. Goulette, supra, this court held that the process which was due in parole determinations was a hearing with minimal due process or fair play standards and the keeping of some form of comprehensible and adequate record for the purposes of review. Id. at 216, 222 N.W.2d at 627.
[6] We believe that persons committed under ch. 975 are entitled to hearings which afford the same minimal requirements of due process. These minimal requirements include: (1) written notice of the hearing; (2) disclosure of the evidentiary material which will be considered by the hearing body; (3) opportunity to be heard in person and to present witnesses and documentary evidence; (4) the right to confront and crossexamine witnesses, in the absence of good cause for not allowing confrontation; (5) a neutral and detached hearing body; and (6) a written statement by the factfinders as to the evidence relied on and reasons for refusing parole or discharge. Morrissey v. Brewer, supra at 489.
*498 It is difficult to determine how these minimal due process requirements should be implemented within the statutory framework of ch. 975. Although these requirements would most easily be met by procedure before the special review board, the problems of the lack of a requirement that the board review commitments on a regular basis and the board's decision constituting a mere recommendation still remain. Further, the special review board is only concerned with parole and not complete discharge. Due to these complications regarding the special review board, we think these minimal due process rights should be applicable to the periodic examination procedures provided under sec. 975.09, Stats., and that the decision of the department upon such examination is reviewable by the committing court upon writ of certiorari. This court has on several occasions construed deficient statutes to include constitutionally required provisions. State ex rel. Farrell v. Stovall, supra; State ex rel. Matalik v. Schubert, supra; Huebner v. State, supra.
Equal Protection
Petitioner also urges that persons committed under ch. 975 are denied equal protection because persons committed under other laws of this state are provided with greater rights of judicial review of their commitments.
Commitment of a person determined incompetent to stand trial is subject to semi-annual court review with full due process safeguards. State v. Matalik, supra; State ex rel. Haskins v. County Courts 62 Wis.2d 250, 264, 214 N.W.2d 575, 582 (1974). Those persons committed following acquittal by reason of mental disease or defect are entitled to a yearly judicial examination under sec. 971.17 (2), Stats., which includes the right to jury trial under sec. 51.11, Stats. A person whose sex crime commitment has been extended beyond the maximum *499 term under secs. 975.13 and 975.14, Stats., is also provided a semi-annual judicial review of his commitment. Sec. 975.15 (3), Stats. Also, prisoners who, during their incarceration, are transferred to Central State Hospital due to mental illness are provided a yearly judicial examination under sec. 51.11 provided by sec. 51.21(3) (e), Stats.
In State ex rel. Farrell v. Stovall, supra, this court held that the determinations of sex deviancy under ch. 975 and mental illness or deficiency under ch. 51 are so substantially identical as to require a reasonable basis or justification for a difference in rights afforded to persons committed under these similar statutes. Id. at 163-65, 207 N.W.2d at 816-17.
[7] The fundamental determination to be made when considering a challenge based upon equal protection is whether there is an arbitrary discrimination in the statute or its application, and thus whether there is a rational basis which justifies a difference in rights afforded. Harris v. Kelley, 70 Wis.2d 242, 251, 234 N.W.2d 628 (1975). Thus, the question raised by this particular challenge of petitioner is whether any rational basis exists which justifies the disparity in the rights of judicial reexamination, not considering that which is required by the due process discussion above, afforded to those persons committed under ch. 975 and those committed under any other state law.
This question was previously considered by this court in State ex rel. Farrell v. Stovall, supra at 171-73, 207 N.W.2d at 820-21. In that case, the court, relying on the decision of the Federal District Court for the Western District of Wisconsin in Hill v. Burke, 289 F. Supp. 921 (W.D. Wis. 1968), aff'd, 422 F.2d 1195 (7th Cir. 1970), held that a rational basis for this distinction could be found in the fact that those persons under ch. 975 have been convicted of a sex related crime.
*500 Petitioner challenges this reliance upon Hill v. Burke arguing that in State ex rel. Farrell the court held that the criminal conviction would not serve as a rational basis for depriving a sex offender the right to jury trial at the initial commitment proceeding and recommitment proceeding after the maximum term has expired where such a right to a jury trial is provided for civil commitments. Thus, petitioner contends, the criminal conviction cannot be a rational basis for the denial of judicial reexamination for persons convicted under ch. 975.
In Hill v. Burke, however, the district court explained this apparent incongruity by stating:
"The determination in the commitment proceedings is not whether the offender should be incarcerated at all, but whether he should be imprisoned or committed to the Department for treatment. On this issue the conviction of a crime does not come into play. It merely triggers the inquiry.
"The issue here is whether the offender can challenge his confinement once it has been determined after a hearing where he shall be confined. On this issue the legislature could have reasonably concluded, and evidently has concluded, that the conviction of a crime is a factor in determining whether an offender can be released without endangering the public." Hill v. Burke, supra at 928.
Thus, the court concluded, while the criminal conviction may not be a basis for disparity in the procedures for determination of whether the individual needs specialized treatment, it may be the basis for a disparity in procedures for release of the individual into society.
Petitioner claims that the fact that he has been convicted of a crime should not deprive him of judicial reexamination because other commitments which are judicially reviewable, are also criminally related, such as commitment after acquittal by reason of insanity. Petitioner cites three cases to support his contention that there is no basis to distinguish between sex crime commitments*501 and commitments following acquittal by reason of insanity. In re Andrews, 334 N.E.2d 15, 24-25 (Mass. 1975); Waite v. Jacobs, 475 F.2d 392, 398 (D.C. Cir. 1973); State ex rel. Kovach v. Schubert, supra.
In re Andrews holds that the application of more stringent release provisions for persons committed as sexually dangerous than for prisoners committed as mentally ill violates equal protection. This decision was based on the holding in Jackson v. Indiana, supra, that committed persons charged with crimes could not be subjected to more stringent standards of release then were other committed persons. This extension of the rule in Jackson v. Indiana is, of course, not binding upon this court, and in fact in State ex rel. Farrell, supra, the court declined to hold that Jackson invalidated the distinctions in release provisions which exist between ch. 975 and ch. 51.
In Waite v. Jacobs, supra, petitioner claims, the court concluded there was no basis to distinguish between sex crimes and insanity commitments. Close review of that decision, however, reveals that the court actually stated: "Insofar as the initial commitment is concerned, we can perceive little difference between [a person committed under the Sex Crimes Law] and an acquitee." (emphasis supplied). Id. at 398. Further reading of Waite indicates that the court was not concerned with release proceedings between the initial commitment and the expiration of the maximum term.
This court in State ex rel. Kovach v. Schubert, supra, also stated there was no significant rationale for distinctions among procedures for the various types of commitments. This statement, however, was made only during the analysis concerning initial commitment procedures.
[8] Thus, we follow the conclusion in State ex rel. Farrell v. Stovall, supra, that the fact a person committed *502 under ch. 975 has been convicted of a crime constitutes a rational basis for the disparity in the judicial reexamination procedures provided persons so committed and persons committed under other statutory provisions. Since there exists a rational basis which justifies this disparity, it is determined that petitioner is not denied equal protection.
In addition, this conclusion is fortified by the determination above as to the question of due process, for that determination provides for a due process hearing and review by certiorari on the question of discharge, and thus greatly decreases any disparity in the rights afforded to the various committees.
While the decision of the court in this case reverses the conclusion of the trial court that no violation of due process is present under the reexamination procedures of the Sex Crimes Act, the court does not find it necessary that the writ of habeas corpus be granted or petitioner's motions, be sustained in order to effectuate this reversal. Therefore, as to those results, the trial court is affirmed.
By the Court.Affirmed in part; reversed in part; remanded for entry of order consistent with the declaration of rights as per decision herein and ordering respondent to provide petitioner within a reasonable time a hearing under sec. 975.09, Stats., which meets the procedural requirements contained herein.
The following opinion was filed March 1, 1977.
PER CURIAM (on motion for rehearing).
On Page 493 of our original opinion, it is stated that:
"This commitment to the department practically amounts to a sentence of the maximum term for the crime committed by the defendant."
*502a This language is withdrawn.
On Page 497 it is stated that:
"In State v. Goulette, supra, this court held that the process which was due in parole determination was a hearing with minimal due process or fair play standards and the keeping of some form of comprehensible and adequate record for the purposes of review. Id. at 216, 222 N.W. 2d at 627.
"We believe that persons committed under ch. 975 are entitled to hearings which afford the same minimal requirements of due process. These minimal requirements include: (1) written notice of the hearing; (2) disclosure of the evidentiary material which will be considered by the hearing body; (3) opportunity to be heard in person and to present witnesses and documentary evidence; (4) the right to confront and crossexamine witnesses, in the absence of good cause for not allowing confrontation; (5) a neutral and detached hearing body; and (6) a written statement by the factfinders as to the evidence relied on and reasons for refusing parole or discharge. Morrissey v. Brewer, supra at 489."
This language is withdrawn and in its place the following is substituted:
In State v. Goulette, supra, this court noted that in parole grant determinations minimal due process requirements or fair play standards should be provided and that some form of comprehensive and adequate record should be kept and provided for purposes of review. Id. at 216, 222 N.W. 2d 627.
We believe that persons committed under ch. 975 are also entitled to hearings which afford minimal due proeess. These minimal requirements for a reexamination of a sex crimes commitment between the time of initial commitment and the expiration of the maximum term include: (1) written notice of the hearing; (2) disclosure of the evidentiary material which will be considered by the hearing body; (3) opportunity to be heard in *502b person and to present witnesses and documentary evidence; (4) the right to confront and cross-examine witnesses, in the absence of good cause for not allowing confrontation; (5) a neutral and detached hearing body; and (6) a written statement by the factfinders as to the evidence relied on and reasons for refusing discharge. See Morrissey v. Brewer, supra at 489.
Motion for rehearing denied without costs.
NOTES
[]  Motion for rehearing denied, without costs, on March 1, 1977.
