Clinical Programs & Workflows
Relevant source files
The following files were used as context for generating this wiki page:
- src/js/apps/programs/program/program_app.js
- src/js/apps/programs/program/workflows/workflows_app.js
- src/js/views/programs/program/program_views.js
- src/js/views/programs/program/workflows/workflows_views.js
- test/integration/programs/program/program-flow.js
- test/integration/programs/program/workflows.js
- src/js/i18n/en-US.yml
Clinical Programs and Workflows represent the administrative blueprint for care delivery within the application. Programs serve as high-level containers that organize clinical logic into Workflows, which are further decomposed into specific Actions or Program Flows. This module allows administrators to define standardized care paths, including form assignments, behavioral triggers, and ownership roles, which are later instantiated for individual patients.
Sources: src/js/i18n/en-US.yml:719-865, test/integration/programs/program/workflows.js:7-50
Architecture and Component Hierarchy
The Programs module follows a hierarchical structure where a Program contains multiple Workflows. Workflows are composed of Program Actions (individual tasks) and Program Flows (groups of tasks). The application uses a Backbone/Marionette architecture, leveraging specialized "Apps" to manage state and lifecycle, and "Views" for the user interface.
Component Relationship
The diagram below illustrates the relationship between the primary entities in the Programs module.
Program Actions can exist independently within a Program or be nested within a specific Program Flow.
Sources: test/integration/programs/program/program-flow.js:10-45, test/integration/programs/program/workflows.js:7-60
Program Management
The high-level Program entity manages the overall metadata and state of a clinical initiative. Key attributes include whether the program is "Published" (active for use) or "Archived." Administrators use the Program Sidebar to update these details and manage the program's visibility.
Program Sidebar Actions
| Feature | Description |
|---|---|
| Program State | Toggle between "Published" (On/Off) to control clinician access. |
| Details | Textual description of the program's purpose and scope. |
| Edit Mode | Allows renaming the program and updating its description. |
| Timestamps | Displays "Added" and "Updated" timestamps for auditing. |
Sources: src/js/i18n/en-US.yml:743-755, src/js/views/programs/program/program_views.js
Workflows and Program Flows
Workflows are the operational components of a Program. The WorkflowsApp manages the listing and creation of these components. A "Program Flow" acts as a container for related actions, allowing for structured care sequences.
Workflow Lifecycle
The creation process involves defining the type of workflow component and then configuring its specific behavioral and clinical properties.
Sources: src/js/apps/programs/program/workflows/workflows_app.js, src/js/i18n/en-US.yml:730-741
Program Actions Configuration
Program Actions are the atomic units of work. They define what needs to be done, who should do it, and what forms are required. Configuration happens primarily in the ActionSidebar.
Key Configuration Elements
- Behavior: Actions can be set to "Standard," "Automated," or "Conditional."
- Due In: Specifies the relative number of days until the action becomes due after being triggered (e.g., "Same Day" or "# days").
- Form Assignment: Links a specific clinical form to the action for data collection.
- Owner: Defines the default team or clinician responsible for the action.
- Outreach: Indicates if the action is a "Program Outreach Action," which may involve direct patient communication.
Sources: src/js/i18n/en-US.yml:784-825, test/integration/programs/program/program-flow.js:237-295
Action Attributes Table
| Attribute | Description | Source File Reference |
|---|---|---|
name | The display name of the action. | src/js/i18n/en-US.yml:786 |
behavior | Automated, Standard, or Conditional logic. | src/js/i18n/en-US.yml:769-773 |
days_until_due | Integer value for relative scheduling. | src/js/i18n/en-US.yml:763-767 |
form | Reference to a clinical form template. | src/js/i18n/en-US.yml:795 |
tags | Keywords for categorization and filtering. | src/js/i18n/en-US.yml:800 |
Execution Logic and UI Interaction
The frontend uses specialized views to handle the drag-and-drop sequencing of actions and the contextual navigation between programs and workflows.
Sequential Flow
- Workflows List: Displays all actions and flows in a sortable list.
- Context Trail: Provides breadcrumb navigation (e.g., "Back to List" or "Back to Program").
- Real-time Updates: Interactions with the sidebar (like toggling "Published") trigger
PATCHrequests to the API to persist changes.
Sources: src/js/views/programs/program/workflows/workflows_views.js, test/integration/programs/program/program-flow.js:47-86
Summary
Clinical Programs & Workflows provide the framework for standardized care. By organizing clinical actions into nested flows with defined behaviors and form requirements, the system ensures that care delivery is consistent and measurable across different clinician teams. The module bridges administrative planning with patient-level execution by serving as the template for all clinical tasks generated in the application.
Sources: src/js/i18n/en-US.yml:719-865, src/js/apps/programs/program/program_app.js