คำนวณความน่าจะเป็นในการรอดชีวิตหนึ่งปีในผู้ป่วยที่ได้รับยา midodrine hcl 5 มก. po หลังจากได้รับการวินิจฉัยว่ามีกระดูกใบหน้าหัก - จมูกหัก ไม่จำเป็นที่จะต้องใช้ตารางทั้งหมด
calculate the one year survival probability among the patients who were prescribed midodrine hcl 5 mg po tabs after they were diagnosed with facial bone fracture - nasal fracture.It is not neccessary to use all the tables.
 allergy:  allergyid [ number]  patientunitstayid [ number]  drugname [ text]  allergyname [ text]  allergytime [ time] 
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'facial bone fracture - nasal fracture' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'midodrine hcl 5 mg po tabs') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid