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: Vaccine Payments by VFC Status

About

This report shows the vaccines given in the office between two dates you specify. It also shows the VFC status, payments, and adjustments for each vaccine.

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

Caveats

This includes vaccine serum data, but it does not include vaccine administration codes.

Code

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

select date1, patno, staffname as rendering_provider, fname, lname, vfc1, vacname, cptcode, charge, ins_carrier_code, ins_carrier_code_other, round(p,2) as ins_paid, round(c,2) as patient_pd, round(a,2) as total_adjustment from vaccine1
inner join register on register.patno =vaccine1.patno
left outer join (Select trnsxno, date1, charge, rend_addr_id, ins_Carrier_code, ins_carrier_code_other, cptcode, patno from archive_transactions where cptcode between '90600' and '90745' and archive_Flag = 1) at1 on at1.patno = vaccine1.patno and at1.date1 = vaccine1.vacdate and at1.cptcode = vaccine1.offcode
left outer join (select sum(payment) as p, sum(copayrecd) as c, sum(adjustment + copayadjustment) as a, txnopaid from archive_transactions group by txnopaid) at2 on at2.txnopaid = at1.trnsxno
left outer join staff1 on staff1.staffid = at1.rend_addr_id
where vacdate between :Start_date and :end_Date and vfc1 <> 9