Changes between Version 8 and Version 9 of Onyx to CiviCRM


Ignore:
Timestamp:
12/12/13 15:30:59 (11 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Onyx to CiviCRM

    v8 v9  
    6565    , p.enrollment_id AS UhlSystemNumber
    6666    , consent_q1.value AS consent_q1
     67    , consent_q1.value AS consent_q2
     68    , consent_q1.value AS consent_q3
     69    , consent_q1.value AS consent_q4
     70    , consent_q1.value AS consent_q5
    6771FROM participant p
    6872LEFT JOIN (
     
    7680    WHERE qa.question_name = 'consent_q1'
    7781    ) consent_q1 ON consent_q1.participant_id = p.id
     82LEFT 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
     92LEFT 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
     102LEFT 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
     112LEFT 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
    78122;
    79123