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

# Secure Messaging — Integration

> Version: 1.0 Last Updated: 2026-02-21 Spec: PM-14 Secure Messaging Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns)

**Version:** 1.0\
**Last Updated:** 2026-02-21\
**Spec:** [PM-14 Secure Messaging](../../../specs/pm/specs/PM-14-secure-messaging.md)\
**Constitution Reference:** Section 1.2 (Core Independence), Section 1.3 (Integration Patterns)

***

## Overview

PM-14 provides PHI-compliant secure messaging between patients, providers, and care teams (threading, attachments, retention, routing, notifications). Integrations use Platform Integration Layer and documented dependencies; cross-core integration with CL is via explicit contracts (no direct core-to-core imports).

***

## Integration Points (from spec)

| Dependency | Pattern               | Purpose                                       |
| ---------- | --------------------- | --------------------------------------------- |
| **PM-12**  | Platform Layer / Data | Patient portal messaging interface            |
| **PF-10**  | Platform Layer        | Urgent message notifications                  |
| **CL-01**  | Platform Layer / API  | Clinical messages documented in patient chart |
| **CL-11**  | Platform Layer / API  | Part 2 SUD message restrictions               |

***

## Event / API Contracts

* **PM-12:** Patient portal messaging UI consumes PM-14 conversations/messages via `pf_conversations` with `patient_id` filter.
* **PF-10:** Domain events `pm_message_sent` and `pm_urgent_message_sent` published from `usePmSendMessage` hook; PF-10 listens for urgent messages to trigger in-app/email notifications.
* **CL-01:** Chart documentation of clinical messages; PM sets `chart_documented` metadata flag when note is created/linked in CL. Contract: metadata field on `pf_messages`.
* **CL-11:** Part 2 SUD restrictions on SUD-related messages; stub ready for consent/access-check integration when CL-11 is implemented.

***

## Integration Matrix

| From       | To    | Pattern                       | Doc      |
| ---------- | ----- | ----------------------------- | -------- |
| PM (PM-14) | PM-12 | Platform Layer / Data         | This doc |
| PM (PM-14) | PF-10 | Platform Layer / Event        | This doc |
| PM (PM-14) | CL-01 | Platform Layer / API or Event | This doc |
| PM (PM-14) | CL-11 | Platform Layer / API          | This doc |

***

## References

* [PM-14 Spec](../../../specs/pm/specs/PM-14-secure-messaging.md)
* [CROSS\_CORE\_INTEGRATIONS](./CROSS_CORE_INTEGRATIONS.md)
