How to track many to many relations using GORM tables


New member
We have a situation where we have many to many relation with patients and hospitals, patient and doctors and doctors and hospitals. We also have a patient_therapist table to figure out the therapists for the patient and user_clinic table to figure out the clinics of therapists and patient.

Now the problem is from a patient_therapist table i got the information that patient A is consulting therapist X and therapist X & patient A are both in clinics W & Y. How can i figure out the therapist and his performing clinic for the patient's case chart ?

Kindly help

Thanking you in advance