Following a hearing pursuant to G. L. c. 123, § 16(⅜)> a judge of the Dorchester Division of the Boston Municipal Court Department (BMC) found E.C. incompetent to stand trial and committed him to Bridgewater State Hospital (BSH) for six months. After the § 16(b) commitment expired and the underlying criminal charge against E.C. was dismissed, a judge of the Brockton Division of the District Court Department (Brockton District Court) denied BSH’s timely petition to extend the commitment under G. L. c. 123, § 16(c). The judge also denied BSH’s motion to amend that petition to one pursuant to G. L. c. 123, §§ 7 and 8, seeking continued civil commitment of a mentally ill person whose discharge from BSH would create a likelihood of *814serious harm. The Appellate Division of the District Court affirmed. On appeal, BSH claims error in the denial of the original and amended petitions. We reverse.
Background. The material facts are not in dispute. On May 30, 2012, E.C. was charged in the BMC with malicious destruction of property having a value greater than $250 in violation of G. L. c. 266, § 127. Following a hearing pursuant to G. L. c. 123, § 15(a), a judge ordered E.C. hospitalized pursuant to G. L. c. 123, § 15(ft), in order to evaluate his competency to stand trial. Based on the resulting § 15(⅜) report, the judge on August 7, 2012, found E.C. incompetent to stand trial. Thereafter, pursuant to BSH’s G. L. c. 123, § 16(⅜), petition, E.C. was committed to BSH for six months.1
As the expiration of the G. L. c. 123, § 16(⅜), commitment drew near, on March 4, 2013, BSH petitioned in Brockton District Court,2 pursuant to G. L. c. 123, § 16(c), for E.C.’s further commitment. On March 7, 2013, when the initial six-month § 16(⅜) commitment expired,3 but prior to the hearing on BSH’s § 16(c) petition, the criminal charge pending in the BMC against E.C. was dismissed over the Commonwealth’s objection. Shortly *815after the dismissal, BSH filed a motion in the Brockton District Court to amend its § 16(c) petition to one pursuant to G. L. c. 123, §§ 7 and 8. On March 20, 2013, the judge denied the motion to amend and determined that, following the dismissal of the criminal case, the § 16(c) petition could “no longer serve as a valid basis to detain [E.C.].” The judge also concluded that after the criminal charge was dismissed, BSH lacked a valid basis to retain E.C. and therefore could not pursue his commitment under §§ 7 and 8 because he was no longer a patient. The judge denied BSH’s subsequent motion for reconsideration. As a result, E.C. was immediately released from BSH.4
BSH appealed the judge’s orders to the Appellate Division of the District Court, which affirmed. In affirming the judge’s decisions, the Appellate Division determined that the dismissal of the criminal charge against E.C. terminated BSH’s authority to proceed against him under G. L. c. 123, § 16(c), because the “issue of E.C.’s competency] was no longer before the court once the criminal case was dismissed.”
The Appellate Division relied on G. L. c. 123, § 16(⅜), which provides for continued commitment of a defendant following the dismissal of criminal charges, and determined that G. L. c. 123, § 16(c), which contains no such reference, does not similarly apply. Therefore, the Appellate Division determined that a pending criminal charge was a prerequisite for continued retention, and applied that reasoning to § 16(c) to conclude that BSH could not pursue further commitment following the dismissal of E.C.’s charge. As BSH had moved to amend its petition from one under § 16(c) to one under G. L. c. 123, §§ 7 and 8, the Appellate Division suggested that BSH recognized this prerequisite. In the end, the Appellate Division affirmed, reasoning that once the § 16(⅜) commitment period had run, BSH lacked the authority to detain E.C. because he was no longer a “patient” and, therefore, could not be subject to a petition pursuant to §§ 7 and 8.
In addition, the Appellate Division held there was no support in the record for BSH’s argument that the BMC judge expected that *816E.C. would remain at BSH pending the hearing on the G. L. c. 123, § 16(c), petition. Although the Appellate Division acknowledged the logistical issues BSH faced in being informed of the status of criminal charges where BSH itself is not a party to those proceedings, the court nevertheless agreed that the statutory framework did not allow for E.C.’s continuing commitment under § 16(c) or §§ 7 and 8. This appeal followed.
Discussion. On appeal, BSH claims the denial of its petition to commit E.C. was based on an erroneous interpretation of G. L. c. 123, § 16(c). We agree. The proper interpretation of § 16(c) is a question of law, which we review de novo. See Protective Life Ins. Co. v. Sullivan, 425 Mass. 615, 618 (1997). “It is a fundamental principle of statutory construction that ‘statutory language should be given effect consistent with its plain meaning and in light of the aim of the Legislature unless to do so would achieve an illogical result.’ ” Commonwealth v. Hatch, 438 Mass. 618, 622 (2003), quoting from Sullivan v. Brookline, 435 Mass. 353, 360 (2001). Where the text is unclear or ambiguous, “a statute must be interpreted according to the intent of the Legislature ascertained from all its words construed by the ordinary and approved usage of the language, considered in connection with the cause of its enactment, the mischief or imperfection to be remedied and the main object to be accomplished, to the end that the purpose of its framers may be effectuated.” Telesetsky v. Wight, 395 Mass. 868, 872 (1985), quoting from Commonwealth v. Galvin, 388 Mass. 326, 328 (1983). Under these principles of statutory construction, we evaluate the reach and limits of § 16(c) based on its plain language and in the context of the statutory framework.
To begin, G. L. c. 123, § 6(a), inserted by St. 1986, c. 599, § 38, states that “[n]o person shall be retained at a facility or at the Bridgewater state hospital except. . . during the pendency of a petition for commitment' (emphasis supplied). As § 6(a) unambiguously authorizes retention of an individual while a commitment petition is pending, and neither makes reference to nor requires the condition of pending criminal charges, BSH explicitly retained authority over E.C. where it filed the G. L. c. 123, § 16(c), petition prior to or concurrently with the expiration of the G. L. c. 123, § 16(⅜), commitment. Pursuant to § 6, the subsequent dismissal of the criminal charge against E.C. did nothing to alter the validity of BSH’s pending commitment petition or its authority to retain E.C. while the petition was pending. See Commonwealth v. Hatch, supra.
*817Furthermore, the underlying purpose of G. L. c. 123, § 16, supports BSH’s claim that it retained the appropriate authority over E.C. to proceed on the § 16(c) petition for his commitment. However, the Appellate Division determined that because § 16(c), in contrast with § 16(⅜), contains no reference to the effect dismissal of criminal charges has on commitment, it therefore does not provide for continuing commitment after that dismissal. We disagree. Section 16(c), inserted by St. 1986, c. 599, § 38, provides in relevant part:
“After the expiration of a commitment under paragraph (b) of this section, a person may be committed for additional one year periods under the provisions of sections seven and eight of this chapter, but no untried defendant shall be so committed unless in addition to the findings required by sections seven and eight the court also finds said defendant is incompetent to stand trial. If the person is not found incompetent, the court shall notify the court with jurisdiction of the criminal charges, which court shall thereupon order the defendant returned to its custody for the resumption of criminal proceedings.”
Although we do not read language from § 16(⅜) into a provision from which it is absent, see Commonwealth v. Dodge, 428 Mass. 860, 865 (1999) (“[wjhere the Legislature has employed specific language in one [section of an act], but not in another, the language should not be implied where it is not present” [quotation omitted]), the statute nonetheless “should be read as a whole to produce an internal consistency.” Telesetsky v. Wight, supra at 873.
Moreover, because “we must read the statute in a way to give it a sensible meaning,” Beeler v. Downey, 387 Mass. 609, 616 (1982), we do not read G. L. c. 123, § 16(c), to require a patient’s immediate release after dismissal of underlying criminal charges where § 16 generally acknowledges BSH’s continuing authority and ability to petition for further commitment after the dismissal. Specifically, G. L. c. 123, § 16(A), permits a petition to commit an untried defendant for six months “only if the defendant is found incompetent to stand trial, or if the criminal charges are dismissed after commitment.”5 If dismissal of criminal charges immediately terminated the commitment order and BSH’s authority over a *818patient under § 16(c) as a matter of law, the § 16(⅜) reference to pursuing further commitment of an untried defendant following the dismissal would be rendered meaningless, particularly because § 16(c) extends the § 16(A) six-month commitment by additional one-year periods based on the same considerations.6 See Bynes v. School Comm. of Boston, 411 Mass. 264, 267-268 (1991). Therefore, the dismissal of criminal charges does not immediately terminate BSH’s authority over a patient.
Other subsections of G. L. c. 123, § 16, lend support to our conclusion that the dismissal of criminal charges neither requires immediate discharge of a patient nor terminates BSH’s ability to petition for further commitment after the dismissal. For example, the first sentence of § 16(c), inserted by St. 1986, c. 599, § 38, provides that “[a]ny person committed to a facility under the provisions of this section may be restricted in his movements to the buildings and grounds of the facility at which he is committed by the court which ordered the commitment.” However, the concluding sentence of § 16(c) states: “This paragraph shall not apply to persons originally committed after a finding of incom-petenc[y] to stand trial whose criminal charges have been dismissed.” Thus, the Legislature clearly contemplated circumstances where a patient’s commitment could continue after the dismissal of criminal charges.
Similarly, G. L. c. 123, § 16(f),7 does not call for a patient’s *819immediate discharge following the dismissal of criminal charges. To the contrary, § 16if) supports the interpretation that, under G. L. c. 123, § 16(c), BSH retained authority over E.C. after the dismissal. Although the Appellate Division concluded that § 16(/) contains language that suggests that the existence of a criminal case is a statutory condition precedent to commit a patient under § 16, we disagree because the pendency of criminal charges is separate from the procedure for discharging a patient. Indeed, § 16(/) provides that the court must send a notice to the Department of Correction when a person is found to be incompetent to stand trial, in order to establish the date on which the charges must be dismissed. Section 16(/) does not require the immediate discharge of a patient or termination of a pending petition for further commitment. If the Legislature intended a § 16 commitment to terminate upon dismissal of the underlying criminal charges, it presumably would have inserted in § 16(/) the same clear instruction to release that is found in G. L. c. 123, § 18(c).8 In contrast, § 16(c) provides for one-year, renewable periods of commitment based on incompetency to stand trial and the findings required by G. L. c. 123, §§ 7 and 8, not the underlying criminal charges and accompanying sentences.
Furthermore, nothing in G. L. c. 123, § 16(/), requires immediate discharge of a patient or terminates BSH’s authority after dismissal of criminal charges, nor do we read such a requirement into that section of the statute. See Commonwealth v. Dodge, 428 Mass. at 865. Despite the absence of any explicit reference to dismissal of criminal charges in G. L. c. 123, § 16(c), the relevant provisions of § 16, read together, indicate that dismissal does not automatically terminate the commitment order or BSH’s author*820ity.
In addition, the Appellate Division erred by holding that E.C. was no longer a patient once his criminal charge had been dismissed. The Appellate Division’s view of who qualified as a patient was too narrow. Pursuant to G. L. c. 123, § 1, as amended through St. 1989, c. 117, § 3, a “patient” is defined as “any person with whom a licensed mental health professional has established a mental health professional-patient relationship.” After E.C.’s relationship with the licensed mental health professionals had commenced, the dismissal of the criminal charge underlying his commitment did nothing to alter his patient relationship with BSH.
As discussed above, the dismissal of the criminal charge did not automatically discharge E.C., nor did it terminate BSH’s authority over E.C. or its ability to petition for his continuing commitment. E.C.’s argument, and the Appellate Division’s conclusion, that he was no longer a “patient” under G. L. c. 123 is contrary to the plain meaning of § 1.9 See Commonwealth v. Ray, 435 Mass. 249, 252 (2001) (“when the text of a statute is clear and unambiguous, it must be construed in accordance with its plain meaning”). Because the dismissal of the criminal charge did not require E.C.’s immediate discharge, BSH retained authority over E.C. as a “patient,” and the Appellate Division erred in concluding otherwise.
Finally, although the Appellate Division held that E.C.’s competency was no longer at issue once the charge had been dismissed, the G. L. c. 123, § 16(c), petition was an appropriate vehicle to seek his continued confinement. Because commitment under § 16(c) explicitly requires the same findings required by G. L. c. 123, §§ 7 and 8, there is no substantive distinction between the standards governing an extended commitment under § 16(c) and the commitment of persons under §§ 7 and 8. Thus, it was not necessary for BSH to amend its petition to one pursuant to §§ 7 and 8, and we do not reach the issue whether it was error to deny the motion to amend.
Conclusion. The decision and order of the Appellate Division is reversed. A new order shall enter modifying the Brockton *821District Court order to provide that BSH is authorized to seek additional commitment pursuant to G. L. c. 123, § 16(c).
So ordered.
General Laws c. 123, § 16(b), as amended by St. 1992, c. 286, § 190, states in pertinent part:
“During the period of observation of a person believed to be incompetent to stand trial or within sixty days after a person is found to be incompetent to stand trial or not guilty of any crime by reason of mental illness or other mental defect, the district attorney, the superintendent of a facility or the medical director of the Bridgewater state hospital may petition the court having jurisdiction of the criminal case for the commitment of the person to a facility or to the Bridgewater state hospital. However, the petition for the commitment of an untried defendant shall be heal'd only if the defendant is found incompetent to stand trial, or if the criminal charges are dismissed after commitment. If the court makes the findings required by paragraph (a) of section eight it shall order the person committed to a facility; if the court makes the findings required by paragraph (b) of section eight, it shall order the commitment of the person to the Bridgewater state hospital; otherwise the petition shall be dismissed and the person discharged. An order of commitment under the provisions of this paragraph shall be valid for six months.”
The Brockton District Court has been designated as the site for all District Court civil commitment proceedings pursuant to G. L. c. 123. See G. L. c. 123, § 5; G. L. c. 218, § 43A.
The Appellate Division determined that the period ended on or around March 4, 2013, based on a docket entry explaining that E.C. had been found incompetent and would not be brought to court as scheduled on September 6, 2012. From this entry, the Appellate Division presumed the six-month commit*815ment would have begun by that September 6 date at the latest and that the period would have therefore concluded by March 4.
We agree with the parties’ assessment that, although E.C. has been released, this case is not moot because the question it presents falls within an exception to the mootness doctrine because it is “capable of repetition, yet evading review.” Karchmar v. Worcester, 364 Mass. 124, 136 (1973), quoting from Southern Pac. Terminal Co. v. Interstate Commerce Commn., 219 U.S. 498, 515 (1911).
E.C. suggests that G. L. c. 123, § 16(fc), should be read as follows: “[T]he petition for the commitment of an untried defendant shall be heard only if the defendant is found incompetent to stand trial, or [if found competent,] the *818criminal charges are dismissed after commitment.” He claims that because only the district attorney will know when criminal charges will be dismissed after a commitment hearing, only the district attorney, not BSH, has the authority to file a petition for continued commitment after charges are dismissed. Therefore, he claims, § 16(A) is inapplicable to our interpretation of § 16(c). This interpretation reads a limitation into the statute that does not exist. This we cannot do. Rather, “where two or more statutes relate to the same subject matter, they should be construed together so as to constitute a harmonious whole consistent with the legislative purpose.” Board of Educ. v. Assessor of Worcester, 368 Mass. 511, 513-514 (1975).
Both G. L. c. 123, §§ 1(b) and 8(b). to which G. L. c. 123, § 16(A) and (c), refer, provide for the commitment to BSH of a mentally ill male patient where the failure to retain an individual in “strict security” or “strict custody” would pose a “likelihood of serious harm.”
Section 16(f) of G. L. c. 123, inserted by St. 1986, c. 599, § 38, states:
“If a person is found incompetent to stand trial, the court shall send notice to the department of correction which shall compute the date of the expiration of the period of time equal to the time of imprisonment which the person would have had to serve prior to becoming eligible for parole if he had been convicted of the most serious crime with which he was *819charged in court and sentenced to the maximum sentence he could have received, if so convicted. For purposes of the computation of parole eligibility, the minimum sentence shall be regarded as one half of the maximum sentence potential sentence. Where applicable, the provisions of sections one hundred and twenty-nine, one hundred and twenty-nine A, one hundred and twenty-nine B, and one hundred and twenty-nine C of chapter one hundred and twenty-seven shall be applied to reduce such period of time. On the final date of such period, the court shall dismiss the criminal charges against such person, or the court in the interest of justice may dismiss the criminal charges against such person prior to the expiration of such period.”
Section 18(c) of G. L. c. 123 provides the commitment sentence for mentally ill prisoners, calculates the appropriate period of hospitalization based on the prisoner’s sentence, and permits discharge on that specified calculated date. Section 16 makes no such reference to an immediate discharge.
To the extent the Appellate Division’s case law defines “patient” otherwise, we are not bound by it. See Matter of C.B., 2013 Mass. App. Div. 42. In any event, the narrow definition of “patient” accepted in C.B. contemplated the commitment of an individual who, unlike E.C., was found competent to stand trial prior to BSH’s petition under G. L. c. 123, § 16(c).