instruction: calculate the total number of patients diagnosed with icd9 code 6826 who had abnormal lab test results
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "6826" AND lab.flag = "abnormal"