> ## 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.

# Legal Entity

> Query the Elation Billing legal entities - the tax-ID-holding billing groups a practice bills claims under.

One row per Elation Billing legal entity - the tax-ID-holding billing group a practice bills under. Each claim records the legal entity it was billed under via `claim.legal_entity_id`.

This table's columns and relationships are shown in the [Hosted Database schema](/articles/hdb/schema).

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

* Every legal entity configured for a practice
* The default billing entity per practice (`is_default`)
* Tax IDs, NPIs, and taxonomy codes used on submissions
* Which legal entity a claim was billed under, by joining `claim` on `claim.legal_entity_id`

## All active legal entities

Lists the billing entities configured for each practice, with the identifiers that appear on submissions.

<CodeGroup>
  ```sql sql theme={null}
  select
      le.id as legal_entity_id
    , le.practice_id
    , le.name
    , le.display_name
    , le.is_default
    , le.tin
    , le.npi
    , le.taxonomy
    , le.tax_id_type
    , le.clia
  from legal_entity le
  where le.is_deleted = false
  order by le.practice_id, le.is_default desc, le.name;
  ```
</CodeGroup>

## Claims by legal entity

Rolls up claim volume per legal entity.

<CodeGroup>
  ```sql sql theme={null}
  select
      le.id as legal_entity_id
    , le.name as legal_entity_name
    , le.tin
    , c.practice_id
    , count(*) as claim_count
    , count(distinct c.patient_id) as unique_patients
    , sum(iff(c.is_billed, 1, 0)) as claims_submitted
  from claim c
    join legal_entity le on le.id = c.legal_entity_id
  where c.is_deleted = false
    and c.from_date >= dateadd(day, -90, current_date)
  group by le.id, le.name, le.tin, c.practice_id
  order by claim_count 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>*
