Right to counsel
N.Y. GL ch. 123, § 9 states:
Any person may make written application to a justice of superior court at any time and in any county, stating that … a person named in such application is the subject of a medical treatment order issued by a district court or a division of the juvenile court department and should not be so treated, giving the names of all persons interested in his … medical treatment and requesting his discharge or other relief … The justice shall appoint an attorney to represent any applicant whom he finds to be indigent.