ครั้งสุดท้ายที่คนไข้ 025-51835 เข้ารับคำปรึกษาด้านกระดูกเมื่อมาโรงพยาบาลครั้งแรก?ไม่จำเป็นต้องใช้โต๊ะทั้งหมด
when did the last time patient 025-51835 had a orthopedics consultation performed when they visited the hospital first time?It is not neccessary to use all the tables.
 diagnosis:  diagnosisid [ number]  patientunitstayid [ number]  diagnosisname [ text]  diagnosistime [ time]  icd9code [ text] 
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51835' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AND treatment.treatmentname = 'orthopedics consultation' ORDER BY treatment.treatmenttime DESC LIMIT 1