# Clinical decision support

> Tenant rules for dose range, duplicate therapy and interactions over a record's medication orders, alerts that members acknowledge or override with a reason, and a decision context for external engines whose alerts are stored the same way.

- Category: People
- Module: `clinical-decision-support`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/clinical-decision-support
- Page: https://bettersupabase.com/blocks/clinical-decision-support

## Install

```bash
npx better-supabase add clinical-decision-support
```

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

## Configure

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

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

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

## Client

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

## Events

- `care_alert.decided`
- `care_alert.raised`
- `care_alert.resolved`
- `care_rule.created`
- `care_rule.deleted`
- `care_rule.updated`

## Related blocks

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

Works with: [observations](https://bettersupabase.com/blocks/observations.md), [consents](https://bettersupabase.com/blocks/consents.md), [care-plans](https://bettersupabase.com/blocks/care-plans.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)
