> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MAT Enrollment

> View and manage a single medication-assisted treatment enrollment record, including medication events and monitoring events.

The MAT Enrollment detail screen shows a single MOUD (medications for opioid use disorder) enrollment record at the in-app route `/cl/mat/:enrollmentId`.

## Overview

The page loads a single enrollment from the `cl_moud_enrollments` table via `useMoudEnrollmentDetail`, scoped to the current organization. Four summary cards display the primary medication, treatment phase, enrollment status (`active`, `paused`, `completed`, `discontinued`), and the enrollment start date. Below the summary, two tables show medication events and monitoring events for the enrollment. Medication events track type, medication name, dose, and adherence status (`on_time`, `late`, `missed`). Monitoring events track type, due date, completion date, and result status (`pending`, `normal`, `abnormal`, `critical`); overdue items are highlighted. Users with the appropriate sub-permissions can record new medication events or add and complete monitoring events via modal dialogs.

## Who it's for

Requires permission `cl.moud.view`. Additional sub-permissions control write actions:

* `cl.moud.medication-event.create` — enables "Record Event" for medication events.
* `cl.moud.monitoring.manage` — enables "Add Monitoring" and "Mark Complete" for monitoring events.

## Before you start

* Permission `cl.moud.view` must be granted.
* An enrollment record must exist (`enrollmentId` in the URL must resolve to a row in `cl_moud_enrollments` for the current organization).

## Steps

<Steps>
  <Step title="Navigate to the enrollment">
    Open the MAT enrollment list at `/cl/mat` and click an enrollment row, or follow a deep link to `/cl/mat/:enrollmentId`.
  </Step>

  <Step title="Review enrollment summary">
    The four header cards show the primary medication, treatment phase, status badge, and start date.
  </Step>

  <Step title="Review medication events">
    The Medication Events table lists each recorded event with date, event type, medication name, dose, and adherence status. If no events exist, an empty state is shown.
  </Step>

  <Step title="Record a medication event (if permitted)">
    Click "Record Event" (requires `cl.moud.medication-event.create`) to open the medication event form dialog. The dialog pre-populates with the enrollment's primary medication.
  </Step>

  <Step title="Review monitoring events">
    The Monitoring Events table lists scheduled monitoring items with type, due date, completion date, and result status. Overdue items are highlighted with a destructive row style and an "Overdue" badge.
  </Step>

  <Step title="Add or complete a monitoring event (if permitted)">
    Click "Add Monitoring" to schedule a new event, or "Mark Complete" on an existing event (requires `cl.moud.monitoring.manage`). Marking complete sets `completed_at` to the current time and `result_status` to `pending`.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Enrollment status values">
    `active`, `paused`, `completed`, `discontinued` — sourced from `src/cores/cl/types/moud.ts`.
  </Accordion>

  <Accordion title="Treatment phase values">
    `induction`, `stabilization`, `maintenance`, `taper` — sourced from `src/cores/cl/types/moud.ts`.
  </Accordion>

  <Accordion title="Monitoring result status values">
    `pending`, `normal`, `abnormal`, `critical` — sourced from `src/cores/cl/types/moud.ts`.
  </Accordion>

  <Accordion title="Empty and error states">
    If the enrollment is not found (e.g., wrong ID or cross-tenant), the page renders "Enrollment not found." A loading skeleton is shown while the data fetches. Missing `organizationId` or `enrollmentId` context blocks mutations with a toast error.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Clinical" icon="stethoscope" href="/cl/overview">
    Overview of the Clinical core.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/cl.tsx
  * src/cores/cl/pages/MoudEnrollmentDetailPage.tsx
  * src/cores/cl/hooks/useMoudEnrollments.ts
  * src/cores/cl/types/moud.ts
</Accordion>
