Plaintiff appeals from the trial court’s dismissal of his action against defendant state-employed mental health care professionals alleging professional malpractice and negligence resulting in the wrongful death of his wife when she was struck by an automobile after straying from the grounds of a state-operated mental health care facility. We affirm.
On review of an order sustaining a motion to dismiss we accept the facts alleged in plaintiff’s petition and reasonable inferences from those facts as true. Porter v. Maunnangi, 764 S.W.2d 699, 700 (Mo.App.1988). On the evening of December 17, 1984, plaintiff’s wife, Bernice Bunting (“Bernice”), a patient at the Farmington State Mental Hospital, wandered from her assigned ward, was struck by a motor vehicle and subsequently died. Plaintiff filed a six count petition alleging medical malprac*449tice and negligence in the treatment of Bernice against Dr. R.A. Huckstep, Dr. Robert Deitchman, Rose Black, Allaene Sales and Patricia Grady, all licensed health care providers who were employed by Farmington State Mental Hospital and were members of Bernice's treatment team.1 Plaintiff alleged that defendants knew of Bernice’s propensity to wander and knew of the unsafe, insecure and understaffed conditions on open wards but nevertheless assigned her to an open unit. Although the specific counts are captioned as claims for professional malpractice or negligence, each count essentially alleges negligent exercise of judgment regarding the degree of restraint and/or supervision incident to Bernice’s detention in the mental health facility.
Defendants filed a Motion to Dismiss or in the alternative Motion for Summary Judgment, alleging that they are entitled to official immunity. On September 6, 1991, the trial court entered an order sustaining defendants’ motion to dismiss, citing Sherrill v. Wilson, 653 S.W.2d 661 (Mo. banc 1983) and Porter v. Maunnangi, 764 S.W.2d 699 (Mo.App.1988).
On appeal, plaintiff contends that the trial court erred in sustaining defendants’ motion to dismiss because defendants are not entitled to official immunity for medical malpractice. According to plaintiff, State ex rel. Eli Lilly & Co. v. Gaertner, 619 S.W.2d 761 (Mo.App.1981), establishes that physicians at state-owned mental hospitals can be held liable to their patients for medical malpractice. Defendants urge that Sherrill, supra, implicitly overrules State ex rel. Eli Lilly & Co., to the extent State ex rel. Eli Lilly & Co. holds that the common law doctrine of official immunity extends only to individuals with statutorily mandated jobs or duties involving government functions. Compare Sherrill, 653 S.W.2d at 667 with State ex rel. Eli Lilly & Co., 619 S.W.2d at 764-65.
We find it unnecessary to determine whether defendants would be entitled to invoke common law official immunity because liability for the specific acts of negligence alleged here has been foreclosed by statute. Specifically, § 632.440 RSMo 19862 provides:
632.440. No liability for public officials and certain peace officers. — No officer of a public or private agency, mental health facility, nor the head, attending staff or consultants of any such agency or facility, nor any mental health coordinator, registered professional nurse, licensed physician, mental health professional or any other public official performing functions necessary for the administration of this chapter, ... shall be civilly liable for detaining, transporting, conditionally releasing or discharging a person pursuant to this chapter ... so long as such duties were performed in good faith and without gross negligence.
In Porter, cited and relied upon by the trial court, this section was held to bar an action for wrongful death alleging negligence by state mental health physicians in discharging a patient who later committed suicide. 764 S.W.2d at 700. Although the plaintiff’s allegations were couched in terms of medical diagnosis and treatment, the court held that the allegations were inextricably linked to the decision to discharge for which the defendants were entitled to immunity under the express terms of the statute. Id.
In this case, plaintiff similarly seeks to circumvent the language of the statute by couching his allegations in terms of medical malpractice or failure to supervise. Yet even according plaintiff the benefit of all reasonable inferences, defendants’ liability is inextricably linked to their failure to detain Bernice in a manner that would have imposed greater restraints or supervision of her movements in and about the facility. Whether the alleged negligent conduct is *450viewed as “detaining” or “conditionally releasing,” as set forth in the language of the statute, it is precisely the sort of discretionary judgment the legislature has seen fit to render immune from civil liability.3
Chapter 632 RSMo 1986 plainly contemplates a continuum of various degrees of detention, mandating in virtually all instances placement in the least restrictive environment consistent with the best interests of the patient. See, e.g., § 632.385 RSMo 1986. To interpret § 632.440 to provide immunity for detaining or discharging a patient but not for decisions with respect to the degree of restraint or supervision required would inherently conflict with the overall statutory scheme by encouraging an “all or nothing” approach to detention of mental health patients. Thus, we believe that the legislative determination that state mental health care professionals should be shielded from liability for good faith decisions with respect to the detention, conditional release or discharge of mental health patients necessarily encompasses decisions regarding the degree of restraint or supervision imposed on such patients. Accordingly, defendants are immune from liability for the conduct alleged in the petition and the trial court properly sustained defendants’ motion to dismiss.
CARL R. GAERTNER, P.J., and CRANE, J., concur.. Count I alleging negligent operation of a motor vehicle by Homer McBride was settled and is not before this court. Additionally, Dr. Deitchman died and was dismissed before the trial court ruled on defendants’ motion.
. Both State ex rel. Eli Lilly & Co. and Sherrill involved conduct which occurred prior to the effective date of § 632.440 and therefore considered only the common law doctrine of official immunity.
. We recognize that the immunity afforded is not absolute and that it is still possible to state a claim with respect to conduct amounting to bad faith or "gross negligence.” See Boyer v. Tilzer, 831 S.W.2d 695 (Mo.App.1992). Plaintiff does not argue that this standard is satisfied here nor do the allegations in the petition support such an inference.