shared/mimicry_db/diagnosis.py
def summarize_by_icd9_code(klass, icd9_code):
        """ For a given icd9 code, return the number of admissions and patients
        diagnosed with this code """
        
        num_patients = session.query(klass.subject_id).filter(
                klass.icd9_code==icd9_code).distinct().count()
        num_admissions = session.query(klass.hadm_id).filter(
                klass.icd9_code==icd9_code).distinct().count()
        
        return num_patients, num_admissions
 For a given icd9 code, return the number of admissions and patients
        diagnosed with this code 
For a given icd9 code, return the number of admissions and patients
diagnosed with this code
For a given icd9 code return the number of admissions and patients diagnosed with this code
def summarize_by_icd9_code(klass, icd9_code):
        num_patients = session.query(klass.subject_id).filter(
                klass.icd9_code==icd9_code).distinct().count()
        num_admissions = session.query(klass.hadm_id).filter(
                klass.icd9_code==icd9_code).distinct().count()
        return num_patients, num_admissions
def summarize_by_icd9_code ( klass , icd9_code ) : num_patients = session . query ( klass . subject_id ) . filter ( klass . icd9_code == icd9_code ) . distinct ( ) . count ( ) num_admissions = session . query ( klass . hadm_id ) . filter ( klass . icd9_code == icd9_code ) . distinct ( ) . count ( ) return num_patients , num_admissions
For a given icd9 code, return the number of admissions and patients
diagnosed with this code
For a given icd9 code return the number of admissions and patients diagnosed with this code
""" For a given icd9 code, return the number of admissions and patients
        diagnosed with this code """
klass
icd9_code