
386 Mass. 363 (1982)
436 N.E.2d 135
JOHN C. BRADLEY, JR.
vs.
COMMISSIONER OF MENTAL HEALTH & ANOTHER[1]
Supreme Judicial Court of Massachusetts, Norfolk.
February 4, 1982.
June 1, 1982.
Present: HENNESSEY, C.J., WILKINS, LIACOS, ABRAMS, & O'CONNOR, JJ.
Bruce E. Mohl, Assistant Attorney General (Kim E. Murdock & John Bishop, Special Assistant Attorneys General, with him) for Commissioner of Mental Health.
Neil M. Kerstein for the plaintiff.
WILKINS, J.
The plaintiff sought his transfer from the Bridgewater State Hospital (Bridgewater), which is within the Department of Correction (G.L.c. 125, § 18), to a facility within the Department of Mental Health (DMH). *364 G.L.c. 123, § 9 (b). He has been a patient committed to Bridgewater pursuant to G.L.c. 123, § 16, since prior to February 10, 1975, when he was found not guilty on two murder indictments by reason of lack of criminal responsibility. A person's continued commitment to Bridgewater is appropriate only if a judge finds that (1) he is mentally ill, (2) he is not a proper subject for commitment to any DMH facility, and (3) the failure to retain him "in strict custody would create a likelihood of serious harm." G.L.c. 123, § 8 (b), as appearing in St. 1976, c. 356, § 3. It is agreed by the Commissioner and the plaintiff, and was found by the Superior Court judge, that the plaintiff is still suffering from a mental illness and that he is dangerous to himself and others, but that he does not require the strict security of Bridgewater. The plaintiff does, however, require a controlled and secure setting.[2]
The problem in this case arises because, at least at the time of the Superior Court hearing in October, 1980, the DMH did not have any facility sufficiently restrictive to meet the security requirements found to be necessary for the plaintiff. The only witness at trial, a licensed clinical psychologist at Bridgewater, testified that, although the plaintiff needed only an intermediate level of security, he should be held behind double locked doors. The DMH admittedly had no such facility. Because the plaintiff does not need strict security, by statute he should no longer be committed to Bridgewater, and should be transferred to a DMH facility (see G.L.c. 123, §§ 8 [a] and [b]). The DMH does not agree, and did not concede at trial, that it cannot provide an appropriate level of intermediate security.
The judge ordered the DMH, within six months from the date his order should become final, to "provide at least one facility in which persons committed pursuant to Chapter 123, section 16(e) may effectively be restricted in his movements to the buildings and grounds of the facility to which he is *365 committed by a Court." Pending DMH compliance with that order, the plaintiff was recommitted to Bridgewater. The DMH appealed, and we transferred the case to this court on our own motion.
The Commonwealth argues in part that the judge's order exceeds his authority by usurping executive and legislative functions. We agree that the order is too broad and must be vacated. Any order should be limited to apply only to the plaintiff.
The record does not warrant the entry of an order mandating the DMH to provide at least one facility for all persons committed pursuant to G.L.c. 123, § 16 (e). The judge lacked statutory authority to enter such a broad order. Nor did he have the inherent power to enter such an order. The inherent power of courts to enter orders concerning the expenditure of funds extends only to matters essential to the courts' functions, to the maintenance of their authority, and to their capacity to determine the rights of parties. See Sheriff of Middlesex County v. Commissioner of Correction, 383 Mass. 631, 634-635 (1981); Commonwealth v. Jackson, 369 Mass. 904, 920-923 (1976). Nor is there any demonstrated basis for concluding that the DMH has broadly abrogated its statutory duties in the face of a judicial direction to fulfil them, thus justifying the issuance of an order concerning the carrying out of an executive function. Contrast Perez v. Boston Hous. Auth., 379 Mass. 703, 733 (1980); Blaney v. Commissioner of Correction, 374 Mass. 337, 342-343 (1978). We turn then to consideration of the authority of a judge to enter a specific order to protect the statutory rights of a person such as the plaintiff.
Both parties concede, and we accept for the purposes of this case, that the judge had authority under G.L.c. 123, § 16 (e), as amended by St. 1973, c. 569, § 12, to order the plaintiff to "be restricted in his movements to the buildings and grounds of the facility at which he is committed by the court." If a judge, pursuant to § 8 (b), commits a person to "a facility designated by the [DMH]," the judge may, pursuant to § 16 (e), order that his movements be restricted to *366 the facility designated from time to time by the DMH (see G.L.c. 123, § 3).
The statutory purpose is clear that the plaintiff should no longer be committed to Bridgewater. At least until it is demonstrated that the DMH is unable or unwilling to provide the level of security necessary for the plaintiff's confinement in some DMH facility, no order should be entered directing the DMH to fulfil its statutory obligations in any particular way. The initial judgment as to the means of restricting the plaintiff's movements is to be made by the DMH.
The order of the Superior Court judge is vacated and the case is remanded to the Superior Court for the entry of an appropriate judgment consistent with this opinion. Assuming no change in the plaintiff's condition, a judgment should be entered that the plaintiff should not be held at Bridgewater; that he has a statutory right to be committed to a facility designated by the DMH; that he is to be committed to such a facility; that his movements should be restricted to the buildings and grounds of that facility (see G.L.c. 123, § 16 [e]); that the DMH has the obligation to provide that level of intermediate security that the plaintiff's condition requires; that, if the DMH does not provide that level of security, the court has the authority to direct the DMH to provide it, assuming the DMH does not prove a lack of available funds to fulfil such an order (see Blaney v. Commissioner of Correction, 374 Mass. 337, 342-343 [1978]; G.L.c. 29, § 27); and that the court retain jurisdiction of the case for the purpose of entering such supplemental judgments as may be necessary to protect the plaintiff's statutory rights.[3]
So ordered.
NOTES
[1]  The Commissioner of Correction, who has taken no position before this court on the appeal of the Commissioner of Mental Health.
[2]  We assume with the parties that a Superior Court judge acting on a petition under G.L.c. 123, § 9 (b), to determine whether a patient at Bridgewater requires strict security appropriately should apply the standards of G.L.c. 123, § 8 (b).
[3]  We need not consider whether the judge properly denied the Commissioner of Mental Health's motion for judgment on the pleadings. The judgment which we order is consistent with the judgment that would have been appropriate on the allegations of the plaintiff's petition for review. The question of the plaintiff's right to transfer to a DMH facility was clearly raised by the petition and, in the circumstances, the Commissioner was an appropriate person to be named in the action.
