
688 N.W.2d 58 (2004)
In re the DETENTION OF Loren G. HUSS, Jr. Loren G. Huss, Jr., Appellant.
No. 02-1642.
Supreme Court of Iowa.
October 6, 2004.
*60 Mark C. Smith, First Assistant State Public Defender, and Greg Bal, Assistant Public Defender, for appellant.
*61 Thomas J. Miller, Attorney General, and Roxann M. Ryan, Assistant Attorney General, for appellee.
CARTER, Justice.
Loren G. Huss, Jr., who was acquitted of a charge of first-degree murder by reason of insanity, appeals from a subsequent judgment committing him as a sexually violent predator. He urges that there were procedural irregularities in the commitment proceedings that violated his constitutional rights and further contends that he was subjected to an improper judgment by default as a sanction for his failure to submit to a psychological examination. After reviewing the record and considering the arguments presented, we vacate the challenged orders and remand the case to the district court for further proceedings.
This case is another chapter in a line of appeals regarding Huss's criminal and civil detainment. Huss was charged with first-degree murder in July of 1986, as a result of his involvement in the death of Marilyn Sheets. Mental examinations of Huss at that time provided a strong indication that, although he was then presently competent to stand trial, he was not aware of the consequences of his actions at the time of Sheets' death nor able to form the requisite intent to commit murder.
Anticipating a verdict of not guilty by reason of insanity, the State and Huss submitted the case on stipulated facts and agreed to a bench trial. Contrary to the parties' expectations, the court found that Huss had not established his insanity defense. In order that he not be prejudiced by his jury waiver, the court agreed to set the matter for jury trial on the merits of the murder charge. The jury waiver was withdrawn, and the case proceeded to jury trial. Huss was convicted of first-degree murder on June 22, 1987. His appeal to this court on double-jeopardy grounds was unsuccessful. State v. Huss, 430 N.W.2d 621, 624-25 (1988).
Following the affirmance of his conviction in state court, Huss sought a writ of habeas corpus from the United States District Court for the Southern District of Iowa. The federal district court denied that request, but the court of appeals determined that a retrial to a jury of the issues originally submitted for determination at the bench trial violated the double jeopardy protection of the federal constitution. Huss v. Graves, 252 F.3d 952, 958 (8th Cir.2001). The court further determined, however, that, because the bench trial had been aborted without a decision on the merits, the matter could be resubmitted for a second bench trial on the same record made at the first bench trial. Id. The second bench trial resulted in a finding of not guilty by reason of insanity. An effort to reassert a double-jeopardy challenge based on the second bench trial was unsuccessful. State v. Huss, 657 N.W.2d 447, 453-54 (Iowa 2003).
The present proceedings to commit Huss as a sexually violent predator were commenced in July of 2001 following the filing of the federal habeas corpus opinion in Huss v. Graves. The Anamosa correctional facility gave written notice pursuant to Iowa Code section 229A.3(1) (2001) that Huss may meet the definition of a sexually violent predator. On July 10, 2001, a multidisciplinary team was convened as provided in Iowa Code section 229A.3(4) and determined that Huss met the definition of a sexually violent predator. The multidisciplinary team so notified the attorney general.
The attorney general, on October 16, 2001, filed the petition to commit Huss that is the subject of the current litigation. The district court made a preliminary determination of probable cause on October 16, 2001, and a renewed determination of *62 probable cause following a formal hearing on February 15, 2002. In conjunction with the latter determination, the court, at the State's request, ordered Huss to submit to a psychological examination by the State's designated expert. Other than the procedures to which we have referred, the attorney general's petition for Huss's commitment was held in abeyance until the conclusion of both his second bench trial and the mandatory civil commitment hearing that was triggered by the finding of not guilty by reason of insanity. See Iowa R.Crim. P. 2.22(8).
Following the verdict, a rule 2.22(8) hearing resulted in a finding by the district court that Huss was presently dangerous and should be committed for treatment of a bipolar disorder, antisocial personality disorder, and other dangerous mental traits. On an appeal from that ruling, this court found that the evidence that had been presented at the rule 2.22(8) hearing was insufficient because of the absence of a recent overt act and reversed the district court's order. State v. Huss, 666 N.W.2d 152, 160-62 (Iowa 2003).
Following the district court's ruling on the rule 2.22(8) commitment issue, and before the determination of that issue on appeal, Huss filed a motion to dismiss the pending petition for commitment as a sexually violent predator. The district court denied that motion. The grounds for the motion were that the State did not comply with the procedural requirements of section 229A.3(1)(c). Huss's primary contentions in that regard were that (1) following the vacation of his conviction by the federal court of appeals, he was no longer in the legal custody of the Anamosa correctional facility; and (2) the attorney general's petition was prematurely filed. Both of these contentions are reasserted as issues on this appeal. On March 26, 2002, Huss filed a motion for an order allowing his attorney to be present during any psychological evaluation that would be undertaken of him at the State's request. This request was denied, and the ruling has not been made an issue on appeal.
Huss later refused to submit to a psychological evaluation by the State's designated expert on the ground, among others, that this would defeat the constitutional protection afforded him by Iowa Code section 229A.7(1).[1] On June 25, 2002, Huss filed a motion to dismiss the present proceeding on the grounds that the trial had not been held within ninety days of the probable-cause hearing as specified in Iowa Code section 229A.7(2). The district court denied that motion. This ruling has been made an issue on appeal.
The district court set a date of October 4, 2002, for the statutory hearing required by Iowa Code section 229A.7(1). Eight days later the court ruled that, as a sanction for Huss's refusal to submit to a psychological examination, the elements that the State had to prove at the section 229A.7(1) hearing and at the final hearing under section 229A.7(2) (see Iowa Code section 229A.7(3)) would be deemed to have been established. That ruling served as the foundation for an October 21, 2002 ruling granting the State's motion for a summary judgment ordering Huss's commitment as a sexually violent predator. *63 Other facts and procedural history of importance will be provided in our discussion of the legal issues presented on the appeal.

I. Procedural Challenges.

A. Custody issue. Iowa Code section 229A.3(1) provides:
1. When it appears that a person who is confined may meet the definition of a sexually violent predator, the agency with jurisdiction shall give written notice to the attorney general and the multidisciplinary team established in subsection 4, no later than ninety days prior to any of the following events:

a. The anticipated discharge of a person who has been convicted of a sexually violent offense from total confinement, except that in the case of a person who is returned to prison for no more than ninety days as a result of revocation of parole, written notice shall be given as soon as practicable following the person's readmission to prison.

b. The discharge of a person who has been charged with a sexually violent offense and who has been determined to be incompetent to stand trial pursuant to chapter 812.

c. The discharge of a person who has been found not guilty by reason of insanity of a sexually violent offense.
Huss contends that, under this statute, only the agency with legal custody of a person in penal confinement may give notice of an impending discharge to the attorney general and the multidisciplinary team. In this case, Huss urges, the agency with jurisdiction would have been the Polk County Sheriff and not the Anamosa correctional facility. According to Huss's argument, that is because prior to the giving of the notice the conviction for which he had been incarcerated was set aside by a federal court, and he was awaiting a new trial on the charge.
The answer to Huss's contention is, as the State points out, that the giving of notice under section 229A.3(1) is not an essential step in the process for filing a petition under section 229A.4(1). The notice provided is only intended to be a heads-up to an approaching discharge date in case a determination to file a section 229A.4(1) petition appears to be a possibility.
B. Premature filing. Huss argues that the filing of the attorney general's petition was premature because it was done prior to the time that he was found not guilty by reason of insanity, a triggering event for such petitions. The answer to this contention is that this is not the only triggering event for the filing of a petition under section 229A.4. The argument confuses a petition filed pursuant to section 229A.4(1) with a petition filed under section 229A.7(2). Petitions filed under the former paragraph need not be related to or influenced by a finding of not guilty by reason of insanity. All that is necessary for a section 229A.4(1) filing is a determination that "it appears that a person presently confined may be a sexually violent predator and the prosecutor's review committee has determined that the person meets the definition of a sexually violent predator...." These requirements were adhered to in the present case.
C. Failure to hold final hearing within ninety days of probable-cause determination. Iowa Code section 229A.7(2) provides:
2. Within ninety days after either the entry of the order waiving the probable cause hearing or completion of the probable cause hearing held under section 229A.5, the court shall conduct a trial to determine whether the respondent is a sexually violent predator. The respondent or the attorney for the respondent *64 may waive the ninety-day trial requirement as provided in this section; however, the respondent or the attorney for the respondent may reassert a demand and the trial shall be held within ninety days from the date of filing the demand with the clerk of court. The trial may be continued upon the request of either party and a showing of good cause, or by the court on its own motion in the due administration of justice, and when the respondent will not be substantially prejudiced.
Huss maintains that he was prejudiced by a failure to hold the final hearing within ninety days of the probable-cause determination. As we have noted, Huss has heretofore refused to submit to the psychological evaluation mandated by Iowa Code section 229A.5(5). This examination is a critical stage in the proceedings, and its absence would have substantially prejudiced the State. That fact alone justifies the action of the district court in delaying the final hearing.

II. Preclusive Effect of Decision in Rule 2.22(8) Commitment Proceeding.

Huss urges that the basis for holding him in future confinement has been resolved against the claims of the State by our decision in State v. Huss, 666 N.W.2d 152 (Iowa 2003). As we have noted, the determination in that case was premised on the lack of a recent overt act, which was deemed to be necessary for a rule 2.22(8) commitment. As discussed in a subsequent division of this opinion, the existence of a recent overt act is not an essential requirement with respect to a petition for commitment as a sexually violent predator filed under Iowa Code section 229A.4(1). In re Detention of Gonzales, 658 N.W.2d 102, 104-05 (Iowa 2003). Consequently, Huss's preclusion issue must fail.

III. Sanctions for Refusal to Submit to a Psychological Examination.

The primary issue on appeal is Huss's challenge to the sanction imposed by the district court for his refusal to submit to a psychological examination. As Huss correctly notes, that ruling had the effect of a default judgment, as it determined that all matters that the State had to establish at the section 229A.7(1) hearing and at the final hearing under section 229A.7(2) would be deemed to have been established. The ruling provided the foundation for a summary adjudication that Huss was a sexually violent predator and should be committed as such.
Discovery sanctions are reviewed under an abuse-of-discretion standard. Krugman v. Palmer Coll. of Chiropractic, 422 N.W.2d 470, 473 (Iowa 1988); Suckow v. Boone State Bank & Trust Co., 314 N.W.2d 421, 425 (Iowa 1982). In attacking the sanctions that served to default him on the State's commitment petition, Huss asserts that a default judgment or the equivalent thereof should be used sparingly and only in extreme situations and should not be used if an alternative, less drastic sanction is just as effective. Our rules of civil procedure provide:
When the mental or physical condition (including the blood group) of a party, or of a person in the custody or under the legal control of a party, is in controversy, the court in which the action is pending may order the party to submit to a physical or mental examination by a health care practitioner or to produce for examination the person in the party's custody or legal control.
Iowa R. Civ. P. 1.515. Prior to imposing the challenged sanctions, the court had entered an order requiring Huss to submit to a mental examination by a health-care practitioner of the State's selection, as required *65 by Iowa Code section 229A.5(5). This was the equivalent of a discovery order of the type specified in rule 1.515. Huss refused to comply with this order.
Sanctions available for failure to comply with discovery orders include the following:
An order that the matters regarding which the order was made or any other designated facts shall be taken to be established for the purposes of the action in accordance with the claim of the party obtaining the order.
and
An order refusing to allow the disobedient party to support or oppose designated claims or defenses, or prohibiting such party from introducing designated matters in evidence.
Iowa R. Civ. P. 1.517(2)(b)(1), (2). We are satisfied that, if Huss's refusal to be examined was undertaken without any colorable excuse, the drastic sanction invoked by the district court would have been entirely proper as it pertained to the determination of his sexually violent predator status under section 229A.7(2). The examination that had been ordered is an essential step in the proceedings and is mandated by section 229A.5(5). It is very probable that such examination would be necessary in order for the State to prove its claim. The only effective sanction to keep Huss's continued recalcitrance from blocking the State's ability to prove its case would be to consider the elements that the examination might have revealed as being established.
On the other hand, it was indicated prior to imposition of the sanctions that Huss's refusal was only temporary and that he would consent to be examined following the section 229A.7(1) hearing. It was his belief that the question of whether he had been charged with a sexually violent offense would be determined at that hearing, and he viewed this issue as potentially outcome determinative. The district court believed that the statutory element of "having been convicted of or charged with a sexually violent offense" could be established by resort to Huss's 1981 conviction for sexual abuse and perhaps by showing that the facts on which a 1980 robbery conviction was based involved an attempt to commit sexual abuse. The district court was not correct in that belief. The attorney general's petition against Huss was filed pursuant to Iowa Code section 229A.4(1), which is a statute dealing with persons who are "presently confined." In Gonzales, 658 N.W.2d at 104-05, we held that, in order for a petition to be filed under the "presently confined" alternative, the current confinement must be for a sexually violent offense. Gonzales, 658 N.W.2d at 104-05. That is because under section 229A.4(1) the offense leading to the current confinement may be a substitute for the requirement of showing a recent overt act if it was a sexually violent offense. Id. Filing a petition under the alternative provided in section 229A.4(2) was not an option for the State in the present case because of the absence of a recent overt act. Consequently, if, at the time the attorney general's petition was filed, Huss was not being held for a sexually violent offense, the petition was not authorized, and he must be released.
Huss contended that, as a result of the protections that section 229A.7(1) borrows from criminal jurisprudence and elevates to rules of evidence, his right to avoid potential adverse findings at the section 229A.7(1) hearing might be compromised by submitting to the proposed examination at which, it appears without dispute, he would have been extensively interrogated. The State and the district court read section 229A.7(1) as only providing the subject of a hearing under that statute with protection against self-incrimination *66 in future criminal prosecutions. Huss maintains that the statute at issue here protects him from self-incrimination with regard to possible adverse findings in the section 229A.7(1) hearing. We are satisfied that Huss has the better argument on this issue.
In determining the meaning of statutes, we follow the rule that laws are to be interpreted in a manner consistent with the purpose with which they were intended to serve. Goodenow v. City Council of Maquoketa, 574 N.W.2d 18, 25 (Iowa 1998); Probasco v. Iowa Civil Rights Comm'n, 420 N.W.2d 432, 434 (Iowa 1988). Section 229A.7(1) elevates the borrowed constitutional rights to rules of evidence for purposes of the section 229A.7(1) hearing. By doing this, the legislature must have intended to establish the rules of evidence that are to be applied at the civil hearing required by section 229A.7(1).[2] The State avowed that it intended to use the examination results at this hearing. Although any misgivings that Huss entertained concerning the denial of these borrowed constitutional rights could have been obviated by a directive from the court that the results of the examination could not be used as evidence in the section 229A.7(1) hearing, the only immunity that the court granted Huss was with regard to future criminal prosecutions. Based on the circumstances that existed, we find that Huss did have a colorable excuse for not submitting to the examination prior to the conclusion of the section 229A.7(1) hearing.
The State, Huss, and the district court all perceived that the issues to be determined at the section 229A.7(1) hearing included a determination of whether the murder offense for which Huss was tried was a sexually violent offense. Our reading of the statute convinces us that this was not a matter to be determined at that hearing. We do not consider one portion of the statute in isolation but, rather, interpret it in context with other portions of the act. In re B.B., 516 N.W.2d 874, 878 (Iowa 1994); John Deere Dubuque Works v. Weyant, 442 N.W.2d 101, 104 (Iowa 1989). The statute provides that, when a person has been found not guilty of "a sexually violent offense" by reason of insanity, "the court shall first hear evidence and determine whether the person did commit the act or acts charged." Iowa Code § 229A.7(1).
Under the definition of a sexually violent offense contained in Iowa Code section 229A.2(8), some crimes are sexually violent per se. Other crimes, although not sexually violent per se, may be shown to be such if they involve "sexual abuse, attempted sexual abuse, or intent to commit sexual abuse," see Iowa Code § 229A.2(8)(b), or involve acts which have been determined beyond a reasonable doubt to have been sexually motivated. See Iowa Code § 229A.2(8)(g). With respect to that category of crimes that are not sexually violent offenses per se, this determination may be made "during civil commitment proceedings pursuant to [Iowa Code chapter 229A]." Id. We must decide at what stage of the proceedings this determination is most properly to be made. The argument that most strongly supports having the "sexually violent offense" determination made at the section 229A.7(1) hearing is that under the statute there is no authority to hold that hearing unless a sexually violent offense is involved. That argument would be very persuasive were it not for another consideration *67 that tilts our decision in the other direction.
The definition of a sexually violent predator is as follows:
[A] person who has been convicted of or charged with a sexually violent offense and who suffers from a mental abnormality which makes the person likely to engage in predatory acts constituting sexually violent offenses, if not confined in a secure facility.
Iowa Code § 229A.2(11). Having been convicted of or charged with a sexually violent offense is an element that the State must prove in order to successfully establish that a subject should be committed as a sexually violent predator. In the present case, as we have previously noted, this must have been in regard to the offense for which Huss was confined at the time the petition was filed. The hearing provided in section 229A.7(1) is a trial to the court. The final hearing at which it is to be determined whether the subject is a sexually violent predator contemplates a right to jury trial. We are persuaded that the critical issue of whether Huss was charged with a sexually violent offense is more properly to be determined at the final hearing under section 229A.7(2) wherein the right to jury trial is available. The right to jury trial would be substantially diluted if an important element in the determination of sexually violent predator status could be determined in a preliminary bench trial.
Notwithstanding our conclusion as to when this issue should be determined, Huss's view of that matter at the time of the discovery dispute, which was shared by the State and the district court, created a situation in which he had reason not to subject himself to the examination until the section 229A.7(1) hearing was completed. This circumstance, coupled with his willingness to submit to the examination prior to the final hearing convinces us that the district court's sanctions should not be allowed to stand.
We vacate the district court's sanction order and also vacate the order granting summary judgment. The case is remanded to the district court for further proceedings, which shall include (1) establishing a time for Huss to be examined, (2) fixing a section 229A.7(1) hearing date, and (3) fixing a final hearing date that shall afford the parties sufficient time to request a trial by jury as provided in Iowa Code section 229A.7(3). The time for Huss's psychological examination need not await the conclusion of the section 229A.7(1) hearing. All costs of appeal are assessed to the State.
ORDERS VACATED AND CASE REMANDED.
All justices concur except LARSON, J., who takes no part.
NOTES
[1]  Iowa Code section 229A.7(1) provides that, if a person charged with a sexually violent offense has been found not guilty by reason of insanity, "the court shall first hear evidence and determine whether the person did commit the act or acts charged." Iowa Code § 229A.7(1). The statute further provides:

At the hearing on this issue, the rules of evidence applicable in criminal cases shall apply, and all constitutional rights available to defendants at criminal trials, other than the right not to be tried while incompetent, shall apply.
Id.
[2]  These protections borrowed from criminal jurisprudence have not been extended to the final hearing under Iowa Code section 229A.7(2).
