instruction: how many patients were prescribed milk of magnesia within the same hospital visit after their ins nondrug elut cor st, until 4 years ago?
response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins nondrug elut cor st') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'milk of magnesia' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id