Important Content Update Message
We are currently updating the OP Help Center content for the release of OP 20. OP 20 (official version 20.0.x) is the certified, 2015 Edition, version of the Office Practicum software. This is displayed in your software (Help tab > About) and in the Help Center tab labeled Version 20.0. We appreciate your patience as we continue to update all of our content.

SQL: Nurse Vaccine Productivity

About

This SQL is intended to indicate who the vaccinator was for all the shots given in your office during a selected date range.

A sample image of this SQL report run in the Database Viewer is shown below:

Caveats

"Vaccinator" is defined as the staff member that appears in the S_ADDR_ID.  Most practices use this as "who actually poked the kid.”  If your practice enters “ordering doc” here instead, you’ll receive different results.

"Number of kids who got vaccinated" is different than  "number of separate sticks" because Bertha might give 4 flu shots, one to each of 4 kids, and Wanda might give 4 vaccines to 1 baby.

Code

To highlight and copy the code below to your clipboard, simply click the Copy button.

select  date_given,count(patno) as kids, sum(shots) as sticks, vaccinator from
(

select patno, date_given, count(vaccine) as shots, vaccinator from
(
select patno, vacdate as date_given,vacname as vaccine,  staff2.staffname as vaccinator
from vaccine1
inner join staff1 staff2 on staff2.staffid = vaccine1.s_addr_id
inner join vac_inventory on vac_inventory.uniqkey = vaccine1.vac_lot_id
where vacdate between :start_date and :end_date and vaccine1.vfc1 <> 9
)
group by patno, date_given, vaccinator
order by date_given
) group by date_given, vaccinator