> For the complete documentation index, see [llms.txt](https://docs.lucernahealth.com/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lucernahealth.com/guide/insights-studio/population-builder/reference-guides/how-to-build-blocks.md).

# How to build blocks

A block is a reusable set of filter conditions that can be referenced inside populations and other blocks.

Blocks don't run on their own. They produce no member lists and no saved counts. They take effect only as part of whatever references them.

That's what makes them useful. Logic like "active roster member" appears across dozens of populations and teams. Defining it once as a block means everyone references the same definition, and a correction made in one place carries everywhere it's used. Without blocks, the same logic gets rebuilt each time it's needed, and small differences creep in.

***

### Two Ways to Add a Rule

Blocks are built from two kinds of component. Unlike populations, blocks cannot reference populations.

**Add Block** Reference an existing block, pulling in reusable logic.

* Use when: The logic is common and already defined
* Example: Active Roster Member

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F38e3fZF4fo7mbd5ExmGv%2FScreenshot%202026-08-26%20at%2011.52.00%E2%80%AFAM%201.png?alt=media&amp;token=11819c41-6ce6-4321-a75f-852fe26f77d8" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FuudgotZaou6ZQ31TCQ0m%2FScreenshot%202026-08-26%20at%2011.52.46%E2%80%AFAM%201.png?alt=media&amp;token=28b5d3e5-f1fa-4d1b-9142-c4a55a358142" alt=""><figcaption></figcaption></figure></div>

**Add Field** Build a rule directly from the data model — select a field, choose an operator, enter a value.

* Use when: The condition is specific to what you're building
* Example: Plan State = FL

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FHnB2lqhdMAbjy6PJQUsN%2FScreenshot%202026-08-26%20at%2011.53.48%E2%80%AFAM%201.png?alt=media&amp;token=63a2e507-c151-4819-a670-c33e2125f9b8" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FjE7o2HJteylxf9vv659F%2FScreenshot%202026-08-26%20at%2011.54.24%E2%80%AFAM%201.png?alt=media&amp;token=a62b7d5e-3b76-4760-8a15-0c340e836148" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F6Ds3QDOZ68vmkhj3QxSJ%2FScreenshot%202026-08-25%20at%208.14.21%E2%80%AFAM%201.png?alt=media&amp;token=3235ba65-4768-4530-9c97-ce6cdb30d85d" alt=""><figcaption></figcaption></figure></div>

Before building anything from scratch, search what already exists. Reusing a block is faster and keeps definitions consistent.

***

### Creating a Block

1. Click Add Block button in Blocks tab to start creating a new block
2. Complete the Details tab.

| Field       | Notes                                                                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name        | Clear title, visible wherever the block appears                                                                                                      |
| Key         | A unique identifier for your block. It auto-generates as you type the name, and cannot be changed after saving.                                      |
| Category    | Categories for blocks include Care Continuity, Care Gaps, Clinical & Risk, Demographics, Eligibility & Coverage, Outreach Channels, and Utilization. |
| Description | Short summary of what the population contains and any caveats                                                                                        |

**2.** Go to the Definition tab. This is where the query is built. It has two panels:

* **Left:** the query builder panel, where rules are added
* **Right:** the funnel panel, showing the simulated count as you build

The simulated root table sits above the query builder panel. It's the table the block's count is calculated against, an estimate to help you understand your data as you build, not a live run.

Once the block is saved, it shows the latest version. Every edit is saved as its own version, and you can go back to any of them.

***

### Creating a Simple Block

#### Goal: Build a block for all active roster members in Florida.

#### Step 1. Break the question down

Split the request into parts:

1. Active roster members
2. Members in Florida

#### Step 2. Active roster members

* Click Add Field, then Select Column. The selection modal starts empty, type a column name to search, or search by table if you know which one you need.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FK3thnNaBCP0jT5wSRg7M%2FScreenshot%202026-08-27%20at%204.33.51%E2%80%AFPM%201.png?alt=media&amp;token=55c4985f-181e-41d8-ab44-f86951385f03" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FaEq0DJq4m2L8Dnn3llRs%2FScreenshot%202026-08-27%20at%204.35.44%E2%80%AFPM%201.png?alt=media&amp;token=fa968800-7454-42e1-bdb0-99dab640a081" alt=""><figcaption></figcaption></figure></div>

* Start by typing `roster`. If you're not sure of the exact column name, type what you're looking for and pick from the results.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F7ILkthvAqHmqjScYfz1Q%2FScreenshot%202026-08-27%20at%204.37.02%E2%80%AFPM%201.png?alt=media&amp;token=287da58b-5a6c-4b34-afeb-1a33885f556e" alt=""><figcaption></figcaption></figure></div>

* The results for `roster` alone aren't quite right. We want *active* members, and active is a status — so add `status` next to it.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FZjOZXbSLnBEWBV6eGJ85%2FScreenshot%202026-08-27%20at%204.37.57%E2%80%AFPM%201.png?alt=media&amp;token=6f0ba449-181c-434b-8c88-30a5460c5b19" alt=""><figcaption></figcaption></figure></div>

* Searching `roster status` returns Roster Status from two tables: Fct Roster and Fct Roster Calendar. Select the top result.
* Then complete the rule by choosing an operator and value: Roster Status = Active.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FNM6eZz9MQqchJEE099wT%2FScreenshot%202026-08-27%20at%204.39.04%E2%80%AFPM%201.png?alt=media&amp;token=036a976f-8466-4f9a-802e-c9e8b8f3a8c9" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F884C4aC3cnedSGNSgDTW%2FScreenshot%202026-08-27%20at%204.39.51%E2%80%AFPM%201.png?alt=media&amp;token=982772bf-5ea9-4d1a-a607-8284a1af8fad" alt=""><figcaption></figcaption></figure></div>

#### Step 3. Members in Florida

* Click Add Field, then Select Column, and search `state`.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FjE7o2HJteylxf9vv659F%2FScreenshot%202026-08-26%20at%2011.54.24%E2%80%AFAM%201.png?alt=media&amp;token=a62b7d5e-3b76-4760-8a15-0c340e836148" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F261LTZMvJdBrG7fveaAA%2FScreenshot%202026-08-27%20at%204.43.30%E2%80%AFPM%201.png?alt=media&amp;token=165c1e63-1c3d-4a0f-867e-5774e97a300e" alt=""><figcaption></figcaption></figure></div>

* The first result, Facility State, refers to a facility's location, not the member's. Choose **Plan State** instead.

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2F7CbFa91LJTy2YffDdnyt%2FScreenshot%202026-08-27%20at%204.44.44%E2%80%AFPM%201.png?alt=media&amp;token=7351a2dd-344b-4d10-b472-b00066113a3e" alt=""><figcaption></figcaption></figure></div>

* The column name tells you what the field is, but the table tells you what it's about. Hover the info icon next to a table name to learn more about it before selecting.
* Complete the rule by choosing an operator and value: Plan State = FL.

#### Step 4. Read the result

<div data-with-frame="true"><figure><img src="https://1578258752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXt8wjwK8SlPIzyfLwqU%2Fuploads%2FRm0njZU1XICd8rVWEyeR%2FScreenshot%202026-08-27%20at%204.45.36%E2%80%AFPM%201.png?alt=media&amp;token=ec7cd2f4-f92d-44cb-a197-6824aa703aec" alt=""><figcaption></figcaption></figure></div>

The system auto-generates a name for every query that isn't a block. That same name shows up on the right panel, so you can trace any rule in the query to its effect on the count.

***

### Add Group

The example above uses a single group, where all conditions must be true.

Conditions within a group are joined by AND. Conditions between groups are joined by OR.

The word *either* in a request is the signal that you need a second group. Because groups are joined by OR, each group must independently define a complete set of conditions. If a condition applies to both groups, it needs to appear in both.

***

### Working With Groups

Group names generate automatically based on their contents. To rename one, use the menu icon and select Update Group Name. Once renamed manually, automatic naming stops for that group, even if you add or remove conditions later.

**Reordering:** Drag conditions to reorder them within a group.

**Duplicating:** Use the copy icon to duplicate a condition. Only rules can be duplicated, not blocks.

**Removing:** Removing a group updates the count immediately.

***

### Exclude

Everything in the Include section defines what the block matches. Exclude removes matches from that.

Anyone matching an Exclude condition is removed, regardless of which group qualified them.

***

### Saving

Save the block if the logic is something you'll reuse across other blocks and populations. To save, make sure all required fields on the Details tab are filled in. Once saved, the References tab becomes available.

Editing works the same way as it does for populations. Use the pencil icon on the right to edit the Definition.

Changes go live in two steps. Save your changes and review them, then Publish to push that version live. Until you publish, the live block is unchanged.

Every edit is saved as its own version, and any previous version can be previewed and restored.

***

### Best Practices

**Structure**

* Break the request into parts before building anything
* Search for existing blocks before building from scratch
* Keep blocks narrow — one block should represent one idea
* If a block only makes sense inside a single population, that logic is usually better left as rules in that population

**Naming**

* Block names appear inside other people's queries, often without context. Write the name for someone who'll encounter it six months from now
* Name what the block contains, not how it was built: *Active Roster Member*, not *Roster filter v2*
* Avoid version numbers in names — version history already tracks changes
