Thank you for your question about STK-5 “Antithrombotic Therapy By End of Hospital Day 2.” You are correct, you should use the physical departure of the patient from ED rather than the Order for Inpatient services. “Encounter, Performed” is used in the STK-5 logic that you referenced.
EDVisit: Last(["Encounter, Performed": "Emergency Department Visit"] LastED
It may be helpful to refer to the Quality Data Model (QDM) for “Encounter, Performed”. QDM version 5.5 is used for 2020 and 2021 discharges and it is available here:
https://ecqi.healthit.gov/sites/default/files/2019-07/QDM_v5_5_errata_vFinal_May2019_508.pdf
Pages 8-9 provide this explanation of “Encounter, Performed”, which is used in STK-5 in the logic that you referenced.
“By convention, an Encounter, Performed start and stop times reference the admission and discharge times. These times are referenced by periods (the interval between start and stoptimes).”