SQL Logic: RevFlow Definition of Charge
The SVW_REVFLOW_D_CHARGE data model will have multiple inactive records for a single charge, with only one record being the most recent/active. This logic will show you how to ensure you are calculating charges correctly in WebPT Billing.
SELECT c.Company_Id, c.total_chg_amt FROM d_charge c WHERE c.is_active = 1 AND c.date_of_service BETWEEN @FDate AND @TDate -- typically we look at this metric with DOS AND lower(c.proc_code) NOT IN ( 'copay', 'insover','int' )