instruction: count the number of patients whose primary disease is chest pain and lab test category is blood gas?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND lab."CATEGORY" = "Blood Gas"