N.Y. Criminal Procedure Law § 216.05
3.
(a) Upon receipt of the evaluation report either party may request a hearing on the issue of whether the eligible defendant should be offered alcohol or substance use treatment pursuant to this article. At such a proceeding, which shall be held as soon as practicable so as to facilitate early intervention in the event that the defendant is found to need alcohol or substance use treatment, the court may consider oral and written arguments, may take testimony from witnesses offered by either party, and may consider any relevant evidence including, but not limited to, evidence that:
(b) Upon completion of such a proceeding, the court shall consider and make findings of fact with respect to whether:
4. When an authorized court determines, pursuant to paragraph (b) of subdivision three of this section, that an eligible defendant should be offered alcohol or substance use treatment, or when the parties and the court agree to an eligible defendant's participation in alcohol or substance use treatment, an eligible defendant may be allowed to participate in the judicial diversion program offered by this article. Prior to the court's issuing an order granting judicial diversion, the eligible defendant shall be required to enter a plea of guilty to the charge or charges; provided, however, that no such guilty plea shall be required when:
9.