SQL: CPT Utilization by Payer

There are two versions of this SQL: Firebird and MySQL. The MySQL version only applies to clients who are have migrated to MySQL.. All other Practices should continue to use the Firebird version of this code. Click to expand and copy the code you need. If you are unsure which code to use, please check with your Practice Administrator.

About

This report shows the frequency and total units billed for each CPT by insurance.

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

Caveats

Insurance is primary insurance only. The difference between frequency and units occurs if a CPT can be billed for more than one unit per patient per day. For example, 90460 might be billed three times in a single claim. This will have a frequency of one but a total units of three. By contrast, CPT 99213 will have frequency and total units of one.

SQL Code: Firebird

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

select ins_carrier_code, cptcode, count(cptcode) as frequency, sum(units) as total_units from ( select patno, date1, ins_carrier_code, cptcode, units from archive_transactions where date1 between :Start_date and :end_date and archive_Flag = 1) group by cptcode, ins_carrier_code order by total_units desc


SQL Code: MySQL

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

select ins_carrier_code, cptcode, count(cptcode) as frequency, sum(units) as total_units from 
( select patno, date1, ins_carrier_code, cptcode, units from archive_transactions where date1 between :Start_date and :end_date and archive_Flag = 1) a group by cptcode, ins_carrier_code order by total_units desc