Cal. Penal Code § 1543
(a) Records of the identity, diagnosis, prognosis, or treatment of any patient maintained by a health care facility which are not privileged records required to be secured by the special master procedure in Section 1524, or records required by law to be confidential, shall only be disclosed to law enforcement agencies pursuant to this section:
(2) If authorized by an appropriate order of a court of competent jurisdiction in the county where the records are located, granted after application showing good cause therefor. In assessing good cause, the court:
(d) Both disclosure and dissemination of any information from the records shall be limited under the terms of the order to assure that no information will be unnecessarily disclosed and that dissemination will be no wider than necessary.
This chapter shall not apply to investigations of fraud in the provision or receipt of Medi-Cal benefits, investigations of insurance fraud performed by the Department of Insurance or the California Highway Patrol, investigations of workers’ compensation insurance fraud performed by the Department of Corrections and conducted by peace officers specified in paragraph (2) of subdivision (d) of Section 830.2, and investigations and research regarding occupational health and safety performed by or under agreement with the Department of Industrial Relations. Access to medical records in these investigations shall be governed by all laws in effect at the time access is sought.