ชื่อยาที่จ่ายให้กับผู้ป่วย 12938 ภายใน 2 วันหลังจากได้รับการวินิจฉัยว่าเป็นมะเร็งชนิด hx of gi ในปี 03/ปีที่แล้วคืออะไร? ไม่จำเป็นต้องใช้ตารางทั้งหมด
what is the name of the drug that was prescribed to patient 12938 within 2 days after having been diagnosed with a hx of gi malignancy nec in 03/last year?It is not neccessary to use all the tables.
 cost:  row_id [ number]  subject_id [ number]  hadm_id [ number]  event_type [ text]  event_id [ number]  chargetime [ time]  cost [ number] 
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 12938 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of gi malignancy nec') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', diagnoses_icd.charttime) = '03') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 12938 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '03') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')