| | 82 | LEFT JOIN ( |
| | 83 | SELECT |
| | 84 | qp.participant_id |
| | 85 | , ca.category_name AS value |
| | 86 | FROM question_answer qa |
| | 87 | JOIN category_answer ca ON ca.question_answer_id = qa.id |
| | 88 | JOIN questionnaire_participant qp ON qp.id = qa.questionnaire_participant_id |
| | 89 | AND qp.questionnaire_name = 'ManualConsentQuestionnaire' |
| | 90 | WHERE qa.question_name = 'consent_q2' |
| | 91 | ) consent_q2 ON consent_q2.participant_id = p.id |
| | 92 | LEFT JOIN ( |
| | 93 | SELECT |
| | 94 | qp.participant_id |
| | 95 | , ca.category_name AS value |
| | 96 | FROM question_answer qa |
| | 97 | JOIN category_answer ca ON ca.question_answer_id = qa.id |
| | 98 | JOIN questionnaire_participant qp ON qp.id = qa.questionnaire_participant_id |
| | 99 | AND qp.questionnaire_name = 'ManualConsentQuestionnaire' |
| | 100 | WHERE qa.question_name = 'consent_q3' |
| | 101 | ) consent_q3 ON consent_q3.participant_id = p.id |
| | 102 | LEFT JOIN ( |
| | 103 | SELECT |
| | 104 | qp.participant_id |
| | 105 | , ca.category_name AS value |
| | 106 | FROM question_answer qa |
| | 107 | JOIN category_answer ca ON ca.question_answer_id = qa.id |
| | 108 | JOIN questionnaire_participant qp ON qp.id = qa.questionnaire_participant_id |
| | 109 | AND qp.questionnaire_name = 'ManualConsentQuestionnaire' |
| | 110 | WHERE qa.question_name = 'consent_q4' |
| | 111 | ) consent_q4 ON consent_q4.participant_id = p.id |
| | 112 | LEFT JOIN ( |
| | 113 | SELECT |
| | 114 | qp.participant_id |
| | 115 | , ca.category_name AS value |
| | 116 | FROM question_answer qa |
| | 117 | JOIN category_answer ca ON ca.question_answer_id = qa.id |
| | 118 | JOIN questionnaire_participant qp ON qp.id = qa.questionnaire_participant_id |
| | 119 | AND qp.questionnaire_name = 'ManualConsentQuestionnaire' |
| | 120 | WHERE qa.question_name = 'consent_q5' |
| | 121 | ) consent_q5 ON consent_q5.participant_id = p.id |