Table of Contents
- Overview
- Quick Reference
- Integration Points
- Event Contract:
cl_problem_list_updated - Cross-Core Read API
- Security and RLS
- Idempotency, Retry, and Ordering
- Failure Modes
- Related Docs
Overview
CL-46 owns the longitudinal patient problem list (ICD-10-CM coded, status-managed:active, resolved, inactive, entered_in_error). Two downstream consumers depend on problem-list state:
- CL-08 (Clinical Decision Support) — re-evaluates rules (drug-disease interactions, monitoring, quality-measure gaps) when active problems change.
- PM-07 (Encounter Diagnosis Capture / Charge Entry) — pre-populates encounter diagnoses from the patient’s active problem list at encounter creation/check-in, so coders/clinicians do not re-enter chronic conditions.
@/platform/clinical) for synchronous lookups. No direct core-to-core imports.
Quick Reference
Integration Points
Event Contract: cl_problem_list_updated
Trigger
AFTER INSERT OR UPDATE OF status, icd10_code, resolved_date OR DELETE on cl_problems.
Payload (JSONB)
Action mapping
Subscribers
Cross-Core Read API
PM-07 (and any other consumer) MUST use the platform integration layer rather than queryingcl_problems directly.
pf_has_org_access(organization_id) and the cl.problems.read permission, returns only status = 'active' rows, and orders by priority ASC NULLS LAST, onset_date DESC.
Security and RLS
cl_problemshas RLS enabled withFORCE ROW LEVEL SECURITY; all CRUD policies scope byorganization_idviacl_user_has_problem_permission(action).- Cross-core reads from PM-07 execute under the calling user’s auth context — RLS still applies. The SECURITY DEFINER helper does not bypass tenant scoping; it only avoids the need for PM code to know CL table internals.
- Event payload contains no PHI; consumers MUST re-fetch via the read API to obtain ICD-10 display text or clinician description.
- Status state-machine enforcement (e.g.,
entered_in_erroris terminal) is implemented in aBEFORE UPDATEtrigger oncl_problems, not in the RLSWITH CHECKclause (which has no access toOLD).
Idempotency, Retry, and Ordering
- Idempotency key:
problem_id || ':' || action || ':' || changed_at(ISO-8601, millisecond precision). Subscribers MUST de-duplicate using this key for at least 24 h. - Ordering: Not strictly guaranteed across the
domain_eventschannel. Subscribers MUST treat events as state notifications (re-fetch on receipt) rather than authoritative deltas. - Retry: PF event dispatcher retries with exponential backoff (per PF-70 event publishing standards). Failed deliveries land in the dead-letter queue after 5 attempts.
- Backfill: On subscriber outage recovery, consumers may call the read API to reconcile state; no replay of historical events is provided.
Failure Modes
Related Docs
- Spec: CL-46-problem-list-management-icd10.md
- Tasks: CL-46-TASKS.md
- Event registry: EVENT_CONTRACTS.md →
cl_problem_list_updated - Cross-core matrix: CROSS_CORE_INTEGRATIONS.md → CL-46 row
- CL-08 CDS: CL-08-clinical-decision-support-INTEGRATION.md
- Platform integration patterns: PLATFORM_INTEGRATION_LAYERS.md
- ADR-002 (cross-core FK policy): ADR-002-cl-pm-cross-core-foreign-keys.md