(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.