This report shows all active patients ages 16 and up and lists the number of meningococcal vaccines they have had administered (either by the practice or legacy vaccines).
A sample image of this SQL report run in the Database Viewer is shown below:
- Meningococcal vaccines include only the following vaccine CVX codes: 114, 136,32, 108, 147.
- Only active patients are included.
To highlight and copy the code below to your clipboard, simply click the Copy button.
select * from ( select register.patno, number_mcv, birthdat,floor(datediff(month, dateadd(day,-extract(day from birthdat)+1,birthdat), dateadd(day,-extract (day from birthdat)+1,cast('today' as date)) )/12) as age from register left outer join (select patno, coalesce(count(vacname),0) as number_mcv from vaccine1 where cvxcode in ('114','136','32','108','147') group by patno) v on v.patno = register.patno where status_pat = 'ACTIVE' and register.patno >99 ) where age>=16