# Care plans

> Care plans per client: problems with codes from your code systems, goals and the actions that reach them, evaluations over time, one active plan per client published as a version, agreement through a signature, and restrictive measures that start only once approved.

- Category: People
- Module: `care-plans`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/care-plans
- Page: https://bettersupabase.com/blocks/care-plans

## Install

```bash
npx better-supabase add care-plans
```

The command also installs `updated-at`, `memberships`, `permissions`, `subjects`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by care-plans; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    subjects: {},
    // Modes: "managed", "custom". The default is "managed".
    "care-plans": { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/care-plans`.

## Events

- `care_plan.archived`
- `care_plan.created`
- `care_plan.published`
- `care_plan.review_date_reached`
- `care_plan.updated`
- `care_plan_action.ended`
- `care_plan_action.review_date_reached`
- `care_plan_action.reviewed`
- `care_plan_action.started`
- `care_plan_evaluation.created`
- `care_plan_goal.status_changed`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md), [subjects](https://bettersupabase.com/blocks/subjects.md)

Works with: [versions](https://bettersupabase.com/blocks/versions.md), [signatures](https://bettersupabase.com/blocks/signatures.md), [approvals](https://bettersupabase.com/blocks/approvals.md), [tasks](https://bettersupabase.com/blocks/tasks.md), [guests](https://bettersupabase.com/blocks/guests.md), [notifications](https://bettersupabase.com/blocks/notifications.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)

## Recipes

- [Care plan editor](https://bettersupabase.com/recipes/care-plan-editor.md): A client's care plan as a tree of problems, goals and actions, with the status of each and the actions that wait for an approval.
- [Care plan evaluations](https://bettersupabase.com/recipes/care-plan-evaluations.md): The evaluations of a care plan's goals in a data grid, the newest first, with the goal status each one found.
