> ## 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.

# Automated Level-of-Care Assessment (ASAM/LOCUS) — Integration

> Authoritative schemas: EVENT_CONTRACTS.md § CL-49. All payloads are UUID-only; never inline dimension_scores[*].notes or override_rationale (PHI).

**Spec:** [CL-49](https://github.com/Encore-OS/encoreos/blob/development/specs/cl/specs/CL-49-automated-level-of-care-asam-locus.md)
**Status:** 📝 Spec — pre-verification (2026-05-09)
**Owner:** CL

## Touchpoints

| Counterpart                  | Mechanism                                                        | Direction | Notes                                                                                                                                                                            |
| ---------------------------- | ---------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CL-02 (Assessment infra)     | Internal CL reuse                                                | Reuses    | LOC assessments live in their own table (`cl_loc_assessments`) so dimension semantics stay pinned to `instrument_version`; CL-02 form components and validation patterns reused. |
| CL-08 (CDS)                  | Event `cl_loc_recommendation_changed`                            | Publishes | CDS surfaces alert when `direction != 'lateral'`; payload UUID-only.                                                                                                             |
| CL-43 (UM concurrent review) | Events `cl_loc_assessment_completed`, `cl_loc_override_recorded` | Publishes | UM coordinator pulls full record server-side after a Part 2 consent re-check; `cl_redisclosure_log` entry written.                                                               |
| CL-11 (Consent / Part 2)     | `cl_has_sud_consent(chart_id)` SECURITY DEFINER                  | Reuses    | RLS gating on `is_sud_related = true` rows.                                                                                                                                      |
| PF-70 (Code library)         | `pf_*_codes` lookups                                             | Consumes  | `recommended_loc_code` / `final_loc_code` validated against `asam_loc_levels` and `locus_loc_levels`.                                                                            |
| PF-15 (Picklists)            | `cl_loc_override_reasons`                                        | Consumes  | Override reason enumeration. Seeded via `pf_picklist_default_definitions`.                                                                                                       |
| PF-96 (Jurisdiction)         | `pf_resolve_jurisdiction_profile(org, site)`                     | Consumes  | LOCUS state thresholds and any state-specific ASAM expectations.                                                                                                                 |
| PF-30 (Permissions)          | `useHasPermission` / `<PermissionGate>`                          | Consumes  | Keys: `cl.loc_assessment.{view,create,sign,override,report}`.                                                                                                                    |

## Event payloads

Authoritative schemas: [EVENT\_CONTRACTS.md § CL-49](/architecture/integrations/EVENT_CONTRACTS#cl-49-automated-level-of-care-events). All payloads are UUID-only; never inline `dimension_scores[*].notes` or `override_rationale` (PHI).

## Database references

* Owns: `cl_loc_assessments` (chart-scoped via `cl_patient_charts.id`).
* No cross-core FK (uses UUID columns only). Intra-CL FKs to `cl_patient_charts` are within-core and do not require ADR-002 coverage.

## Disclosure / Part 2

UM (CL-43) consumption of SUD-flagged LOC assessments must be preceded by `cl_has_sud_consent(chart_id)` and a `cl_redisclosure_log` insert. Without consent, UM sees only LOC code + dimension severity bands — never `notes`, never `override_rationale`.

## Status flip checklist (per Lovable project knowledge §2)

On completion, update all five surfaces:

1. `src/cores/cl/AGENTS.md` — status + date
2. `specs/cl/tasks/CL-49-TASKS.md` — header ✅
3. `docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md` — row CL-49
4. `specs/cl/IMPLEMENTATION_LOG.md` — entry
5. `specs/cl/specs/CL-49-automated-level-of-care-asam-locus.md` — header

## CL-49-EN-01 — ASAM six-dimension / LOC block adapter (CL-75, shipped 2026-07-02)

The ASAM six-dimension / level-of-care assessment ships as a CL-75 typed block (`asam-loc-adapter`) over the CL-49 `cl_loc_assessments` table (PR #2208), resolved onto surfaces via `getResolvedSurfaceBlocks`.
