Fix mapping of patient_trial
Fix n+1 query