Skip to main content
Version: 1.0.0 Last Updated: 2026-02-17 Constitution Reference: Section 5.2.1 (Table Standards) Source: CL-PM-SPEC-REVIEW Findings 3.3, 8.8

Overview

This document establishes consistent data model conventions for all CL (Clinical) and PM (Practice Management) tables, addressing gaps identified in the spec review.

1. Required Columns for All Business Entity Tables

Per constitution Section 5.2.1, every business entity table MUST include:

Tables Currently Missing Required Columns

Exception: Immutable Log Tables

Tables that are INSERT-only by design (audit logs, disclosure logs) may omit updated_by and updated_at:
  • cl_disclosure_log (CL-11) — INSERT-only, no updates allowed
  • cl_data_exchange_log (CL-16) — INSERT-only
  • pf_audit_logs — INSERT-only

2. Soft-Delete Policy

Policy

Implementation

Tables Currently Missing deleted_at


3. RLS Helper Function Naming Convention

Standard Pattern

Current Inconsistencies to Resolve

Org Context Pattern

All RLS helpers MUST use the same pattern for obtaining the current organization:
Do NOT use:
  • current_setting('app.current_org') (CL-08 pattern — fragile, requires app-level setting)
  • current_setting('jwt.claims.organization_id') (CL-12 pattern — JWT claim may not exist)

4. PHI Classification

Classification Levels

Table Classification