Changes between Version 38 and Version 39 of Onyx to CiviCRM


Ignore:
Timestamp:
01/13/14 09:58:03 (11 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Onyx to CiviCRM

    v38 v39  
    8686    , mra.most_recent_action
    8787    , i.start_date
     88    , CASE
     89        WHEN recruitment_context.episodeType = 'Study_specific' THEN recruitment_context.studyCode
     90        ELSE recruitment_context.episodeType
     91      END recruitmentContext
    8892FROM participant p
    8993JOIN interview i ON i.participant_id = p.id
     
    102106    GROUP BY qp.participant_id
    103107    ) consent ON consent.participant_id = p.id
     108LEFT JOIN (
     109    SELECT
     110          qp.participant_id
     111        , GROUP_CONCAT(if(qa.question_name = 'epi_type', category_name, NULL)) AS episodeType
     112        , GROUP_CONCAT(if(qa.question_name = 'epi_studycode', category_name, NULL)) AS studyCode
     113    FROM question_answer qa
     114    JOIN category_answer ca ON ca.question_answer_id = qa.id
     115    JOIN questionnaire_participant qp ON qp.id = qa.questionnaire_participant_id
     116         AND qp.questionnaire_name = 'RecruitmentContextQuestionnaire'
     117    GROUP BY qp.participant_id
     118    ) recruitment_context ON recruitment_context.participant_id = p.id
    104119LEFT JOIN (
    105120    SELECT