OPINION OF THE COURT
Donald J. Mark, J.*455The defendant is charged with two counts of sexual abuse in the first degree and three counts of endangering the welfare of a child, as a result of alleged sexual contact with a female under the age of 11 years and two males under the age of 17 years.
At the prosecutor’s request, the court issued a subpoena duces tecum to the Department of Corrections for a copy of the defendant’s medical records. At the defendant’s request, the court issued a subpoena duces tecum to the Family Court for a copy of any records involving the alleged victims and this alleged incident, to the Department of Social Services for the same records and to the Rochester Mental Health Center for a copy of psychiatric records of the alleged female victim.2 This procedure is the common practice in this area, but no authority for it is found in CPLR article 23.
' These four subpoenas duces tecum were apparently applied for and issued under the authority of CPLR 2302 (b), which provides in pertinent part as follows: "A subpoena to compel production of an original record or document where a certified transcript or copy is admissible in evidence * * * shall be issued by the court” (emphasis added). As has been indicated, the parties sought only copies of records, so this section is inapplicable.
The appropriate section under which the subpoenas to the four governmental agencies should have been issued is CPLR 2307. That section provides in pertinent part as follows: "A subpoena duces tecum to be served upon * * * a department or bureau of a municipal corporation or of the state * * * requiring the production of any * * * papers or other things, shall be issued * * * by a judge of the court in which an action for which it is required is triable * * * a motion for such subpoena shall be made on at least one day’s notice to the * * * department, bureau * * * having custody of the document * * * or other thing and the adverse party” (emphasis added).
Obviously, the subpoenas duces tecum directed to the four governmental agencies were not in compliance with CPLR 2307, as no motion on notice to the appropriate agency or the opposite party was made.
*456A motion to quash brought pursuant to CPLR 23043 is the exclusive vehicle to challenge the validity of a subpoena duces tecum (Matter of Brunswick Hosp. Ctr. v Hynes, 52 NY2d 333; Ayubo v Eastman Kodak Co., 158 AD2d 641; Matter of Shankman v Axelrod, 137 AD2d 255, affd 73 NY2d 203) upon this procedural ground (see, Matter of Office of Special State Prosecutor, 51 AD2d 1013) or any other relevant ground (see, e.g., People v Still, 48 AD2d 366). Such motion could be instituted by the governmental agency (see, Matter of Greater Buffalo Ch., Am. Red Cross v State Div. of Human Rights, 118 AD2d 288; Matter of State of New York — Off. of Mental Retardation & Dev. Disabilities v Mastracci, 77 AD2d 473), the prosecutor (see, Morgenthau v Young, 204 AD2d 118) or the defendant (see, Ateni Mar. Corp. v Great Mar., 225 AD2d 573; Matter of Moskowitz v Hynes, 48 AD2d 804).4 In this case no agency made such a motion to quash, and the failure to do so constituted a waiver of any objection (Matter of Brunswick Hosp. Ctr. v Hynes, supra; People v Pastore, 50 AD2d 1088; see, People v Burnette, 160 Misc 2d 1005).
This hybrid type of subpoena duces tecum, which obtained this court’s sanction pursuant to CPLR 2302 (b), but which avoided the motion notice to the governmental agency- and adverse party in contravention of CPLR 2307, probably evolved, because almost never is there a motion to quash based upon improper procedure, and the subpoenaed agency and adverse party assume that insisting on the appropriate procedure would not alter the end result.
Here, although there is no motion to quash any subpoena duces tecum, each governmental agency reacted differently.
The Department of Corrections complied with the subpoena duces tecum and presented the defendant’s medical records to the court. Thereafter, counsel for that Department telephoned the court to advise that it objected to the dissemination of any information to the prosecutor based upon the prohibition of section 2782 (1) of the Public Health Law relating to the disclosure of HIV information.
*457The prosecutor was seeking only evidence connecting the defendant with chlamydia, since the alleged victims had contracted that disease, and this might be probative on the issue of sexual contact (see, People v Williams, 176 AD2d 371, lv denied 79 NY2d 866). The court examined the subpoenaed medical records in camera (see, Mahoney v Staffa, 168 AD2d 809) and ascertained that the defendant had requested an examination for chlamydia on two occasions from medical personnel at the correctional facility. It was determined that this portion of the records, while not relevant to the prosecutor’s theory, might be interpreted as consciousness of guilt (see, People v Bull, 218 AD2d 663, lv denied 87 NY2d 899),5 and it did not violate the physician-patient privilege (see, People v Toure, 137 Misc 2d 1066, affd 180 AD2d 1013, lv denied 79 NY2d 1008).
Out of concern for a possible violation of the physician-patient privilege (see, Matter of County of Westchester v People, 122 AD2d 1), this material was first shown to the defendant’s attorney, and after his objections were heard, it was forwarded to the prosecutor.
The subpoena duces tecum was issued to Family Court with some reluctance upon the assumption that those records were confidential.6 However, section 166 of the Family Court Act protects Family Court records from "indiscriminate public inspection” but allows the court in its discretion to permit such inspection. Section 50-b of the Civil Rights Law prohibits the disclosure of information concerning the victim of a sex offense, but also allows disclosure upon the court’s finding of "good cause”, upon notice to the victim or the person legally responsible for such victim as well as the prosecutor.
A defendant is entitled to have a court in a criminal action conduct an in camera examination of the Family Court records in order to determine whether they contain information pertinent to a defendant’s defense by way of impeachment material in the form of prior inconsistent statements (People v Harder, 146 AD2d 286, affd 153 AD2d 976). This court was erroneously prepared to hold such an in camera proceeding in *458accordance with that holding, although there had been no compliance with the notice provisions of section 50-b of the Civil Rights Law, but it was advised by Family Court that there were no such records.
The Department of Social Services responded to the subpoena duces tecum. The counsel for that Department attached a letter to the subpoenaed materials requesting an in camera inspection of the same and pointing out that they were classified as confidential under section 136 (2) of the Social Services Law. That section provides in pertinent part as follows: "All communications and information relating to a person receiving * * * care obtained by any social services * * * employee in the course of his work shall be considered confidential”.
Citing People v Rosario (9 NY2d 286, 289, rearg denied 9 NY2d 908, cert denied 368 US 866), and its caveat that the statement contain "nothing that must be kept confidential”, one trial court refused to allow a defendant in a criminal proceeding to inspect records subpoenaed from the Department of Social Services for possible impeachment purposes because of the confidentiality imposed by that statute (People v Graydon, 70 Misc 2d 336). However, an appellate court allowed a defendant in a paternity action to subpoena such records from which he sought to show prior inconsistent statements made by the mother relative to paternity, after Family Court reviewed the records in camera, because disclosure in such situations is restricted but not prohibited (Addie W. v Charles U., 44 AD2d 727). This appellate decision obviously was viewed as controlling.
Here, again, no notice to the mother of the alleged victims or prosecutor was given, as mandated by the said section 50-b of the Civil Rights Law. Nevertheless, this court did improperly examine the records of that Department in camera and found them to contain some Rosario material (People v Rosario, supra) in the form of prior inconsistent statements by the alleged female victim. The prosecutor was not obligated to submit this information to the defendant, because it was not under the control of the People (see, People v Kelly, 88 NY2d 248), although it was accessible through the process of a subpoena duces tecum (see, People v Harder, supra). The possible use to be made of such impeachment material was not the responsibility of the court (People v Nelson, 188 AD2d 67, appeal withdrawn 81 NY2d 974).
This Rosario material was made available to the defendant. However, in fairness to the People, the samé material was also *459submitted to the prosecutor. The reason for this was that in the normal Rosario situation, the prosecutor would be aware of such information.
The Rochester Mental Health Center likewise responded to the subpoena duces tecum. Its counsel affixed a letter complaining that there was no compliance with CPLR 2307, that the relationship between the defendant and the patient was not disclosed, that there was no indication of the reason for which the information was sought, and that there was a conflict between the dates of treatment in the subpoena and the actual dates of treatment. The letter concluded that the court should inspect the records in camera due to the classification of the records as confidential in section 33.13 of the Mental Hygiene Law.
The pertinent part of section 33.13 (c) provides as follows:
"Such information about patients * * * reported to the offices, including the * * * clinical records or clinical information * * * shall not be released by * * * its facilities to any person * * * except as follows:
"1. pursuant to an order of a court of record requiring disclosure upon a finding by the court that the interests of justice significantly outweigh the need for confidentiality”.
This court inspected these records in camera also, and discovered that the mental condition of the alleged female victim in the subpoenaed records did qualify as impeachment material. A defendant in a proper case, as where a witness had a lengthy history of psychiatric problems, may be entitled to a witness’ psychiatric records (People v Reusing, 14 NY2d 210; People v Knowell, 127 AD2d 794), but he is not entitled to unrestricted access where the defense will be afforded the opportunity to show the testimonial capacity of the witness may be affected by a mental condition (People v Arnold, 177 AD2d 633, lv denied 79 NY2d 853).
In this case, these factors were influential: the defendant was already cognizant of the alleged female victim’s mental problems and would be able to cross-examine her in this regard (see, People v Arnold, supra), this court would have to determine the testimonial capacity of the 11-year-old female prior to her testifying (CPL 60.20; see, People v Diaz, 172 AD2d 389, lv denied 78 NY2d 1075), her testimony in court at a jury trial would effect enough of an emotional trauma on her (see, People v Watt, 84 NY2d 948) and the incident which was the subject of the indictment was purportedly the origin of her mental *460problems, so her mental capacity at the time in question was not affected (see, People v Westfall, 95 AD2d 581).
Thus, it was determined that this is a situation where the need for confidentiality is not significantly outweighed by the interest of justice (see, People v Reidout, 140 Misc 2d 632), and the records were not disclosed to the defendant.
This court will continue to defer to the local custom and sign the "So Ordered” part of the subpoena duces tecum issued to a governmental agency for confidential records, provided such records are returnable to the court for an in camera review.7 This will enable the court to protect the subject of the confidential records to the extent necessary, while the appropriate agency can move to quash if it deems such action is required. In a situation where this court foresees a significant objection, it may direct that the adverse party be advised of the issuance of such subpoena.
. Each subpoena read "Judicial Subpoena Duces Tecum,” but was in the form of an attorney’s subpoena and had typed in a "So Ordered” clause to which this Judge affixed his signature.
. The Practice Commentaries to CPLR 2307 assert that the court’s only-function on the return date of the motion pursuant to CPLR 2307 is to decide whether to order the original or a copy produced, but they suggest that in the interest of judicial economy the court consider all possible challenges and not demand a subsequent motion to quash (Siegel, Practice Commentaries, McKinney’s Cons Laws of NY, Book 7B, CPLR C2307:l, at 318-321).
. This assumes that a party somehow received notice of the issuance of a subpoena duces tecum.
. This case actually held that such evidence was admissible on the part of the defendant as indicative of non-guilt; so each side could argue its respective version at trial.
. The case law permits a prosecutor to obtain a defendant’s record of a juvenile delinquency adjudication by judicial subpoena to impeach his credibility (People v Brailsford, 106 AD2d 648; see, People v Johnson, 218 AD2d 815, lv denied 87 NY2d 847; People v Davis, 86 AD2d 956).
. The Practice Commentaries to CPLR 2307 advocate that this section be integrated into CPLR 2306, which provides for the issuance of a subpoena duces tecum for medical records to a governmental agency without court order; our local practice represents an acceptable compromise (Siegel, Practice Commentaries, McKinney’s Cons Laws of NY, Book 7B, CPLR C2307:l, at 320).