instruction: when was the last time that patient 006-172277 was prescribed a medication via the im route in this hospital encounter?
response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL)) AND medication.routeadmin = 'im' ORDER BY medication.drugstarttime DESC LIMIT 1