instruction: how many patients discharged to short term hospital have procedure icd9 code 640?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.icd9_code = "640"