Skip to content

Add ActiveMedicationsOn table function

Hubbell, Harrison Taylor requested to merge hh_active_med_on into main

This is a rather old branch with a table function that returns the medications on a patient's active medication list as of a given date.

For example:

select ...
from Epic.Encounter.PatientEncounterHospital_Enterprise peh
    cross apply (
        select *
        from UserWork.EAViewLibrary.MedicationActiveMedicationsOn(peh.HospitalAdmitDTS) med
        where peh.PatientID = med.PatientID
    ) rx

Merge request reports