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

# / RH: program_id Data Contract

> Contract ID: CL-10-RH-program-id Last Updated: 2026-02-19 Related: CL-10-outcomes-tracking-measurement-INTEGRATION.md

**Contract ID:** CL-10-RH-program-id\
**Last Updated:** 2026-02-19\
**Related:** [CL-10-outcomes-tracking-measurement-INTEGRATION.md](outcomes-tracking-measurement-integration.md)

This document specifies the cross-core data reference between **CL** (consumer) and **RH** (publisher) for program-scoped outcomes. Tables and columns involved: **`cl_program_outcomes.program_id`** and **`rh_programs(id)`**.

***

## Publisher (RH)

| Item              | Value                                                                                                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Owning core**   | RH (Recovery Housing)                                                                                                                                                           |
| **Table**         | `rh_programs`                                                                                                                                                                   |
| **Column**        | `id` (UUID, primary key)                                                                                                                                                        |
| **Contract**      | RH owns `rh_programs`; `id` is stable. Any change to `id` type or removal of the table requires a coordinated migration with CL (consumer of `cl_program_outcomes.program_id`). |
| **Compatibility** | RH must not drop or rename `rh_programs.id` without notifying CL and providing migration path (e.g. backfill or nullable `program_id` during transition).                       |

***

## Consumer (CL)

| Item              | Value                                                                                                                                                                                                             |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Owning core**   | CL (Clinical & EHR)                                                                                                                                                                                               |
| **Table**         | `cl_program_outcomes`                                                                                                                                                                                             |
| **Column**        | `program_id` (UUID, foreign key to `rh_programs(id)`)                                                                                                                                                             |
| **Contract**      | CL stores program-level outcome aggregates; `program_id` references `rh_programs(id)` for program context.                                                                                                        |
| **Compatibility** | CL depends on `rh_programs(id)` existing and remaining a UUID PK. If RH deprecates a program, CL may set `program_id` to NULL (if column is made nullable) or retain for historical reporting per product policy. |

***

## Migration and compatibility rules

* **RH:** Before changing `rh_programs` schema (e.g. `id` or table removal), update this contract and coordinate with CL; document migration steps (e.g. CL migration to nullable `program_id`, backfill, or soft-delete in RH).
* **CL:** Before changing `cl_program_outcomes.program_id` (e.g. making nullable, dropping FK), update this contract and CL-10 integration doc; consider impact on existing program dashboards and reporting.

***

## References

* [CL-10 Integration](outcomes-tracking-measurement-integration.md) — Cross-Core Data Reference
* [CROSS\_CORE\_INTEGRATIONS.md](CROSS_CORE_INTEGRATIONS.md) — Matrix of cross-core integrations
