instruction: How many patients were admitted to the hospital before the year 2146 with a lab test immunoglobulin A?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "Immunoglobulin A"