
960 P.2d 177 (1998)
131 Idaho 494
In the Matter of the Application of Kermit Nielsen for a conditioanl release.
STATE of Idaho, Plaintiff-Respondent,
v.
Kermit NIELSEN, Defendant-Appellant.
No. 22887.
Supreme Court of Idaho, Boise, February 1998 Term.
June 18, 1998.
*178 Randall D. Schulthies, Bannock County Public Defender; John D. Ross, III, Deputy Public Defender, Pocatello, for appellant. John D. Ross, III, argued.
Alan G. Lance, Attorney General; Kenneth K. Jorgensen, Deputy Attorney General, Boise, for respondent. Kenneth K. Jorgensen argued.
WALTERS, Justice.
Kermit Nielsen has been committed to a mental institution since his acquittal by reason of insanity in 1972 for the murder of his girlfriend. In October 1994, Nielsen filed a petition for conditional release pursuant to I.C. § 66-337(d) alleging that he was no longer mentally ill and that he did not fit the criterion for civil commitment. After a hearing on the state's motion to dismiss the petition, the district court concluded that Nielsen's petition should be dismissed because section (d) of I.C. § 66-337 had been struck down by this Court as unconstitutional following the United States Supreme Court's decision in Foucha v. Louisiana, 504 U.S. 71, 112 S.Ct. 1780, 118 L.Ed.2d 437 (1992). See In re Gafford, 127 Idaho 472, 903 P.2d 61 (1995), cert. denied, 516 U.S. 1173, 116 S.Ct. 1265, 134 L.Ed.2d 212 (1996), and In re Nielsen, 127 Idaho 449, 902 P.2d 474 (1995) (hereinafter cited as Nielsen I). Nielsen appealed from the district court's order dismissing his petition, asking this Court to determine whether Nielsen may seek a conditional release from confinement under I.C. § 66-337(d). Because we conclude that those portions of I.C. § 66-337(d) not affected by Foucha remain viable after our decision in Nielsen I, we vacate the dismissal order of the district court and remand the matter for a hearing on Nielsen's conditional release petition.

FACTUAL AND PROCEDURAL HISTORY
Nielsen is an insanity acquittee who was committed in 1972 to the custody of the Department of Health and Welfare pursuant to I.C. § 18-214. This statute, which spelled out procedures for review of an acquittee's continued commitment and potential for conditional release, was subsequently repealed in 1982, along with the defense of mental illness in a criminal action. 1982 Idaho Session Laws, ch. 368, § 1, p. 919. In 1987, however, the legislature incorporated the provisions of former I.C. § 18-214 into a new section that was added to I.C. § 66-337, dealing with review, termination of commitment and discharge of mentally ill patients. 1987 Idaho Session Laws, ch. 59, § 2, p. 105. The new section (d) specifically addressed release provisions affecting persons, such as Nielsen, who were originally acquitted under I.C. § 18-213 which allowed for the acquittal of criminal defendants on the ground of mental illness. As stated in section (d):
Section 18-214 , Idaho Code, shall remain in full force and effect for every individual previously acquitted pursuant to section 18-213, Idaho Code. Section 18-214, Idaho Code ... is placed here for reference only and is not a reenactment of section 18-214, Idaho Code.
*179 In 1992 the United States Supreme Court struck down as unconstitutional a Louisiana statute allowing continued confinement of an insanity acquittee on the basis of his antisocial personality after a hospital review committee had reported no evidence of mental illness and recommended conditional discharge. Foucha v. Louisiana, supra. The Court concluded that the statutory scheme under which Foucha continued to be held violated due process by permitting the indefinite detention of insanity acquittees who are no longer mentally ill but who fail to prove they would not be dangerous to others. Id. at 83, 112 S.Ct. 1780. The Court further concluded that, in order to satisfy equal protection requirements, the statutory scheme allowing for Foucha's continuing confinement based merely on dangerousness could not be sustained. Id. at 85, 112 S.Ct. 1780. The Court held that, as in the case of civil commitment proceedings, the burden must rest on the state to establish the insanity and dangerousness by clear and convincing evidence in order to confine an insane convict beyond the term of his criminal sentence, when the basis for his original confinement no longer exists. Id. at 86, 112 S.Ct. 1780.
Following the decision in Foucha, Nielsen filed a petition for a writ of habeas corpus (Nielsen I) seeking release from confinement on the grounds that he was no longer mentally ill and that his continued confinement denied him due process of law. Although Nielsen's petition was granted and his release was ordered by the magistrate, this Court reversed the order, holding that there was insufficient evidence to find that Nielsen no longer suffered from the mental condition that led to his acquittal. 127 Idaho at 452, 902 P.2d at 477. The Court restated in its opinion the constitutional requirement from Foucha that an insanity acquittee is entitled to be released, as a matter of due process, when the original basis for commitment no longer exists or the person is no longer dangerous. Id.
Before this Court's opinion was issued in Nielsen's habeas corpus case, Nielsen submitted to the Bannock County District Court (the committing court) a petition for conditional release pursuant to I.C. § 66-337(d), commencing the instant case. He alleged, as he had in the earlier habeas corpus petition, that he was not currently mentally ill and that he did not fit the criterion to be held under a civil commitment. The state filed a motion to dismiss under I.R.C.P. 12(b)(8), asserting that the conditional release petition raised the same issues which were the subject of the habeas corpus proceeding, and thus was barred by res judicata. The district court denied the motion, finding that Nielsen's petition under I.C. § 66-337(d) was not barred by the doctrines of res judicata or collateral estoppel. The district court further concluded that the findings as to the petitioner's mental status in the habeas corpus proceeding, which were based on the reports of two psychologists, could not have a preclusive effect on the conditional release petition which required that the petitioner be examined by psychiatrists.
Nielsen filed a motion for the appointment of two qualified psychiatrists in support of his petition for conditional release. In a memorandum decision dated January 29, 1996, the district court denied the motion. Relying on Nielsen I, which had been released on August 16, 1995, the district court concluded that the provision of I.C. § 66-337 which entitled Nielsen to obtain an independent psychiatric evaluation was unconstitutional and thus, inoperable. Thereafter, the state filed a motion to dismiss which the district court granted, holding that Nielsen's petition should be dismissed because it contained no allegations which would be effective under I.C. § 66-337(a)(c), the only remaining viable portions of the statute after section (d) was ruled unconstitutional in Nielsen I. The district court found that the conditional release procedures, which were derived from former I.C. § 18-214 as it appeared in I.C. § 66-337(d), were unavailable and that Nielsen's continued commitment could only be challenged through habeas corpus proceedings.

DISCUSSION
On appeal from the order dismissing his petition for conditional release, Nielsen argues that the district court improperly read Nielsen I to hold all of I.C. § 66-337(d) *180 unconstitutional. Nielsen contends that the right to seek conditional release, conferred by the statute, was not eliminated by Nielsen I, where the Court invalidated only the terms of release from continued commitment and the placement of the burden on the insanity acquittee to establish that he or she is no longer dangerous, in accordance with Foucha, supra.
The standard for reviewing a dismissal for failure to state a cause of action is the same as the standard upon the grant of a motion for summary judgment. The non-moving party is entitled to have all inferences from the record and pleadings viewed in his favor, and only then may the question be asked whether a claim for relief has been stated. Idaho Schs. For Equal Educ. Opportunity v. Evans, 123 Idaho 573, 850 P.2d 724 (1993). If the evidence reveals no disputed issues of material fact, what remains is a question of law, over which this Court exercises free review. Friel v. Boise City Housing Authority, 126 Idaho 484, 887 P.2d 29 (1994).
The district court considered that Nielsen's petition for conditional release was based upon I.C. §§ 66-337(c) and (d). The district court found that there were no allegations in the petition which would be effective under I.C. § 66-337(c). The district court also found that Nielsen I had invalidated all of I.C. § 66-337(d) in implementing the mandated due process protections for insanity acquittees set forth in Foucha. Accordingly, the district court concluded that Nielsen's petition for conditional release stated no claims upon which relief could be granted, and ordered the entry of a dismissal.
Nielsen argues that Nielsen I negated only the terms for release permitting the continued commitment of an insanity acquittee at a mental institution on the basis of dangerousness alone and the placement of the burden of proof on the acquittee. The terms for release set forth in I.C. § 66-337(d), which were found to offend the Constitution, are contained in sections (2) and (3) of former I.C. § 18-214. To comply with the directives of Foucha, maintains Nielsen, it is not necessary to read Nielsen I to invalidate more than the relevant portions of I.C. § 66-337(d) regarding future confinement, which were in issue in that case. Nielsen argues that neither the court nor the parties are compelled to abide by the unconstitutional provisions of I.C. § 66-337(d) in order to adjudicate Nielsen's conditional release petition.
Whether portions of a statute which are constitutional shall be upheld while other portions are eliminated as unconstitutional involves primarily the ascertainment of the intention of the legislature. Electric Bond & Share Co. v. Securities & Exchange Com., 303 U.S. 419, 58 S.Ct. 678, 82 L.Ed. 936 (1938); Carter v. Carter Coal Co., 298 U.S. 238, 56 S.Ct. 855, 80 L.Ed. 1160 (1936). See also In re SRBA Case No. 39576, 128 Idaho 246, 912 P.2d 614 (1995). When part of a statute or ordinance is unconstitutional and yet is not an integral or indispensable part of the measure, the invalid portion may be stricken without affecting the remainder of the statute or ordinance. In re SRBA Case No. 39576, supra, 128 Idaho at 263-64, 912 P.2d at 631-32. However, if an unconstitutional portion of a statute is integral or indispensable to the operation of the statute as the legislature intended, the provision is not severable, and the entire measure must fail. Boundary Backpackers v. Boundary County, 128 Idaho 371, 913 P.2d 1141 (1996).
Applying the principles of Foucha to Nielsen's habeas corpus claim in Nielsen I, we concluded that the statute allowing for continued confinement of insanity acquittees on the basis of dangerousness alone was unconstitutional. 127 Idaho at 451, 902 P.2d at 477. We did not engage in a severability analysis of I.C. § 66-337(d)nor were we asked by the parties to do sobut limited our review to the issues relating to the terms of release and the burden of proof, as affected by Foucha. Although the opinion stated:
[b]ecause I.C. § 66-337(d) is unconstitutional under the principles enumerated in Foucha, Nielsen's future confinement, in the absence of legislative response, will be governed by the terms for release contained in I.C. § 66-337(b),
(127 Idaho at 452, 902 P.2d at 477) we did not intend to invalidate portions of I.C. § 66-337(d) that are not violative of the federal *181 constitution. See Stark v. McLaughlin, 45 Idaho 112, 130, 261 P. 244, 248 (1927). Having thus delineated the appropriate constitutional standard governing continued confinement of insanity acquittees, we hold that an inmate-initiated petition for conditional release and the procedures prescribed by I.C. § 66-337(d) remain available to Nielsen to obtain review and possible termination of his confinement from the committing court.

CONCLUSION
We vacate the dismissal order of the district court, which was based on its finding that Nielsen had failed to state a claim upon which relief could be granted. We remand the case to the district court for further proceedings on Nielsen's petition, pursuant to the conditional release provisions remaining in force in section 66-337(d), and in accordance with this opinion.
TROUT, C.J., and JOHNSON, SILAK and SCHROEDER, JJ., concur.
