ยาที่จ่ายให้กับผู้ป่วย 004-64091 ในวันเดียวกันหลังจากเข้ารับการใส่สายสวนหลอดเลือดแดงปอดในการเยี่ยมโรงพยาบาลครั้งนี้ ชื่ออะไร? ไม่จำเป็นที่จะต้องใช้โต๊ะทั้งหมด
what was the name of the drug prescribed for patient 004-64091 in the same day after having received a pulmonary artery catheter placement procedure on the current hospital visit?It is not neccessary to use all the tables.
 medication:  medicationid [ number]  patientunitstayid [ number]  drugname [ text]  dosage [ text]  routeadmin [ text]  drugstarttime [ time]  drugstoptime [ time] 
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091' AND patient.hospitaldischargetime IS NULL) AND treatment.treatmentname = 'pulmonary artery catheter placement') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091' AND patient.hospitaldischargetime IS NULL)) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.drugstarttime AND DATETIME(t1.treatmenttime, 'start of day') = DATETIME(t2.drugstarttime, 'start of day')