Add a flag to cohort table indicating if the patient has an active MyChrat account or not.
Use this code
SELECT DISTINCT pat.PAT_ID
case when mp.pat_id is not null then ''Yes'' else null end as active_mychart
FROM patient pat
left join clarity.myc_patient mp on p.pat_id = mp.pat_id
and (mp.status_cat_c is null or mp.status_cat_c = 1);
Add a flag to cohort table indicating if the patient has an active MyChrat account or not. Use this code