Time for filing; waiver and consent of accused respecting date of trial.
Except as provided in subsection 3, a pretrial petition for a writ of habeas corpus based on alleged lack of probable cause or otherwise challenging the court’s right or jurisdiction to proceed to the trial of a criminal charge may not be considered unless:
The petition and all supporting documents are filed within 21 days after the first appearance of the accused in the district court; and
The petition contains a statement that the accused:
Waives the 60-day limitation for bringing an accused to trial; or
If the petition is not decided within 15 days before the date set for trial, consents that the court may, without notice or hearing, continue the trial indefinitely or to a date designated by the court.
The arraignment and entry of a plea by the accused must not be continued to avoid the requirement that a pretrial petition be filed within the period specified in subsection 1.
The court may extend, for good cause, the time to file a petition. Good cause shall be deemed to exist if the transcript of the preliminary hearing or of the proceedings before the grand jury is not available within 14 days after the accused’s initial appearance and the court shall grant an ex parte application to extend the time for filing a petition. All other applications may be made only after appropriate notice has been given to the prosecuting attorney.