ยาที่จ่ายให้กับผู้ป่วย 99647 ในระหว่างการไปโรงพยาบาลครั้งเดียวกันชื่ออะไร หลังจากได้รับการผ่าตัดเยื่อหุ้มหัวใจตั้งแต่วันที่ 12/2102? ไม่จำเป็นที่จะต้องใช้ตารางทั้งหมด
what was the name of the drug prescribed for patient 99647 during the same hospital visit after having received a pericardiocentesis procedure since 12/2102?It is not neccessary to use all the tables.
 d_icd_diagnoses:  row_id [ number]  icd9_code [ text]  short_title [ text]  long_title [ text] 
SELECT t2.drug 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 admissions.subject_id = 99647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'pericardiocentesis') AND STRFTIME('%y-%m', procedures_icd.charttime) >= '2102-12') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 99647 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-12') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id