Skip to main content
Version: 1.0
Last Updated: 2026-01-08
Constitution Reference: Section 1.3 (Integration Patterns), Section 5.2 (Database Design)
Purpose: Unified guide to the data management platform capabilities in Encore OS. This document explains how PF-15 (Picklists), PF-16 (Custom Fields), PF-17 (Field Configuration), PF-23 (Object Browser), PF-24 (Custom Objects), PF-25 (Raw Data Editor), and PF-26 (Object Permissions) work together.

Overview

The Encore OS data management platform provides a comprehensive set of capabilities for organizations to customize, manage, and interact with their data. These capabilities are built on Platform Foundation (PF) and provide reusable patterns for all domain cores.

Component Diagram

Legend:
  • Solid arrows: Direct dependencies (PF-16 uses PF-15)
  • Dotted arrows: Consumer relationships (cores use platform features)

Component Relationships

Data Flow

  1. Picklists (PF-15)Custom Fields (PF-16)
    • Select/multiselect fields reference picklists via picklist_id
    • Single source of truth for dropdown values
  2. Custom Fields (PF-16)Field Configuration (PF-17)
    • Field definitions are configured for visibility, ordering, permissions
    • Field Configuration manages how Custom Fields appear in UI
  3. Custom Fields (PF-16)Custom Objects (PF-24)
    • Custom objects use PF-16 field definitions for their schema
    • Reuses validation rules and field types
  4. Custom Objects (PF-24)Object Browser (PF-23)
    • Custom objects automatically appear in Data Manager
    • Unified view of core objects + custom objects
  5. Object Browser (PF-23)Raw Data Editor (PF-25)
    • Raw Data Editor is a tab in Object Browser detail view
    • Enables bulk editing of object records
  6. Object Browser (PF-23)Object Permissions (PF-26)
    • Permissions tab in Object Browser detail view
    • Configure access control per object

Decision Tree: When to Use What


Integration Patterns

Pattern 1: Platform Integration Layer

All data management features are provided as Platform Integration Layers: Usage Example:

Pattern 2: Event-Based Integration

Organizational data changes (PF-18) use event-based integration:
  • org_data_changed events published via pg_notify
  • Modules subscribe and update local data structures
  • See PF-18 spec for event contracts

Pattern 3: API Contracts

Data Manager provides query APIs for object metadata:
  • Object discovery API
  • Field metadata API
  • Record count API
  • See PF-23 spec for API contracts

Common Workflows

Workflow 1: Adding Custom Data to Core Entities

Scenario: Add “Badge Number” field to HR Employees
  1. Create Picklist (if needed) - PF-15
  2. Define Custom Field - PF-16
  3. Configure Field Layout - PF-17 (optional)
  4. Use in Forms - Module Integration
  5. View in Data Manager - PF-23

Workflow 2: Creating a Custom Entity

Scenario: Create “Clinical Licenses” custom object
  1. Create Custom Object - PF-24
  2. Add Fields - PF-16 + PF-24
  3. Import Existing Data - PF-25
  4. Configure Permissions - PF-26
  5. View in Data Manager - PF-23

Workflow 3: Managing Organization Data Structure

Scenario: Organize all objects by category
  1. Browse Objects - PF-23
  2. Edit Metadata - PF-23
  3. Manage Categories - PF-23
  4. Set Favorites - PF-23

Workflow 4: Bulk Data Operations

Scenario: Export employees, edit offline, import updates
⚠️ Security Note - PHI Protection for CSV Operations: CSV exports may contain Protected Health Information (PHI) and require additional safeguards:
  • Encryption: Ensure CSV files are encrypted at rest (disk encryption) and in transit (secure download over HTTPS)
  • Access Control: Restrict export functionality to authorized staff with appropriate permissions; verify user has {module}.{entity}.export permission
  • Audit Logging: All export and import operations are logged (who, what data, when, row counts) in pf_audit_log
  • Import Validation: Imported CSVs are integrity-checked (column validation, data type verification, row count confirmation) to detect tampering
  • Secure Handling: Downloaded CSV files should be stored in encrypted locations; delete files after import is confirmed successful
  • Offline Security: When editing CSVs offline, use password-protected devices; avoid storing on shared/unencrypted drives
  • High-Sensitivity Orgs: Organizations handling highly sensitive PHI (e.g., behavioral health clinical notes) should consider disabling CSV export entirely via organization settings; use secure API-based integrations instead
See docs/security/DATA_EXPORT_POLICY.md for complete export security guidelines.
  1. Export Data - PF-25
  2. Edit Offline
  3. Import Updates - PF-25

Quick Reference Table


Module Adoption

Legend:
  • ✅ Complete
  • ⚠️ Planned
  • ❌ Not Started / N/A

Performance Considerations

Query Optimization

  • Picklists: Cached with 5-minute staleTime (QueryClient config)
  • Custom Fields: Indexed on (organization_id, entity_type, is_active)
  • Object Metadata: Computed fields (field_count, record_count) cached
  • Raw Data: Pagination required (25/50/100 per page)

Scalability Limits


Security Considerations

Multi-Tenant Isolation

All data management features enforce organization-level isolation:
  • RLS policies on all tables (organization_id filter)
  • Application-level defense-in-depth (explicit organization_id in queries)
  • No cross-organization data access

Role-Based Access



Last Updated: 2026-01-08
Next Review: Quarterly or when new data management features are added