https://www.hipaaguide.net/hipaa-subpoena-for-medical-records/#:~:text=A%20HIPAA%20subpoena%20for%20medical%20records%20is%20an,case%20or%20to%20compel%20an%20individual%20to%20testify.
2. Subpoenas issued by attorneys or legal discovery requests
If a valid subpoena is signed by an attorney or a court clerk, HIPAA permits the disclosure of medical records if one of the following three conditions is met:
A written statement and accompanying documentation are received from the person issuing the subpoena demonstrating a good faith attempt was made to provide written notice of the subpoena to the patient or his or her legal representative; the notice included sufficient information to inform the patient that they have the right to object to the subpoena; the time for objecting the subpoena has passed and the patient did not object to the subpoena or an objection was satisfactorily resolved by the court.
A written statement and accompanying documentation are received from the person issuing the subpoena demonstrating all parties to the lawsuit have agreed to a qualified protective order to maintain the confidentiality of the supplied information or that such an order has been requested. The qualified protective order limits the use of the information solely to the lawsuit and requires all information to be destroyed or returned when the lawsuit ends.
The covered entity makes reasonable efforts to notify the patient, stating a response is required by law, and the patient is informed of his/her right to object to the disclosure of their PHI and the patient fails to notify the covered entity that the subpoena has been set aside before the deadline for responding. The covered entity can also object to the subpoena.
A valid HIPAA authorization is obtained from the patient authorizing the covered entity to release his/her medical records and comply with the subpoena. In such cases, the information disclosed must still be limited to the information specifically requested in the subpoena.
Details of these requirements can be found in Title 45 of the Code of Federal Regulations, sections 164.512(c)(1)(ii); (e)(1)(iii)-(vi).