
856 P.2d 860 (1993)
Paul RATHER, Randy Kailey, Joe Padilla, Exteen Moye, Mark Moreno, Billy Soden, Jack Horan, James Walters, Anthony Reed, and Terry Wilson, Petitioners-Appellants,
v.
COLORADO STATE BOARD OF PAROLE, Colorado State Department of Corrections, Frank Gunter, Executive Director, and William Price, Superintendent, Respondents-Appellees.
No. 92SA120.
Supreme Court of Colorado, En Banc.
July 26, 1993.
*861 Petitioners-Appellants, pro se.
Gale A. Norton, Atty. Gen., Raymond T. Slaughter, Chief Deputy Atty. Gen., Timothy M. Tymkovich, Sol. Gen., Paul Farley, Deputy Atty. Gen., John August Lizza, First Asst. Atty. Gen., Denver, for respondents-appellees.
Justice KIRSHBAUM delivered the Opinion of the Court.
The petitioners, Paul Rather, Randy Kailey, Joe Padilla, Exteen Moye, Mark Moreno, Billy Soden, Jack Horan, James Walters, Anthony Reed, and Terry Wilson, seek review of the trial court's dismissal of their pro se joint petition for writ of habeas corpus. We affirm.

I
The ten petitioners filed a petition for writ of habeas corpus in January of 1992, requesting the trial court to hold an evidentiary hearing and, at the conclusion thereof, to issue various orders requiring the respondents, the Colorado State Board of Parole (hereinafter the parole board); the Colorado State Department of Corrections (hereinafter the Department); Frank Gunter, Executive Director; and William Price, Superintendent, to reinstate allegedly vested good time and earned time credits, and to prohibit the respondents from unlawfully withholding or revoking vested good time and earned time credits in the future, to establish procedures to evaluate the petitioners' need for mental health treatment, and, with respect to petitioner Moreno, "to forthwith release Petitioner Moreno on mandatory parole." The fifty-five page petition alleged that all ten petitioners were incarcerated under the jurisdiction of the Department; that the Department had improperly withheld, revoked or refused to award good time and earned time credits, pursuant to sections 17-22.5-301 and -302, 8A C.R.S. (1986); and that with the proper allocation of vested earned time and good time credits, the petitioners would be eligible for release or parole consideration at a much earlier time than the records of the appellants might otherwise indicate. With respect to petitioner Moreno, the petition alleged that Moreno has been denied parole on two separate occasions by the parole board; that Moreno has been damaged as a result of the unlawful withholding or revocation of vested good time and earned time credits; that Moreno has served a term of years in excess of what his original prison term was; and that Moreno's "continued confinement is unquestionably and indisputably illegal." On January 29, 1992, the trial court dismissed the petition on the basis that it was facially insufficient.

II

A
The petitioners argue that the respondents have improperly withheld good *862 time and earned time credits, which, if properly credited to their prison accounts, would accelerate their parole dates. However, habeas corpus proceedings are not designed for judicial review of alleged improper withholding of good time and earned time credits when the petitioner would not be entitled to immediate release in the event the allegations of administrative impropriety were established. Badger v. Diesslin, 850 P.2d 149, 150 (Colo.1993); Pearson v. Diesslan, 848 P.2d 364, 365 (Colo.1993). With the exception of Moreno, the petitioners do not allege that they are entitled to immediate release. Accordingly, petitioners' claims of improper administrative calculations of good time and earned time credits cannot be addressed in this habeas corpus proceeding.

B
Petitioner Moreno does allege that he has been incarcerated for a period of time in excess of the sentence originally imposed, that the parole board has on two occasions denied him parole status, and that he is entitled to immediate release from incarceration. These allegations are sufficient to establish that Moreno is entitled to further consideration of his petition.
The purpose of a habeas corpus proceeding under sections 13-45-101 to -119, 6A C.R.S. (1987 & 1992 Supp.), is to determine whether the petitioner is lawfully detained by the respondent. Johnson v. Gunter, 852 P.2d 1263, 1265 (Colo.1993); Kodama v. Johnson, 786 P.2d 417, 419 (Colo.1990); see Richardson v. Hesse, 823 P.2d 150, 151 (Colo.), cert. denied, ___ U.S. ___, 112 S.Ct. 1769, 118 L.Ed.2d 429 (1992). "The only parties to a habeas corpus proceeding are the petitioner and the person holding the petitioner in custody, and the only issue for resolution is `whether the custodian has authority to deprive the petitioner of his liberty.'" Cardiel v. Brittian, 833 P.2d 748, 751 (Colo.1992) (quoting Reed v. People, 745 P.2d 235, 238 (Colo.1987)). A petitioner is entitled to a hearing on a petition for habeas corpus only if he or she makes a prima facie showing that the confinement is invalid. Collins v. Gunter, 834 P.2d 1283, 1285 (Colo.1992).
Persons serving sentences for crimes committed on or after July 1, 1979, but before July 1, 1985, "shall be unconditionally released and discharged upon the expiration of [the] sentence, less the deductions authorized in article 22.5 of title 17, C.R.S." § 16-11-310, 8A C.R.S. (1986) (repealed by ch. 124, sec. 25, 1988 Colo.Sess.Laws 707, 715). Moreno relies on this section to argue that when the good time and earned time credits to which he is entitled are considered, he is entitled to parole.[1] However, the General Assembly has established a different sentencing scheme for persons convicted of sexual assault, as follows:
As to any person ... sentenced for conviction of a sex offense, as defined in section 16-13-202(5), C.R.S. ... the board has the sole power to grant or refuse to grant parole and to fix the condition thereof and has full discretion to set the duration of the term of parole granted, but in no event shall the term of parole exceed the maximum sentence imposed upon the inmate by the court or five years, whichever is less.
§ 17-2-201(5)(a), 8A C.R.S. (1986). Included within the meaning of a "sex offense" is sexual assault on a child. § 16-13-202(5), 8A C.R.S. (1986). Thus persons convicted of sexual assault on a child for offenses committed on or after July 1, 1979, but before July 1, 1985, are not entitled to the mandatory provisions of section 16-11-310, 8A C.R.S. (1986). Good time and earned time credits acquired by that class of offenders establish the earliest date upon which the parole board may exercise its discretion whether to place such offenders on parole. Thiret v. Kautzky, 792 P.2d *863 801, 805 (Colo.1990). See Aue v. Diesslin, 798 P.2d 436, 438 (Colo.1990).
According to the petition and two mittimuses attached thereto, Moreno was convicted of criminal attempt to commit second degree forgery,[2] which offense was committed on May 15, 1984; sexual assault on a child,[3] which offense was committed on November 21, 1984; and child abuse,[4] which offense was also committed on November 21, 1984. On May 25, 1985, Moreno was sentenced on all three offenses. Concurrent sentences of imprisonment for fourteen years plus one year of parole were imposed for the convictions of sexual assault on a child and child abuse, subject to a credit of 182 days for time previously served. He received a concurrent sentence of imprisonment for eighteen months plus one year of parole for the forgery conviction, subject to a credit of 177 days for time previously served.
While Moreno has discharged his sentence for the attempted forgery offense and may be entitled to parole status for the child abuse offense, he will not be entitled to mandatory parole status on his sentence for the offense of sexual assault on a childhis controlling sentenceuntil he has served the entire sentence of fourteen years less 182 days of credit for time served. Until that date he will remain subject to the discretion of the parole board with respect to his eligibility for parole status. Moreno is therefore not entitled to immediate release from confinement, contrary to the allegations of the petition.

III
The petitioners also argue that the procedures established by the Department for admission into mental health treatment programs violate their constitutional rights to be free from compulsion to be a witness against themselves, U.S. Const. amend. V; Colo. Const. art. II, § 18, and to due process. U.S. Const. amend. XIV; Colo. Const. art. II, § 25. These arguments are premised on petitioners' allegations that the respondents are improperly withholding good time and earned time creditsallegations which are not subject to habeas corpus review. Although "[u]nder some circumstances, habeas corpus relief may be available even though it does not result in a complete discharge from custody," Moody v. Corsentino, 843 P.2d 1355, 1360 n. 6 (Colo.1993), habeas corpus relief is generally not available if other legal remedies are available to the petitioner. Kodama v. Johnson, 786 P.2d 417, 419 (Colo.1990). In view of the allegations contained in the petition, we find no error in the trial court's denial of the habeas corpus petition with respect to this issue.

IV
For the foregoing reasons, the judgment of the trial court is affirmed.
NOTES
[1]  Section 17-22.5-301(2) provides for the vesting of good time for persons sentenced for a crime committed on or after July 1, 1981, but before July 1, 1985. § 17-22.5-301(2), 8A C.R.S. (1986). Section 17-22.5-302(3) establishes the relevant considerations for the granting of earned time for persons incarcerated because of a crime committed on or after July 1, 1979, but before July 1, 1985. §17-22.5-302(3), 8A C.R.S. (1986).
[2]  § 18-2-101, 8 C.R.S. (1978) and § 18-5-103, 8 C.R.S. (1978 & 1984 Supp.).
[3]  § 18-3-405, 8 C.R.S. (1978 & 1984 Supp.).
[4]  § 18-6-401, 8 C.R.S. (1978 & 1984 Supp.).
