มีผู้ป่วยกี่รายที่ได้รับยาโคซินโทรปินในระหว่างการเข้ารับการรักษาในโรงพยาบาลเดียวกันหลังการตรวจหลอดเลือดดำ ไม่จำเป็นต้องใช้ตารางทั้งหมด
how many patients were prescribed cosyntropin during the same hospital encounter after venous cath nec?It is not neccessary to use all the tables.
 inputevents_cv:  row_id [ number]  subject_id [ number]  hadm_id [ number]  icustay_id [ number]  charttime [ time]  itemid [ number]  amount [ number] 
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 = 'venous cath nec')) 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 = 'cosyntropin') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id