SELECT Event.Event_ID, Event.EventSub_ID, Event.Patient_ID, Event.Employee_ID, Event.who_observed, Event.MD_notified, Event.injury, Event.Event_Date, Event.Memo, Event.Resolved, Event.Record_Created_By, Event.Followup_Desc, Event.Followup_Memo, EventSubjects.EventSub_ID, EventSubjects.Subject, pPatients.Patient_ID, pPatients.Pt_Last, pPatients.Pt_First, pPhysicians.Phys_ID, e1.Emp_Last AS LastName, e1.Emp_First AS FirstName, e1.Emp_Street1, e1.Emp_City, e1.Emp_State, e1.Emp_Zip, e1.Emp_Telephone AS Telephone1, Agency.Agency_ID, Agency.Agency_Name, Agency.Agency_Contact_Phone FROM #Request.prefix_db_agency#.Event JOIN #Request.prefix_db_agency#.pPatients ON Event.Patient_ID = pPatients.Patient_ID AND pPatients.Status IN (0,1,4) JOIN #Request.prefix_db_agency#.EventSubjects ON Event.EventSub_ID = EventSubjects.EventSub_ID JOIN #Request.prefix_db_lookup#.Agency ON Event.Agency_ID = Agency.Agency_ID JOIN #Request.prefix_db_lookup#.pPhysicians ON pPhysicians.Phys_ID = (SELECT Render_Phys_ID FROM #Request.prefix_db_agency#.pAdmit WHERE Patient_ID = pPatients.Patient_ID AND status = 0 ORDER BY pAdmit.M0030_START_CARE_DT DESC LIMIT 1) LEFT OUTER JOIN #Request.prefix_db_lookup#.pEmployee e1 ON pPhysicians.Emp_ID = e1.Emp_ID WHERE Event.Event_ID = #url.ID# AND Event.Agency_ID = #session.AgencyID# ORDER BY Event.Event_Date DESC; SELECT Emp_First AS FIRST, Emp_Last AS LAST FROM #Request.prefix_db_lookup#.pEmployee WHERE Emp_ID = '#GetEvent.Record_Created_By#' AND Emp_Type != 'Physician' SELECT * FROM #Request.prefix_db_lookup#.pEmployee WHERE Emp_ID IN (select Emp_ID from #Request.prefix_db_agency#.Event_to where Event_ID = '#GetEvent.Event_ID#') AND Emp_Type != 'Physician'

Memo regarding #Pt_First# #Pt_Last# from #Agency_Name#

Re: #Subject#

Submitted by: #FIRST# #LAST#
Physician #FirstName# #LastName#
#Emp_Street1#
#Emp_City#, #Emp_State# #Emp_Zip#
#Telephone1#
   
Date #DateFormat(Event_Date,"mm/dd/yyyy")#
Who observed incident? #who_observed#
Was physician notified? #MD_notified#
Was injury sustained? #injury#
Memo #Memo#
Agency Representative #Emp_First# #Emp_Last#
#getEvent.Agency_Contact_Phone#

This memo is for your records.

Memo regarding #Pt_First# #Pt_Last# from #Agency_Name#

Re: #Subject#

Submitted by: #FIRST# #LAST#
Physician #FirstName# #LastName#
#Emp_Street1#
#Emp_City#, #Emp_State# #Emp_Zip#
#Telephone1#
   
Date #DateFormat(Event_Date,"mm/dd/yyyy")#
Who observed incident? #who_observed#
Was physician notified? #MD_notified#
Was injury sustained? #injury#
Memo #Memo#
Agency Representative #Emp_First# #Emp_Last#
#getEvent.Agency_Contact_Phone#

This memo is for your records.