Changes between Version 2 and Version 3 of DataIntegration GRAPHIC2 CiviCRM to i2b2
- Timestamp:
- 10/01/13 13:04:57 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DataIntegration GRAPHIC2 CiviCRM to i2b2
v2 v3 21 21 , cids.nhs_number_1 nhs_number 22 22 , cids.uhl_s_number_2 uhl_s_number 23 , grd.genvasc_id_10 genvasc_id 24 , grd.genvasc_consent_q1_11 consent_1 25 , grd.genvasc_consent_q2_12 consent_2 26 , grd.genvasc_consent_q3_13 consent_3 27 , grd.genvasc_consent_q4_14 consent_4 28 , grd.genvasc_consent_q5_15 consent_5 29 , grd.genvasc_consent_q6_16 consent_6 30 , grd.genvasc_consent_q7_17 consent_7 23 , g2d.* 31 24 , recruit.birth_date 32 25 , enrollment.start_date enrollment_date 33 , CASE26 /* , CASE 34 27 WHEN (wstatus.withdrawal_status_24 = 'A') THEN enrollment.end_date 35 END withdrawal_date 28 END withdrawal_date */ 36 29 FROM civicrm_contact recruit 37 30 JOIN civicrm_case_contact enrollcontact ON enrollcontact.contact_id = recruit.id 38 31 JOIN civicrm_case enrollment ON enrollment.id = enrollcontact.case_id 39 AND enrollment.start_date < DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) 40 AND enrollment.status_id NOT IN (699 /* declined */, 701 /* excluded */) 41 AND enrollment.case_type_id = "3" /* GENVASC */ 32 AND enrollment.status_id NOT IN (7 /* declined */, 9 /* excluded */, 4 /* Recruitment Pending */) 33 AND enrollment.case_type_id = "5" /* Graphic 2 */ 42 34 AND enrollment.is_deleted = 0 43 JOIN civicrm_value_contact_ids_2 cids ON cids.entity_id = recruit.id 44 JOIN civicrm_value_g envasc_recruitment_data_6 grd ON grd.entity_id = enrollment.id45 LEFT JOIN civicrm_value_genvasc_withdrawal_status_9 wstatus ON wstatus.entity_id = enrollment.id 35 JOIN civicrm_value_contact_ids_2 cids ON cids.entity_id = recruit.id /* Is this the case? */ 36 JOIN civicrm_value_graphic2_10 g2d ON g2d.entity_id = enrollment.id /* CHECK THIS */ 37 /* MAYBE: LEFT JOIN civicrm_value_genvasc_withdrawal_status_9 wstatus ON wstatus.entity_id = enrollment.id */ 46 38 WHERE recruit.is_deleted = 0 47 AND COALESCE(wstatus.withdrawal_status_24, '') <> 'B' 48 AND EXISTS ( SELECT 1 49 FROM civicrm_relationship rel 50 WHERE rel.contact_id_a = recruit.id 51 AND rel.relationship_type_id = 15 /* with GP surgery */ 52 ) 39 /* AND COALESCE(wstatus.withdrawal_status_24, '') <> 'B' */ 53 40 ; 54 41