# New Homepage Configuration

## Overview

The New Homepage consists of role-based **Dashboards** and configurable **Widgets** that are built and managed in the Designer. Once configured and tested, the New Homepage is activated per environment in the Admin Portal.

For an overview of how the New Homepage works in the Care Portal, see [New Homepage](https://github.com/welkincloud-io/welkin-docs/blob/master/kb/care/new-homepage.md). For activation steps, see [New Homepage Setup (Admin)](https://github.com/welkincloud-io/welkin-docs/blob/master/kb/admin/new-homepage-setup.md).

***

## Dashboards

A Dashboard is a set of Widgets available to users with a specific role on the New Homepage.

### Creating a Dashboard

1. In the Designer, navigate to the New Homepage section.
2. Click to create a new Dashboard.
3. Enter a **Title** for the Dashboard.
4. In the **Roles** drop-down, select the roles that will have access to this Dashboard.
5. From the **Available Widgets** list, add Widgets to the **Visible Widgets** column.
6. Customize the layout and alignment of Widgets on the page.
7. Save and publish the changes.

When a user logs into the Care Portal, the drop-down on the New Homepage displays the Dashboards available for their role.

> **License note:** An environment is limited to **1 Dashboard** under the standard license. This can be unlocked with the **Homepage Plus** feature. Contact your CSM for pricing.

***

## Widgets

A Widget is a set of rules that selects and displays information. When creating a Widget, set its Title and select an entity type.

### Entity Types

Widgets are built around one of the following entity types:

* Patient (parent entity)
* Patient Program
* Assessments
* Encounter
* CDT
* Notification
* Calendar event

Patient is the parent entity; all others are child entities. Building a Widget from a child entity may introduce limitations (for example, filtering by patient fields is not supported).

> **License note:** An environment is limited to **6 Widgets** under the standard license. This can be unlocked with the **Homepage Plus** feature. Contact your CSM for pricing.

***

## Configuration Tab

The Configuration tab is where you define the conditions for the Widget. It has two subtabs:

* **Rule Builder** – the main subtab where you select fields, add them to groups, and set conditions for their values.
* **Code Source** – displays the configured rules translated into an OpenSearch query. It is strongly recommended that your engineering team review the source code to ensure it aligns with business requirements.

### Condition Fields by Entity Type

**Patient Entity** – 4 categories are available:

1. **Patient** – patient profile fields configured in the Designer
2. **Assessment** – assessment information, including CDTs and CDTFs used within assessments
3. **Program** – program information
4. **CDT(F)** – CDT fields filled in for the patient (matches all CDTs containing that field, regardless of which CDT it is stored in)

**Other Entities (child entities)** – 2 categories are available:

1. Conditions related to the selected entity
2. **Patient** – patient profile fields configured in the Designer

For Patient and CDT entities, you can enable the **Use last CDT record** toggle:

* When disabled, the Widget displays all suitable CDT records.
* When enabled, only the last CDT record from all suitable records is displayed.

### Current User Variable

For fields that refer to a username, use `{{CURRENT_USER_NAME}}` to dynamically select the currently logged-in user. Do not add extra spaces in the field containing this variable.

### Conditions with Titles

You can add title checks to conditions – for example, the title of an assessment or the title of a program phase. Title fields are **case-sensitive** and must exactly match how the element is named in your Designer configuration.

### Date Expressions

For date fields, use the `now` expression to specify relative time periods. See [New Homepage](https://github.com/welkincloud-io/welkin-docs/blob/master/kb/care/new-homepage.md#date-expressions) for the full reference table.

### Multiple Criteria for One Child Entity

When checking multiple conditions for a single child entity (for example, a program phase and the start date of that phase), all conditions for that entity must be placed in the **same group**. This ensures the conditions are evaluated together.

**Example:** To check that a patient is in one of two program phases AND that the start date falls within a time interval:

* Create one group for the first phase + its date condition
* Create a second group for the second phase + its date condition
* Set an "or" operator between the groups

If conditions for the same entity are placed in separate groups, the system evaluates them independently and cannot guarantee they refer to the same record.

***

## Columns Tab

The Columns tab lets you select which fields are displayed in the Widget.

* **Available Columns** – all fields that can be added to the Widget (same set as the Configuration tab fields)
* **Visible Columns** – fields that have been added and will be shown

Once added, columns can be reordered to control display order. Clicking on an added column opens **Column Settings** where you can set a custom column title and enable filtering by that column.

### Enable Filtering Toggle

If filtering is enabled for a column, a filter icon appears on that column in the Care Portal, allowing users to filter the widget results by that field.

* If the Widget is built from a **Patient** entity type, there are no filtering limitations.
* If the Widget is built from a **child entity**, filtering is only supported for fields of that child entity. Filtering by patient fields is not available.

***

## Sort (Default) Tab

The Sort tab lets you select the default sort field for the Widget. Only one sort field can be selected.

To select a field, click **+ Data Type Field**. The list shows the columns already added in the Columns tab. For the selected field, choose the sort direction (ascending or descending) and optionally remove the sort field.

***

## Widget Example

**Goal:** Display patients who are in one of two specific program phases and have a date in a specific CDTF set no more than 14 days ago.

**Configuration tab setup:**

* Group 1: program phase = "Phase A" → AND → CDTF date >= `now-14d/d`
* Group 2: program phase = "Phase B" → AND → CDTF date >= `now-14d/d`
* Operator between groups: **or**

**Columns:** patient name, CDTF date (with filtering enabled on the date column)

**Sort:** patient name, ascending

This Widget will show all patients in either of the two phases who have a qualifying date in the last 14 days.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.welkinhealth.com/designer/homepage-configuration/new-homepage-designer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
