Version: 2.1.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2026-03-23
Constitution Reference: Section 1.3 (Integration Patterns)
Note: This document consolidates content from the previous INTEGRATION_CONTRACTS.md (archived 2025-01-22). For detailed event and API contracts, see the specific contract files listed below.
This directory holds cross-core integration docs for the Encore Health OS Platform. Integrations should be documented here before implementation.
Status Legend
All integration documentation uses consistent status indicators:- ✅ Implemented - Fully implemented, tested, and production-ready
- 🟡 In Progress - Partially implemented, actively being developed
- 📝 Planned - Specified in specs but not yet implemented
- ❌ Deprecated - No longer recommended, will be removed in future version
- 🔄 Breaking Change - Recent breaking change, migration guide available
- All implemented integrations include “Last Verified” date
- Planned integrations include “Spec Reference” link
- Breaking changes include migration guide link
Integration Doc Naming (Canonical)
| Use Case | Pattern | Example |
|---|---|---|
| Feature-specific (single core) | {CORE}-##-{feature-kebab-case}-INTEGRATION.md | CL-01-patient-chart-clinical-summary-INTEGRATION.md, HR-10-performance-management-INTEGRATION.md |
| Cross-core (two cores) | {CORE1}-{CORE2}-{feature-kebab-case}-INTEGRATION.md | CL-PM-ENCOUNTER-TO-BILLING.md, RH-HR-INTEGRATION.md |
| Core-wide contract bundle | {CORE}_INTEGRATION_CONTRACTS.md | IT_INTEGRATION_CONTRACTS.md, HR_ATS_CONTRACTS.md |
validate-spec / generate-tasks references integration doc paths. See specs/_templates/INTEGRATION_CONTRACT_TEMPLATE.md for the template.
Maintenance and crosswalk: INTEGRATIONS_CROSSWALK.md (spec links, dedupe guidance, known gaps).
Bloat control for feature integration docs
For{CORE}-##-*-INTEGRATION.md files:
- Keep them delta-focused (feature-specific integration details only).
- Do not duplicate platform-wide rules that already live in
PLATFORM_INTEGRATION_LAYERS.md,EVENT_CONTRACTS.md, orAPI_CONTRACTS.md. - Prefer links to canonical contract docs over repeated boilerplate sections.
Documentation Structure
Platform Integration Layers
Shared utilities in/src/platform/ that provide cross-core capabilities without violating architectural boundaries.
Includes:
- Forms Integration (PF-08)
- Workforce Integration
- Data Lookup (PF-15)
- Custom Fields (PF-16)
- Field Configuration (PF-17)
- Notifications (PF-10)
- Documents (PF-11)
- Reports (PF-12)
- AI Integration (PF-27)
LO Integration Contracts
Leadership OS entry point:lo_events, goals/event specs (LO-16), links to EVENT_CONTRACTS.md LO sections.
IT Integration Contracts
IT module event contracts, API contracts, and platform layer usage. Includes:- Asset lifecycle events (purchased, assigned, maintenance, disposed)
- License management events (created, renewed, expiring, compliance)
- Support ticketing events (created, status changed, SLA breached)
- Security events (incident, vulnerability, patch overdue)
- Procurement events (submitted, approved, received)
- API contracts for asset/vendor lookup
Event Contracts
Asynchronous event-based integration patterns using PostgreSQLpg_notify and edge functions.
Includes:
- Event schema standards
- Implemented events registry
- Planned events registry
- Event delivery mechanism
- Event testing patterns
Event delivery guide
How to choose table-driven FW automation vs HTTP event-consumer vs realtime vs outbound webhooks (R-FW-12). Complements EVENT_CONTRACTS.md.API Contracts
Synchronous request-response APIs for direct data queries between cores. Includes:- API contract standards
- Implemented APIs
- Planned APIs
- Authentication and rate limiting
- Error handling patterns
External Integrations
Catalog of external (out-of-platform) integrations: clearinghouse, payer ePA, PDMP, HIE, EPCS, lab. Status 📝 Planned until implemented. Includes:- Clearinghouse (X12 837/835/270-271/276-277)
- Payer FHIR ePA (Da Vinci CRD/DTR/PAS)
- Arizona CSPMP (PDMP), Contexture (HIE), EPCS/Surescripts, RTPB, Lab/LIS
Cross-Core Integrations
Integration matrix showing “who talks to whom” across all cores. Includes:- Integration matrix table
- Integration by core (publisher/consumer)
- Dependency graph
- Quick reference guide
Data Models
Core data models and their integration points. Includes:- LO Core data model
- Integration points per core
- RLS security functions
- Key design decisions
Source of Truth Precedence
For event names and schemas, the order of precedence is:- Database/Registry:
fw_workflow_eventstable (definitive registry) - TypeScript Types:
KnownEventNameinsrc/platform/events/types.ts(must match registry) - Documentation:
EVENT_CONTRACTS.md(narrative and payload schemas) - Matrix:
CROSS_CORE_INTEGRATIONS.md(cross-references)
- Implementation: Edge functions and RPC functions (definitive)
- Documentation:
API_CONTRACTS.md(schemas and usage) - Feature Docs:
{CORE}-##-*-INTEGRATION.md(detailed contracts)
Integration Patterns Overview
The platform supports three integration patterns (Constitution Section 1.3):- Pattern 1: Platform Integration Layer - Shared utilities in
/src/platform/ - Pattern 2: Event-Based Integration - Async workflows via domain events
- Pattern 3: API Contracts - Synchronous request-response with versioned schemas
import { x } from '@/cores/fa/...' inside RH)
Cross-Core FK Exception: By default, cross-core references use UUID columns with no database FK. A scoped exception allows CL tables to reference pm_encounters.id via FK with ON DELETE RESTRICT. See ADR-002 and constitution §1.2, §5.2.7.
Quick Reference
When to Use Each Pattern
Use Platform Integration Layer when:- Multiple cores need the same functionality
- You need reusable UI components or hooks
- The functionality is domain-agnostic
- Examples: Forms, Workforce, Data Lookup, Custom Fields
- You need loose coupling between cores
- Workflows are asynchronous
- You want audit trails of state changes
- Examples: Resident admission → Billing account creation
- You need synchronous request-response
- Real-time data queries are required
- Event-driven patterns are not suitable
- Examples: Episode balance queries, Employee lookups
Integration Checklist
Before implementing a new integration:- Integration pattern chosen (Pattern 1, 2, or 3)
- Contract documented in appropriate file
- Schema defined (TypeScript types or JSON Schema)
- Versioning strategy defined
- RLS policies verified for tenant isolation
- Integration tests written
- Documentation updated
- Breaking changes approved (if applicable)
Versioning Strategy
Breaking Changes
Breaking changes to integration contracts MUST:- Be documented with version bump
- Include migration guide for consumers
- Maintain backward compatibility for 90 days minimum
- Require explicit approval from technical owner
Version Format
- Platform Integration Layer: Semantic versioning (e.g., v1.0.0 → v2.0.0)
- Event Schemas: Version in payload metadata (e.g.,
event_version: '1.0') - API Contracts: Version in URL path (e.g.,
/api/v1/fa/resident-balance)
Testing Requirements
All integrations MUST have:- Unit Tests: Mock integration points
- Integration Tests: Test actual event/API flow
- RLS Tests: Verify tenant isolation
- E2E Tests: Test complete cross-core workflows
Anti-Patterns
❌ DO NOT:
-
Direct Core Imports:
-
Shared Database Tables:
-
Hidden Dependencies:
✅ DO:
-
Use Platform Integration Layer:
-
Publish Domain Events:
-
Explicit API Contracts:
Audit & Enforcement
Usenpm run audit:integration-contracts to verify that every spec under specs/{core}/specs/ is referenced in at least one canonical integration contract surface (or explicitly allowlisted as intra-core only).
docs/architecture/integrations/.intra-core-only.json. Each entry MUST include id, rationale, owner, and added (ISO date). The allowlist is reviewed quarterly by the Architecture team; default disposition is to add a contract row, not allowlist.
Resolution per gap: choose ONE of:
- Add a row to
EVENT_CONTRACTS.md,API_CONTRACTS.md,PLATFORM_INTEGRATION_LAYERS.md, orCROSS_CORE_INTEGRATIONS.md. - Append to a core bundle doc (
IT_INTEGRATION_CONTRACTS.md,FM_INTEGRATION_CONTRACTS.md,LO-INTEGRATION-OVERVIEW.md,HR_ATS_CONTRACTS.md). - Create a feature-specific
{SPEC-ID}-{slug}-INTEGRATION.md. - Add an entry to
.intra-core-only.jsonwith rationale (intra-core only with no cross-core surface).
npm run validate:governance (promoted from warn-only on 2026-04-17 once the Q2 closure waves brought open gaps to 0; historical record archived at docs/archive/integrations/_GAP_TRIAGE_2026Q2.md).
Maintenance Guidelines
Review Cycle
- Quarterly: Review all integration documentation for accuracy and re-run
npm run audit:integration-contracts; fold any new gaps into next-sprint planning. - After each release: Verify implemented integrations match documentation
- Before breaking changes: Update documentation and notify consumers
Update Triggers
- New integration added
- Spec change affecting integration
- Breaking change to existing integration
- Implementation status change (Planned → Implemented)
Ownership
- Platform Integration Layers: Platform Foundation team
- Event Contracts: Core teams (publisher owns documentation)
- API Contracts: Core teams (provider owns documentation)
- Cross-Core Matrix: Architecture team
Quality Checklist
- Status indicators accurate (✅ Implemented / 📝 Planned)
- Code examples use real, working code
- All required fields documented
- Links to related specs and implementation code
- Last verified date included
- Breaking changes documented
Related Documentation
- Integration Examples - Code examples and patterns
- Constitution (current: see docs/VERSIONS.md) - Engineering guardrails
- AI Guide (current: see docs/VERSIONS.md) - AI contribution guidelines
- Architecture README - Architecture documentation overview
Cross-References
Integration Documentation Links
Platform Integration Layers:- Forms (PF-08) - Spec: FW-03
- Workforce - Spec: HR-01
- Data Lookup (PF-15) - Implementation:
src/platform/data-lookup/ - Picklists (PF-15) - Spec: PF-15, Implementation:
src/platform/picklists/ - Custom Fields (PF-16) - Implementation:
src/platform/custom-fields/ - Field Configuration (PF-17) - Implementation:
src/platform/field-config/ - Data Manager (PF-23/24/25/26) - Spec: PF-23, Spec: PF-24, Implementation:
src/platform/data-manager/ - Notifications (PF-10) - Implementation:
src/platform/notifications/ - Documents (PF-11) - Implementation:
src/platform/documents/ - Reports (PF-12) - Implementation:
src/platform/reports/ - AI (PF-27) - Spec: PF-27, Implementation:
src/platform/ai/ - Page Layouts + Conditional Logic (PF-31/PF-32) - Spec: PF-31, Spec: PF-32
- FW-03 Form Submission Events - Spec: FW-03
- HR-02 Credential Events - Spec: HR-02, HR-04 Integration
- FA Financial Events - Spec: FA-03
- RH Compliance Events - Spec: RH-06
- RH-01 Bed Board & Census Integration - Bed board,
facility_type(recovery_housing | psychiatric_residential | inpatient_unit), census data for HR/PM, event payloads (resident_admitted,resident_discharged,bed_assigned,bed_released,invoice_creation_requested), CL current-residence API - Spec: RH-01, RH-01.1
- IT-01 Asset Management - Spec: IT-01
- IT-02 Support Ticketing - Spec: IT-02
- IT-03 Vendor Management - Spec: IT-03
- IT-04 License Management - Spec: IT-04
- IT-05 Security Compliance - Spec: IT-05
- IT-06 Procurement - Spec: IT-06
- HR-20: Checkr Background Check Integration — superseded by HR-09-P5.2; see Spec: HR-20 📋 (archived:
docs/archive/architecture/integrations/HR-20-checkr-background-check-INTEGRATION.md)
- FA-01 Episode Balance Query - Spec: RH-01, FA-01
- HR-01 Employee Lookup - Spec: RH-06, HR-01
- IT Asset Lookup - Spec: IT-01
- IT Vendor Lookup - Spec: IT-03
- Cross-Core Integration Matrix - Visual overview of all integrations
- Integration Examples - Real code examples for all patterns
Next Review: 2026-04-22 (Quarterly)