
605 N.W.2d 434 (2000)
258 Neb. 695
STATE of Nebraska, appellee,
v.
James E. JONES, appellant.
No. S-99-579.
Supreme Court of Nebraska.
January 28, 2000.
*435 Thomas C. Riley, Douglas County Public Defender, Omaha, and Leslie E. Kendrick, Lincoln, for appellant.
Don Stenberg, Attorney General, and Marilyn B. Hutchinson, Lincoln, for appellee.
HENDRY, C.J., WRIGHT, CONNOLLY, GERRARD, STEPHAN, McCORMACK, and MILLER-LERMAN, JJ.
*436 GERRARD, J.

NATURE OF CASE
James E. Jones appeals from an order of the Douglas County District Court finding him incompetent to stand trial and committing him to a state hospital for the mentally ill. The question presented is whether the district court's ruling that "there is a question as to whether or not there is a substantial probability that [Jones] will become competent within the foreseeable future" and its subsequent order of commitment comply with the requirements of Neb.Rev.Stat. § 29-1823 (Cum.Supp.1998). Because we conclude that the district court did not make the requisite finding mandated by § 29-1823, we vacate its order and remand this cause with direction that the district court make the necessary finding in compliance with § 29-1823.

FACTUAL AND PROCEDURAL BACKGROUND
Jones was charged with an unauthorized use of a financial transaction device on October 22, 1998. On January 17, 1999, Jones was hospitalized at Alegent Health, Immanuel Medical Center (Alegent Health), under a Douglas County Board of Mental Health petition as filed by his family. His family had noticed that Jones was exhibiting bizarre behavior. Additionally, Jones had threatened his grandmother and his uncle. Dr. Hudson Hsieh of Alegent Health diagnosed Jones with a schizophrenic disorder and marijuana dependence and stated that Jones was a danger to himself and was unable to meet his basic human needs. Hsieh recommended that the least restrictive treatment alternative for Jones would be continued inpatient psychiatric treatment. The Douglas County Board of Mental Health accepted this recommendation and on January 29, 1999, ordered Jones to full-time inpatient hospitalization at Alegent Health for a period of observation not to exceed 60 days.
On February 10, 1999, Jones' counsel made a motion, pursuant to § 29-1823, to determine whether Jones was mentally competent to stand trial on the unauthorized use of a financial device charge. On February 16, a competency hearing was conducted. Jones' counsel offered the January commitment order of the Douglas County Board of Mental Health, which was received into evidence. The district court ordered Jones to undergo a "psychological evaluation," performed by Dr. Bruce D. Gutnik, a duly licensed psychiatrist.
On April 21, 1999, the competency hearing continued. Gutnik's written psychiatric diagnostic evaluation was received into evidence. Gutnik's evaluation stated that Jones was psychotic, was quite paranoid, experienced auditory hallucinations, did not understand the roles of the judge and jury, and did not trust his attorney. Gutnik concluded:
Jones is at this time not competent to stand trial and not competent to participate in his own defense. If he is to remain on his present medications and if his condition does not improve, then one could assume that he will remain incompetent for the foreseeable future. If his treatment plan is to change, then [sic] level of competence may also change.
On May 7, the district court found that Jones was not competent to stand trial at the present time and that "there is a question as to whether or not there is a substantial probability that [Jones] will become competent within the foreseeable future." The district court ordered that Jones be committed to the Norfolk Regional Center in Norfolk, Nebraska, or to another state hospital for the mentally ill until such time as the disability may be removed and that a review hearing of this matter shall take place 6 months from the date of the order or as soon thereafter as the matter can be scheduled. It is from this order that Jones appeals.


*437 ASSIGNMENTS OF ERROR
Jones alleges, restated, that (1) the district court's order does not comply with § 29-1823 because Jones can be ordered to be committed only until such time as he shall become competent, with a review in 6 months, if there is a finding that there is a substantial probability that Jones will become competent within the foreseeable future and (2) there is no factual basis for a finding that there is a substantial probability that Jones will become competent within the foreseeable future and, therefore, no factual basis supports the portion of the district court's order committing Jones until such time as his disability may be removed, with 6-month reviews.

STANDARD OF REVIEW
The question of competency to stand trial is one of fact to be determined by the trial court and the means employed in resolving the question are discretionary with the court. State v. Bolton, 210 Neb. 694, 316 N.W.2d 619 (1982). If there is sufficient evidence in the record to support factual findings relating to competency, such factual findings will not be disturbed on appeal. See State v. Johnson, 4 Neb. App. 776, 551 N.W.2d 742 (1996). See, also, State v. Guatney, 207 Neb. 501, 299 N.W.2d 538 (1980).

ANALYSIS

FINAL ORDER
The State argues that the district court's order is not a final, appealable order and, therefore, maintains that Jones' appeal is not properly before this court. The State's argument is essentially that because the district court found that there was a question as to whether there is a substantial probability that Jones will become competent within the foreseeable future and provided for another hearing in 6 months, a final order has not been entered.
Before reaching the legal issues presented for review, it is the duty of an appellate court to determine whether it has jurisdiction over the matter before it. In re Interest of Alycia P., 258 Neb. 258, 603 N.W.2d 7 (1999); US Ecology v. State, 258 Neb. 10, 601 N.W.2d 775 (1999).
Neb.Rev.Stat. § 25-1902 (Reissue 1995) defines a final order:
An order affecting a substantial right in an action, when such order in effect determines the action and prevents a judgment, and an order affecting a substantial right made in a special proceeding, or upon a summary application in an action after judgment, is a final order which may be vacated, modified or reversed, as provided in this chapter.
A proceeding to determine the competency of an accused to stand trial is a special proceeding within the meaning of § 25-1902, and an order finding the accused incompetent to stand trial and ordering the accused confined until such time as he or she is competent is a final order from which an appeal may be taken under Neb. Rev.Stat. § 25-1911 (Reissue 1995). Guatney, supra.
In Guatney, an argument similar to the State's argument was rejected. Guatney involved a prior version of § 29-1823 (Reissue 1979). This version did not require a determination regarding whether there is a substantial probability that the accused will become competent within the foreseeable future and did not provide for 6-month reviews. However, the reasoning of Guatney reveals that the final order analysis remains the same. We held in Guatney that a competency hearing was a special proceeding and that an order finding the accused incompetent to stand trial and committing the accused until he or she is competent is a final order. In so holding, we stated:
We, therefore, find little reason or sense in suggesting that one may be deprived of his liberty under a court order finding him incompetent ... and have no recourse from that order. In the instant case, the court has done more than declare that the accused need not answer *438 the charges against him. The court, by virtue of its order, has ... denied the appellant his liberty for an undetermined time. It is difficult, if not impossible, to see how that order, therefore, does not affect a substantial right or is not an order from which the appellant should be entitled to appeal pursuant to the provisions of § 25-1911.
State v. Guatney, 207 Neb. 501, 507-08, 299 N.W.2d 538, 543 (1980).
The district court in this case found that Jones was not competent to stand trial and ordered him to be committed to a state mental hospital, with a review after 6 months. Similar to Guatney, supra, Jones has been denied his liberty for an unascertainable and significant amount of time. This denial clearly affects a substantial right. Additionally, because Guatney determined that a proceeding to determine the competency of an accused to stand trial is a special proceeding within the meaning of § 25-1902, the district court's order is an order affecting a substantial right made in a special proceeding. Thus, the district court's order in the instant case is a final order, and we have jurisdiction to consider Jones' appeal.

§ 29-1823
Section 29-1823 was substantially amended in 1997, and the amended portion of § 29-1823 relevant to this appeal provides:
(1) If at any time prior to trial it appears that the accused has become mentally incompetent to stand trial, such disability may be called to the attention of the district court by the county attorney, by the accused, or by any person for the accused. The judge of the district court of the county where the accused is to be tried shall have the authority to determine whether or not the accused is competent to stand trial.... Should the district judge determine after a hearing that the accused is mentally incompetent to stand trial and that there is a substantial probability that the accused will become competent within the foreseeable future, the district judge shall order the accused to be committed to a state hospital for the mentally ill or some other appropriate state-owned or state-operated facility for appropriate treatment until such time as the disability may be removed.
(2) Within six months after the commencement of the treatment ordered by the district court, and every six months thereafter until either the disability is removed or other disposition of the accused has been made, the court shall hold a hearing to determine (a) whether the accused is competent to stand trial or (b) whether or not there is a substantial probability that the accused will become competent within the foreseeable future.
(3) If it is determined that there is not a substantial probability that the accused will become competent within the foreseeable future, then the state shall either (a) commence the applicable civil commitment proceeding that would be required to commit any other person for an indefinite period of time or (b) release the accused.
(Emphasis supplied.)
In the absence of anything to the contrary, statutory language is to be given its plain and ordinary meaning; an appellate court will not resort to interpretation to ascertain the meaning of statutory words which are plain, direct, and unambiguous. State ex rel. Stenberg v. Moore, 258 Neb. 199, 602 N.W.2d 465 (1999); Parnell v. Madonna Rehab. Hosp., 258 Neb. 125, 602 N.W.2d 461 (1999). If the language of a statute is clear, the words of such statute are the end of any judicial inquiry regarding its meaning. Ameritas Life Ins. v. Balka, 257 Neb. 878, 601 N.W.2d 508 (1999).
The language of § 29-1823 is clear. The statute sets forth a decision tree that the district courts are obligated to follow. The district court must first determine whether or not the accused is mentally *439 competent to stand trial. In making that determination, the district court may cause such medical, psychiatric, or psychological examination of the accused to be made as he or she deems warranted, and the court may hold such hearing as he or she deems necessary. If the district court determines that the accused is incompetent to stand trial, then the court must make a determination whether there is a substantial probability that the accused will become competent within the foreseeable future. If the district court determines that there is a substantial probability that the accused will become competent within the foreseeable future, then § 29-1823(1) mandates that the court order the accused committed to a state mental hospital or to some other appropriate state-owned or state-operated facility for appropriate treatment until such time as the disability may be removed. Section 29-1823(2) provides for 6-month reviews of the competency determination made by the district court. If, however, the district court determines that there is not a substantial probability that the accused will become competent within the foreseeable future, § 29-1823(3) specifies the appropriate procedure: the State shall either commence civil commitment proceedings or release the accused.
In the present case, the district court made no dispositive determination; rather, the court found that "there is a question as to whether or not there is a substantial probability that [Jones] will become competent within the foreseeable future." Jones' counsel argues that the record compels the conclusion that there is not a substantial probability that Jones will become competent within the foreseeable future. Therefore, Jones requests that we reverse the order of the district court and remand this matter with direction to the district court to enter an order mandating the State to either commence civil commitment proceedings or release the accused pursuant to § 29-1823(3). This we cannot do. We are not convinced that this record compels only one conclusion; on the contrary, Gutnik's evaluation, as a whole, could reasonably lead to more than one conclusion.
The obvious problem in the instant case is that the district court did not comply with the statutory mandates of § 29-1823. The court neither determined that there was a substantial probability that Jones would become competent within the foreseeable future, as provided in § 29-1823(1), nor did the court determine that there was not a substantial probability that Jones would become competent within the foreseeable future, as provided in § 29-1823(3). In the absence of such a factual determination, there is no order that we can meaningfully review on appeal.
For this reason, we vacate the May 7, 1999, order of the district court and remand the cause to the district court with direction that the court enter an order complying with the requirements of § 29-1823.
We do note that the means to be employed to determine competency or the substantial probability of competency within the foreseeable future are discretionary with the district court, see State v. Bolton, 210 Neb. 694, 316 N.W.2d 619 (1982), and that the district court may cause such further medical, psychiatric, or psychological examination of the accused to be made as the court deems necessary in order to make such a determination, see § 29-1823(1).

CONCLUSION
Because we conclude that the district court did not make the requisite finding mandated by § 29-1823, we vacate its May 7, 1999, order and remand this cause with direction that the district court make the necessary finding in compliance with § 29-1823.
ORDER VACATED, AND CAUSE REMANDED WITH DIRECTION.
