(b) Issuance by court. A subpoena to compel production of an original record or document where a certified transcript or copy is admissible in evidence, or to compel attendance of any person confined in a penitentiary or jail, shall be issued by the court. Unless the court orders otherwise, a motion for such subpoena shall be made on at least one day's notice to the person having custody of the record, document or person confined. A subpoena to produce a prisoner so confined shall be issued by a judge to whom a petition for habeas corpus could be made under subdivision (b) of section seven thousand two of this chapter or a judge of the court of claims, if the matter is pending before the court of claims, or a judge of the surrogate's court, if the matter is pending before the surrogate's court, or a judge or support magistrate of the family court, if the matter is pending before the family court, or a judge of the New York city civil court, if the matter is pending before the New York city civil court and it has been removed thereto from the supreme court pursuant to subdivision (d) of section three hundred twenty-five of this chapter. In the absence of an authorization by a patient, a trial subpoena duces tecum for the patient's medical records may only be issued by a court.