
254 Cal.App.2d 506 (1967)
STANFORD W. ASCHERMAN, Petitioner,
v.
THE SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO, Respondent; EDWARD SHEV et al., Real Parties in Interest.
Civ. No. 24529. 
California Court of Appeals. First Dist., Div. Four.  
Sept. 20, 1967.
 Howard Jameson for Petitioner.
 No appearance for Respondent.
 Bledsoe, Smith, Cathcart, Johnson & Rogers and Lawrence E. Curfman III for Real Parties in Interest.
 CHRISTIAN, J.
 Petitioner Ascherman, a physician, is plaintiff in two actions for reinstatement of hospital staff privileges. One case, against the Mount Zion Hospital and Medical Center, is pending in San Francisco. The other, against the Marin Hospital District, is pending in Marin *509 County. The present proceeding tests the propriety of an order of the respondent Superior Court of San Francisco imposing sanctions on Ascherman and his attorneys because of their assertedly unjustified action in subpoenaing two witnesses to appear at the hearing on his motion to compel answers at a deposition. We hold that the imposition of sanctions was erroneous.
 It is asserted in behalf of Ascherman in the San Francisco action that one cause of his dismissal from the staff of Mount Zion Hospital was an accusation made by Shev that Ascherman had solicited surgery from one of Shev's patients at the Mount Zion Hospital, and that when confronted with this fact, Ascherman had offered to split surgical fees with Shev. It does not appear from the record before us that the materiality of that assertion has ever been determined. In any event, Shev refused in his deposition to divulge the name of the patient involved in this alleged incident; he relied upon the physician-patient privilege. Shev did admit that he had discussed the incident with Riede, as counsel for the Marin Hospital District, and William Turner, the hospital administrator.
 At the end of the deposition, Ascherman's attorney, Gonick, indicated that he would move to compel answers. The following exchange occurred regarding arrangements for having the motion heard. Mr. Martin (attorney for one of the defendants): "Dr. Shev doesn't have to be present. This is a Law and Motion matter and you get your decision on the law matter, and set a time agreeable to all of us and Dr. Shev." Mr. Gonick: "Then may it be agreed that when the deposition is adjourned today that it will be understood that it is continued to a date to be set at mutual convenience." Mr. Martin: "Pending the decision of the court." Mr. Gonick: "If the Court rules that he has to answer this question."
 Thereafter, counsel for Ascherman noticed a motion to compel Shev to answer. The motion was supported by a declaration relating that attorney Riede had publicly stated that he had gone through Shev's records and had interviewed eight patients, one of whom might be the patient allegedly solicited by Ascherman. It was asserted that the patient by conferring with Riede had waived the physician-patient privilege.
 Gonick procured from the clerk of the court a subpoena duces tecum directing Shev to bring to the hearing on the motion his records pertaining to male patients hospitalized *510 under his care at Mount Zion during 1959. Another subpoena duces tecum directed Riede to bring his records pertaining to the identity of the eight patients he interviewed and his conversations with them.
 [1] The physician-patient privilege created by Code of Civil Procedure section 1881, subdivision 4, is susceptible of waiver. (City & County of San Francisco v. Superior Court (1951) 37 Cal.2d 227, 233 [231 P.2d 26].) [2] Thus, issues of fact regarding the asserted waiver were tendered by the motion to compel answers, and the court might have determined these issues at the hearing. Evidence other than affidavits and declarations under penalty of perjury may be presented when an issue of fact is to be determined at the hearing of a motion. (Perez v. Perez (1952) 111 Cal.App.2d 827, 828-829 [245 P.2d 344].) Thus far, it does not appear that the subpoenas directed to Shev and Riede were vulnerable to attack, and no motion to quash was made.
 When the motion was called for hearing, counsel for Shev brought to the court's attention the exchange at the deposition hearing which we have set forth above. Counsel then objected to any proceedings on the motion, upon the asserted ground that Shev had been subpoenaed in violation of a stipulation. In response, counsel for Ascherman pointed out the somewhat indefinite character of the "stipulation" and repeatedly attempted to explain to the court that, as had been agreed, Shev had not been subpoenaed for a continuation of the deposition hearing. He was called instead to give evidence on the issues of fact which would need to be determined by the court in ruling upon the claim that privilege had been waived. The judge appears not to have understood this explanation, and unfortunately became angry at what he regarded as overreaching conduct on the part of Ascherman's counsel.
 When it became clear that the court had formed a fixed determination not to allow any examination of Dr. Shev, both counsel joined in suggesting that the hearing continue without that evidence. The judge responded: "I am not going to do that, I am going to discharge these proceedings on the grounds that they were before the Court on a stipulation that was not carried through. Therefore, you will have to notice the motion. The subpoena is discharged and the motion to compel answers is denied without prejudice." [3] It was not proper to impose a refusal to hear a duly noticed motion as a reprisal for conduct which the judge disapproved of. *511
 In compliance with the requirement imposed by the judge, counsel for Ascherman gave notice of a new motion to compel Shev to answer. This motion was supported by a declaration reciting substantially the same facts as before; subpoenas duces tecum were again obtained directing Shev and attorney Riede to appear with their papers. Shev filed a declaration alleging that the patient in question had requested that his identity not be revealed and that Shev had originally discussed the incident with Riede in his capacity as a staff member of the Marin General Hospital and had intended the conversation to be confidential. As argument on the motion began on the day set, counsel for Shev suggested to the court the idea that Ascherman's motive in attempting discovery was to obtain information for use in the Marin County proceedings. Ascherman's counsel countered by asserting that Dr. Rosenman (a co-defendant in the San Francisco action) had in his deposition given as one of his reasons for petitioner's dismissal from the Mount Zion staff the fact that petitioner had solicited patients from other doctors on the staff.
 Counsel for Ascherman again attempted to argue that the patient had waived privilege by discussing the incident with Riede. The judge dismissed this argument, indicating that he thought the attempted discovery was abusive because it was designed to produce information that might be useful in the Marin County action. Due to repeated interruptions by the judge, counsel for Ascherman began confusing the names of the two hospitals and was unable to present his contentions in an intelligible manner.
 At this point, when the atmosphere had already become tense, Shev's attorney reminded the judge that in his view Shev had been subpoenaed to the last hearing contrary to stipulation and observed that this time Ascherman had in addition subpoenaed Riede, counsel for the Marin Hospital, to appear with his records. Without waiting to hear from the moving party, the judge abruptly announced, "As far as I am concerned, he can leave right now." When counsel attempted to make an offer of proof, the judge cut him off, apparently reasoning that because Riede was an attorney involved in related litigation it was improper and harassing to require his attendance.
 Following an implied suggestion by the judge, counsel for Shev then moved for an order imposing sanctions for "flagrant abuse of process" at the two hearings. But the judge *512 declared that he would require a written motion upon 10 days' notice.
 Such a motion was noticed in behalf of Shev and attorney Riede. The motion was supported by a declaration reciting: (1) that Dr. Shev had, contrary to stipulation, been subpoenaed to a July 19 hearing and that he had thereby lost approximately three hours from his practice of medicine; (2) that a subpoena duces tecum had been served upon Harold Riede, counsel for the Marin Hospital District, and that petitioner had thereby endeavored to require Riede to divulge matters within the attorney-client privilege and turn over papers which were his work product in the Marin action. The declaration further recites that Harold Riede lost at least three hours from the practice of law, and that it would be proper to require petitioner to pay Dr. Shev $100, Harold Riede $100 and the law firm of Bledsoe, Smith, Cathcart, Johnson and Rogers $250 for their services in opposing the motions to compel Shev to answer. An accompanying memorandum of points and authorities cited Code of Civil Procedure section 2034, subdivision (a), as authority for an order imposing the sanctions.
 The motion to impose sanctions was opposed upon the grounds that it had never been stipulated that Shev would not be subpoenaed to appear at the hearing of the motion to compel answers and "That the testimony of Dr. Shev and Mr. Riede was relevant and necessary to establish a waiver by the patient of the physician-patient privilege relied upon by Dr. Shev. ..." It was also contended that the court lacked jurisdiction to entertain a motion for sanctions brought independently by persons not parties to the action. After a hearing at which new counsel appeared for Ascherman and clearly outlined again the basis upon which the subpoenas had been obtained, the court made an order against Ascherman and his attorneys, awarding Shev and Riede $100 each. Their attorney was awarded a further $150. The court made a finding that the motion to compel Shev to answer and the subpoenaing of Shev to both hearings were without substantial justification. There was no finding that Riede was subpoenaed without justification.
 The court's power to impose sanctions in connection with discovery proceedings rests exclusively upon statutory grants of authority. This controversy is governed by Code of Civil Procedure section 2034, subdivision (a), which provides in part as follows: "If a party or other deponent refuses to answer any question propounded upon examination during *513 the taking of a deposition, or refuses to produce at a deposition any books, documents or other things under his control pursuant to a subpoena duces tecum, the examination shall be completed on other matters or adjourned. ... Such proponent, on reasonable notice to all persons affected thereby, may apply to the court in which the action is pending ... for an order [compelling discovery] ... If the motion is denied and if the court finds that the motion was made without substantial justification, the court may require the examining party or the attorney advising the motion or both of them to pay to the refusing party or witness the amount of the reasonable expenses incurred in opposing the motion including reasonable attorney's fees." (Italics added.)
 [4] Ascherman's first contention is that sanctions can only be imposed at the hearing at which the motion to compel answers is denied. He points to the general rule that a court is without jurisdiction to entertain a motion made by a stranger to the action (Difani v. Riverside County Oil Co. (1927) 201 Cal. 210, 214 [256 P. 210]; Marshank v. Superior Court (1960) 180 Cal.App.2d 602, 605 [4 Cal.Rptr. 593]) and argues that since respondent court made its order upon a separate, specially noticed motion, the two nonparty witnesses could take no benefit from it. This contention is without merit. Code of Civil Procedure section 2034, subdivision (a), explicitly provides that the order imposing sanctions may be in favor of a "witness." The statute does not require either that the order for sanctions be made upon an immediate oral motion or that it be done upon a specially noticed motion as the judge required in this case. We conclude that either procedure would be permissible; there is no indication that the Legislature intended to prevent the judge hearing the motion to compel answers from using his own sound discretion in that regard, based on a knowledge of the condition of the court's calendar and an appreciation of the matters at issue in the case before it.
 [5] Ascherman next contends that the order for sanctions exceeded the court's jurisdiction in that the powers vested in the court by Code of Civil Procedure section 2034, subdivision (a), do not extend to punishment for the issuance of process to compel the appearance of a witness in court. We consider first the award made to attorney Riede. It is void upon two independent grounds. First, the court made no finding that the "motion [to compel discovery] was made without substantial *514 justification" and could not have made any such finding where the judge had arbitrarily refused to hear counsel's offer of proof. Second, Riede was not a witness whose responses were sought to be compelled by the motion; he had been subpoenaed to appear in court as a witness on the preliminary issue of waiver of the physician-patient privilege which had been tendered by the motion to compel answers. The statute affords no authority for sanctions of any kind in favor of a witness so summoned. Hence, Riede was ineligible to receive an award of sanctions. He could have attacked the subpoena by moving to quash or vacate it (see Wemyss v. Superior Court (1952) 38 Cal.2d 616, 618 [214 P.2d 525]) but did not choose to do so. Although Code of Civil Procedure section 1209, subdivision 4, affords a procedure for punishment of an abuse of the court's process as a contempt, no attempt was made to follow contempt procedures.
 [6a] Neither of the foregoing defects is seen in the award of sanctions in favor of Shev. The order was supported by a finding as follows: "the Court hereby finds that the plaintiff Stanford W. Ascherman's motion to compel Dr. Shev to answer questions on deposition and plaintiff's subpoening [sic] Dr. Shev to the hearing of this Court held on July 30, 1965, were all without substantial justification. ..." The order was directed in favor of an eligible person, as it was Shev's answers which Ascherman sought to compel. A potentially valid ground for denial of the motion and perhaps for the imposition of sanctions appears in that the moving party had failed to meet the requirement of Code of Civil Procedure section 2034, subdivision (a), that "Not less than five days prior to the hearing on any such motion, the proponent must lodge with the court the original transcript of such deposition. ..." However, the court did not base its action on that ground and the record does not definitely establish the circumstances in this regard.
 [7] The purpose of Code of Civil Procedure section 2034, subdivision (a), is to compensate a witness for having to defend against a motion to compel answers when answers clearly could not be compelled; that is, where the matter is clearly privileged or not relevant to the subject matter of the pending action. (Code Civ. Proc.,  2016, subd. (b).) It has been pointed out that " ' "No precise or universal test of relevancy is furnished by the law" ' " and that " ' "The question must be determined in each case according to the teachings of reason and judicial experience." ...' " (The *515 Morris Stulsaft Foundation v. Superior Court (1966) 245 Cal.App.2d 409, 416 [54 Cal.Rptr. 12]; Regents of University of California v. Superior Court (1962) 200 Cal.App.2d 787, 794 [19 Cal.Rptr. 568].) [8] But there can be no question of the potential relevancy of the information sought to be elicited here. The subject matter of the action clearly encompasses questions relating to the professional ethics of Ascherman. Shev testified that a patient at Mt. Zion Hospital told him that Ascherman had solicited employment as a surgeon. Such solicitation is contrary to medical ethics. Ascherman seeks to learn the name of the patient who charged him with soliciting. Shev knows the patient's name and could, at any time during the trial, cause him to be called to testify. Without the benefit of discovery, Ascherman would be unable to prepare a response to that possible testimony. This type of surprise at trial is one of the abuses which discovery was designed to eliminate. (Greyhound Corp. v. Superior Court (1961) 56 Cal.2d 355, 376 [15 Cal.Rptr. 90, 364 P.2d 266]; Brown v. Superior Court (1963) 218 Cal.App.2d 430, 436 [32 Cal.Rptr. 527].) Discovery of the name of the patient is also pertinent if Ascherman is to meet the expected testimony of Shev regarding the solicitation of the patient and the claimed subsequent offer to split fees.
 At the deposition, Shev's objection to the question relating to the identity of the patient was an assertion of the physician-patient privilege. At the time of the 1965 hearing, section 1881, subdivision 4, of the Code of Civil Procedure provided in pertinent part: "A licensed physician or surgeon cannot, without the consent of his patient, be examined in a civil action, as to any information acquired in attending the patient, which was necessary to enable him to prescribe or act for the patient; ..."  [fn. 1]
 [9] "All matters which are privileged against disclosure upon the trial under the law of this state are privileged against disclosure through any discovery procedure." (Code Civ. Proc.,  2016, subd. (b).) [10] "The whole purpose of the privilege is to preclude the humiliation of the patient that might follow disclosure of his ailments.' " (San Francisco Unified School Dist. v. Superior Court (1961) 55 Cal.2d 451, 454 [11 Cal.Rptr. 373, 359 P.2d 925, 82 A.L.R.2d 1156]; City & County of San Francisco v. Superior Court, supra, 37 Cal.2d 227, 232.) [11] The communication involved here *516 has no relation to treatment by the physician or, indeed, to the ailment of the patient. A physician need not know the name of the patient in order to treat him, and any unethical solicitation by an interloper is quite unrelated to information communicated to enable the physician to "prescribe or act for the patient." Thus, the communication here presented is not privileged.
 We distinguish Costa v. Regents of University of California (1953) 116 Cal.App.2d 445, 463-464 [254 P.2d 85], where the trial court was upheld in sustaining an objection to a request for the name of a patient on the grounds that "the name was immaterial and would violate the confidence between the physician and said patient." In that case the physician, a defendant in a malpractice action, was asked to name another of his patients who had suffered injury as a result of treatment similar to that administered to the plaintiff in the action. Since the connecting factor between the patient whose identity was sought and the action before the court was the patient's ailments and the physician's treatment, the information sought was within the policy of the privilege. (Also see 8 Wigmore, Evidence (McNaughton rev. 1961)  2384, p. 846, and cases cited in fn. 2, declaring the general rule that the mere fact of a medical consultation is not privileged.)
 [12] Even if sanctions had been proper to compensate Shev for his appearance where the disclosure of privileged information is sought, they should not be imposed where there is a good faith attempt to show a waiver of the privilege.
 [6b] We have concluded that the record does not support the court's finding that the motion to compel answers was without substantial justification. A writ of prohibition will issue, restraining enforcement of the order for sanctions.
 Devine, P. J., and Rattigan, J., concurred.
NOTES
[fn. 1]  1. Evidence Code section 994, effective January 1, 1967, has supplanted this section.
