We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: Simple Payments, Adjustments, and Appointment Type

About

This report shows patient number, date of service, rendering provider, appointment type, CPT, total insurance paid and total insurance adjusted, for a date of service range you specify and a payment date range you specify.

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

Caveats

  • Voids are excluded.
  • The date of service range is separate from the payment date range. Payments may have come in any time after the date of service, including time periods after the end date. To include all payments, set the payment date range from the start of the date of service range to today’s date.
  • This only includes insurance side payments and adjustments.

Code

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

select patno, dos, cptcode, staffname as rendering_provider,code1 as appt_type, total_ins_paid, total_ins_adjusted from
(
select patno, date1 as dos, trnsxno, rend_addr_id, cptcode from archive_transactions at1 where 
archive_Flag = 1 and date1 between :dos_start and :dos_end and txnopaid = 0
) a
left outer join
(select txnopaid, sum(payment) as total_ins_paid, sum(adjustment) as total_ins_adjusted from archive_transactions where archive_flag = 1 and date1 between :payment_start and :payment_end and txnopaid >0 group by txnopaid) b on a.trnsxno = b.txnopaid
left outer join staff1 on 
staff1.staffid = a.rend_addr_id
left outer join (select appt_date,code1, patno from schedule where appt_date between :dos_start and :dos_end and visit_status not in ( 'Cancelled','No Show')) s on a.patno = s.patno and s.appt_date = a.dos
where ( total_ins_paid >= 0.01 or total_ins_adjusted >= 0.01)