About
This report shows all sick and well notes that have not yet been finalized.
A sample image of this SQL report run in the Database Viewer is shown below:
Caveats
- Excludes notes in a chart for a patient whose surname is TESTPATIENT or TEST. You can add additional names to omit by following the same format as TESTPATIENT and TEST appear in the code.
- Does not include notes generated in 2010 or before (OP notes before 2011 used a different structure).
Code
To highlight and copy the code below to your clipboard, simply click the Copy button.
select a.patno, a.date1, fname, lname, staffname from ( select enc_note.patno, p_addr_id, enc_note.date1, enc_note.final_date from enc_note union select physical.patno, p_addr_id, physical.date1, physical.final_date from physical ) a inner join register on a.patno = register.patno inner join staff1 on staff1.staffid = a.p_addr_id where final_date is null and lname not in ('TESTPATIENT','TEST') and date1 >'1/1/2011' order by staffname