SQL: MU Excluding Certain CPT Codes from Attestation Volume Results

About

Some CPT codes that you may use in the OP software may not properly reflect patient encounters. A practice might use a fake CPT code like “99999” to reflect a no-show charge, a bounced-check charge, or track something internally. Therefore you will want to List the codes you want to exclude with the SQL code. To do this:

  1. Select the SQL code you previously copied to the database viewer to obtain attestation results volume (state group and drill down codes). The selected code will appear in the edit box. You can edit the code from there.
  2. Search the code to locate this line:  and at1.cptcode not in ('113','99999','P1001').
  3. Replace 113','99999','P1001' with your CPT codes. Separate the CPT codes with single quotes, separated by commas, and no spaces (example: '99999','P1021','08134').
  4. Save the Code by clicking the Save SQL query text button.
  5. Run the code.

To remind yourself which codes you may need to add to the exclusion list, run the code in the Code section below. An image of the code list result is shown below.

Caveats

This code should be added to both the state group and drill down codes you added to your database viewer. If you did not add the codes to your database viewer yet, please do so before attempting to change the code.

Code

To remind yourself what codes might need to be excluded, run the SQL below (using the same attestation date you are planning to use). To highlight and copy the code below to your clipboard, simply click the Copy button.

select distinct cptcode from archive_transactions at1
 inner join register on register.patno = at1.patno
 where at1.cptcode not in ('1','2','3','4') and pos not in (21,23)   and at1.ins_carrier_code not in ('XCLUD') and
  at1.date1 between :attestation_start and ( :attestation_start + 89) and at1.archive_flag = 1