> ## Documentation Index
> Fetch the complete documentation index at: https://help.elationhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Charge

> Query Elation Billing charge line items - the per-CPT lines on a claim, with their charges, adjustments, payments, and outstanding balance.

Elation Billing charge line items. Each row is one billable service line within a claim, carrying its financial lifecycle (charges, adjustments, payments, balance). Multiple charge lines roll up to a single `claim`, and the claim points back to an EHR-side `bill`.

The table schema can be found in our [HDB dbdocs reference](https://dbdocs.io/hosteddb_support/hosted_database_snowflake?view=charge).

**For reporting on but not limited to:**

* Per-CPT volume and revenue for a date range
* Outstanding balance per patient, payer, or claim
* Patient-responsibility vs. payer-responsibility splits via `balance_responsibility`
* Charges that have not yet been billed (`first_billed is null`)
* NDC-level drug-charge reporting
* Reconciling claim totals against the sum of their charge lines

<Note>
  The financial columns on `charge` (`total_charges`, `adjustments`, `payments`, `balance`) are the running totals stored on the line in Elation Billing - they reflect the latest state, not a transaction log. For the per-ERA adjustment history use [`era_matched_adjustment`](/articles/hdb/era-matched-adjustment).
</Note>

## Charges for a date range

Returns every charge line with service date in a window, with the CPT and modifiers, units, charge totals, and current balance.

<CodeGroup>
  ```sql sql theme={null}
  select
      ch.id as charge_id
    , ch.claim_id
    , ch.patient_id
    , ch.practice_id
    , ch.from_date
    , ch.through_date
    , ch.cpt
    , ch.mod1
    , ch.mod2
    , ch.units
    , ch.unit_charge
    , ch.total_charges
    , ch.adjustments
    , ch.payments
    , ch.balance
    , ch.balance_responsibility
    , ch.last_billed
    , ch.last_billed_name
  from charge ch
  where ch.is_deleted = false
    and ch.from_date between '2026-01-01' and '2026-03-31'
  order by ch.from_date, ch.claim_id, ch.priority;
  ```
</CodeGroup>

## Outstanding balances by responsibility

Aggregates remaining balance by who owes it. Useful for separating patient-AR from payer-AR snapshots.

<CodeGroup>
  ```sql sql theme={null}
  select
      ch.practice_id
    , ch.balance_responsibility
    , count(*) as open_charges
    , count(distinct ch.claim_id) as claims_with_balance
    , count(distinct ch.patient_id) as patients_with_balance
    , sum(ch.balance) as total_outstanding_balance
  from charge ch
  where ch.is_deleted = false
    and ch.balance > 0
  group by ch.practice_id, ch.balance_responsibility
  order by ch.practice_id, total_outstanding_balance desc;
  ```
</CodeGroup>

## Charges that have not yet been billed

Returns lines that exist in Elation Billing but have not been billed out to any payer. Useful as a "ready to submit" worklist for billers.

<CodeGroup>
  ```sql sql theme={null}
  select
      ch.id as charge_id
    , ch.claim_id
    , ch.patient_id
    , ch.practice_id
    , ch.from_date
    , ch.through_date
    , ch.cpt
    , ch.total_charges
    , ch.line_note
    , ch.created_timestamp
  from charge ch
  where ch.is_deleted = false
    and ch.first_billed is null
  order by ch.from_date;
  ```
</CodeGroup>

## CPT volume and revenue

Rolls up CPT-level activity over a 90-day window: line counts, unique patients, billed totals, collected totals, and the running balance still on those lines.

<CodeGroup>
  ```sql sql theme={null}
  select
      ch.cpt
    , count(*) as line_count
    , count(distinct ch.patient_id) as unique_patients
    , sum(ch.units) as total_units
    , sum(ch.total_charges) as total_billed
    , sum(ch.payments) as total_collected
    , sum(ch.adjustments) as total_adjusted
    , sum(ch.balance) as total_outstanding
  from charge ch
  where ch.is_deleted = false
    and ch.from_date >= dateadd(day, -90, current_date)
  group by ch.cpt
  order by total_billed desc;
  ```
</CodeGroup>

## Reconcile a claim with its charge lines

Joins one claim to the sum of its charge lines so you can confirm the claim total matches what's actually billed line-by-line.

<Note>
  The `charge` and `claim` tables both live in your `elation_billing` schema; the `bill` table lives in your standard schema. Either set your default schema or qualify the standard-schema tables when running cross-schema queries.
</Note>

<CodeGroup>
  ```sql sql theme={null}
  select
      c.id as claim_id
    , c.local_id
    , c.bill_id
    , c.from_date as claim_from_date
    , c.through_date as claim_through_date
    , c.is_billed
    , count(ch.id) as charge_lines
    , sum(ch.total_charges) as sum_charges
    , sum(ch.payments) as sum_payments
    , sum(ch.adjustments) as sum_adjustments
    , sum(ch.balance) as sum_balance
  from claim c
    left join charge ch
      on ch.claim_id = c.id
      and ch.is_deleted = false
  where c.is_deleted = false
    and c.id = 1234567890  -- Replace with actual claim ID
  group by c.id, c.local_id, c.bill_id, c.from_date, c.through_date, c.is_billed;
  ```
</CodeGroup>

## Drug-charge detail by NDC

Filters to charge lines that carry an NDC (the National Drug Code) and surfaces the structured NDC fields alongside the financial state.

<CodeGroup>
  ```sql sql theme={null}
  select
      ch.id as charge_id
    , ch.claim_id
    , ch.patient_id
    , ch.from_date
    , ch.cpt
    , ch.ndc
    , ch.ndc_code
    , ch.ndc_dosage
    , ch.ndc_measure
    , ch.units
    , ch.total_charges
    , ch.payments
    , ch.balance
  from charge ch
  where ch.is_deleted = false
    and ch.ndc_code is not null
    and ch.from_date >= dateadd(day, -180, current_date)
  order by ch.from_date desc;
  ```
</CodeGroup>

*If you have any questions about this topic please reach out to [Elation Support Portal](/articles/support-portal-introduction) with the subject line HDB - \<your\_question>*
