Cal. Civ. Proc. Code § 1985.3
(a) For purposes of this section, the following definitions apply:
(b) Prior to the date called for in the subpoena duces tecum for the production of personal records, the subpoenaing party shall serve or cause to be served on the consumer whose records are being sought a copy of the subpoena duces tecum, of the affidavit supporting the issuance of the subpoena, if any, and of the notice described in subdivision (e), and proof of service as indicated in paragraph (1) of subdivision (c). This service shall be made as follows:
(c) Prior to the production of the records, the subpoenaing party shall do either of the following:
(g) Any consumer whose personal records are sought by a subpoena duces tecum and who is a party to the civil action in which this subpoena duces tecum is served may, prior to the date for production, bring a motion under Section 1987.1 to quash or modify the subpoena duces tecum. Notice of the bringing of that motion shall be given to the witness and deposition officer at least five days prior to production. The failure to provide notice to the deposition officer shall not invalidate the motion to quash or modify the subpoena duces tecum but may be raised by the deposition officer as an affirmative defense in any action for liability for improper release of records.
Any other consumer or nonparty whose personal records are sought by a subpoena duces tecum may, prior to the date of production, serve on the subpoenaing party, the witness, and the deposition officer, a written objection that cites the specific grounds on which production of the personal records should be prohibited.
No witness or deposition officer shall be required to produce personal records after receipt of notice that the motion has been brought by a consumer, or after receipt of a written objection from a nonparty consumer, except upon order of the court in which the action is pending or by agreement of the parties, witnesses, and consumers affected.
The party requesting a consumer’s personal records may bring a motion under Section 1987.1 to enforce the subpoena within 20 days of service of the written objection. The motion shall be accompanied by a declaration showing a reasonable and good faith attempt at informal resolution of the dispute between the party requesting the personal records and the consumer or the consumer’s attorney.