Skip to main content

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.

Spec: ../../../specs/cl/specs/CL-45-allergy-adverse-reaction-tracking.md Status: ๐Ÿ“ Draft (event schemas land with Phase 3) Last Updated: 2026-05-08

Publishers

EventChannelTriggerSubscribers
cl_allergy_recordedcl_eventsINSERT on cl_patient_allergies (active, non-NKA)CL-08 (CDS), CL-15 (quality), PF-10 (notifications)
cl_allergy_status_changedcl_eventsUPDATE of clinical_status or verification_statusCL-08, CL-15
cl_allergy_alert_overriddencl_eventsINSERT on cl_allergy_alert_overridesCL-08, GR audit
cl_nka_confirmedcl_eventsINSERT/UPDATE setting nka_flagCL-08, PF-10

Payload (UUID-only, no PHI)

// cl_allergy_recorded
{
  "event": "cl_allergy_recorded",
  "publisher": "CL",
  "subscriber": ["CL-08", "CL-15", "PF-10"],
  "payload": {
    "allergy_id": "uuid",
    "chart_id": "uuid",
    "organization_id": "uuid",
    "criticality": "low | high | unable-to-assess",
    "is_sud_mat_class": false
  },
  "metadata": { "organization_id": "uuid", "user_id": "uuid", "timestamp": "iso8601", "correlation_id": "uuid" }
}
No allergen names, reaction text, or patient identifiers in payload โ€” consumers fetch via RLS-gated reads.

API Contracts (synchronous)

getActiveAllergies(chartId): AllergyForAlert[]

  • Exposed via @/platform/clinical.
  • Consumers: CL-05 medication ordering, CL-06 e-prescribing.
  • Returns active allergies filtered by RLS + cl_has_sud_consent for SUD-MAT class.
  • Shape: { id, allergen_code, allergen_class_code, allergen_display, reaction_severity, criticality }[].

Idempotency & Retry

  • All events idempotent on (event, payload.allergy_id, metadata.timestamp).
  • Subscribers MUST tolerate at-least-once delivery.

Security

  • No PHI in event payloads (constitution ยง4).
  • SUD-MAT-class payloads still emit but with is_sud_mat_class=true; consumers re-resolve via consent-gated read before disclosure.
  • Redisclosure log entry written by CL-16 / CL-20 when exporting SUD-MAT class allergies.

Open Items

  • Confirm channel name (cl_events vs spec-specific) with EVENT_CONTRACTS.md owner before Phase 3.
  • Confirm GR audit subscription mechanism (event vs trigger) for cl_allergy_alert_overridden.