
    In the Matter of Felix Vidal, Appellant, v Walter Kelly, as Superintendent of Attica Correctional Facility, et al., Respondents.
   — Judgment unanimously modified on the law and as modified affirmed, in accordance with the following memorandum: Petitioner was charged in a misbehavior report with refusing to obey a direct order and refusing to submit to a urine test when he was suspected of using drugs. At his Tier II hearing he was found guilty of both charges on the basis of the misbehavior report.

Pursuant to the stipulation of counsel, Special Term ordered that the charge of refusing a direct order be nullified and expunged. Thereafter, without reference to the partial judgment nullifying and expunging the charge of refusing a direct order, Special Term determined in its written decision that when an inmate refuses to take the urine test, he subjects himself to two separate and distinct charges, namely, that he refused a direct order and that he used drugs. Special Term dismissed the petition and judgment was entered thereon.

It was error to disregard the partial judgment entered upon stipulation of counsel, nullifying and expunging the charge of refusing a direct order. While this court has held that an inmate’s refusal to submit to the urine test is subject to discipline as a refusal to obey a direct order (see, Matter of Matthews v Kelly, 119 AD2d 1004), that issue is not properly before us in view of the partial judgment entered upon the stipulation. It is well established that "[pjarties by their stipulations may in many ways make the law for any legal proceeding to which they are parties, which not only binds them, but which the courts are bound to enforce * * * and all such stipulations not unreasonable, not against good morals, or sound public policy, have been and will be enforced” (Matter of New York, Lackawanna & W. R. R. Co., 98 NY 447, 453; see also, Mitchell v New York Hosp., 61 NY2d 208, 214; Salesian Socy. v Village of Ellenville, 41 NY2d 521, 525-526; Tepper v Tannenbaum, 83 AD2d 541; 2A Weinstein-KornMiller, NY Civ Prac If 2104.01). Accordingly, we nullify and expunge the charge of refusing a direct order. We have examined the other issues raised and find them lacking in merit. (Appeal from judgment of Supreme Court, Wyoming County, McCarthy, J. — art 78.) Present — Doerr, J. P., Boomer, Green, Lawton and Davis, JJ.  