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 Charges, Payments, and Adjustments


This report shows the chart number, DOB, claim (invoice) number, date of service, CPT code, insurance code, charge, place of service, diagnosis code(s), payment, and adjustment amounts for the date range you specify.

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


  • Voided charges and payments do not appear.
  • “Paid” includes both patient and insurance side payments. The adjustments are split out into insurance and patient side.
  • “Pending” refers to amounts that are still considered receivable. It is computed by subtracting the paid and adjusted amounts from the charge amount.


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

select at1.patno, birthdat, at1.invoiceno, at1.date1, at1.cptcode, at1.ins_carrier_code, at1.charge, at1.units, at1.trnsxno, at1.pos, at1.dxcode1, at1.dxcode2, at1.dxcode3, at1.dxcode4, at2.paid, at2.ins_adj, at2.pt_adj, round(charge-paid-ins_adj-pt_adj,2) as pending from
(select date1, patno, invoiceno, cptcode, ins_carrier_code, charge, trnsxno, pos, units, dxcode1, dxcode2, dxcode3, dxcode4 from archive_transactions where archive_flag = 1 and date1 between :Start_date and :enddate and cptcode not in ('1','2','3','4','PLA')) at1
inner join register on register.patno = at1.patno
left outer join
(select round(sum(p),2) as paid, sum(adjustment) as ins_adj, sum(copayadjustment) as pt_adj, txnopaid from
(select copayrecd, payment, copayrecd+payment as p, adjustment, copayadjustment, txnopaid from archive_transactions where archive_flag =1 )
group by txnopaid) at2
on at2.txnopaid = at1.trnsxno
order by patno, invoiceno