     WHEN age <= 60 THEN 2
     WHEN age <= 70 THEN 3
     ELSE 4 END AS age_score
-    FROM mimic_derived.age_info
+    FROM `physionet-data.mimic_derived.age_info`
 )
 SELECT 
     ad.subject_id

            SUBSTRING(icd10_code FROM 1 for 3) IN ('B20','B21','B22','B24')
            THEN 1 
            ELSE 0 END) AS aids6 --AIDS/HIV
    FROM mimic_core.admissions ad
    LEFT JOIN diag
    ON ad.hadm_id = diag.hadm_id
    GROUP BY ad.hadm_id

    2*rd2 + 2*mal2 + 3*ld3 + 6*mst6 + 6*aids6 +
    age_score
    AS charlson
FROM `physionet-data.mimic_core.admissions` ad
LEFT JOIN com
ON ad.hadm_id = com.hadm_id
LEFT JOIN ag
