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

# Patient Identity Boundary — Integration

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

**Feature ID:** PF-71\
**Status:** ✅ Implemented\
**Spec Reference:** [PF-71-patient-identity-boundary.md](../../../specs/pf/specs/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)

| Consumer | Pattern           | Purpose                                                                                                                                                                                                |
| -------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PM-01    | Data (FK + write) | On patient registration: create or link row in `pf_patient_identities`; set `pm_patients.patient_identity_id`.                                                                                         |
| CL-01    | Data (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.

***

## Related Docs

* [CROSS\_CORE\_INTEGRATIONS.md](./CROSS_CORE_INTEGRATIONS.md) — PF-71 row (patient identity boundary)
* [PM-01-patient-registration-demographics-INTEGRATION.md](./patient-registration-demographics-integration.md) — Identity creation/link
* [CL-01-patient-chart-clinical-summary-INTEGRATION.md](./patient-chart-clinical-summary-integration.md) — Chart ↔ identity
