Add ActiveMedicationsOn table function
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