Skip to main content

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.

Feature ID: PF-71
Status: ✅ Implemented
Spec Reference: PF-71-patient-identity-boundary.md
Last Updated: 2026-02-18

Overview

PF-71 defines the patient identity boundary so CL and PM do not depend on each other. A single PF-owned table pf_patient_identities holds minimal identity (id, organization_id, mrn); PM-01 and CL-01 reference it via FKs. Demographics remain in PM-01; chart and clinical data reference identity only.

Integration Points (from Spec)

ConsumerPatternPurpose
PM-01Data (FK + write)On patient registration: create or link row in pf_patient_identities; set pm_patients.patient_identity_id.
CL-01Data (FK, read)Chart links via cl_patient_charts.patient_id REFERENCES pf_patient_identities(id). Demographics resolved via Platform Integration Layer (e.g. hook from @/platform/clinical) reading PM-01 data.

Data Contract

  • Table: pf_patient_identities (id, organization_id, mrn, created_at, updated_at, created_by, updated_by). UNIQUE(organization_id, mrn).
  • RLS: Org-scoped via pf_has_org_access(organization_id, auth.uid()); SELECT/INSERT/UPDATE/DELETE with USING and WITH CHECK.
  • PM-01: Adds pm_patients.patient_identity_id (FK + index) in PM-01 migration; owns create-or-link logic on registration.
  • CL-01: Uses cl_patient_charts.patient_id REFERENCES pf_patient_identities(id) (already in CL-01 spec); no direct PM dependency.