FC Buildathon · HelenisCare · status
Future Caribbean · Healthcare Systems & Delivery

The Agentic Care
Coordination Layer

An always-on agentic layer over fragmented Caribbean healthcare. One immutable event ledger, two coordinating agent families, one human-reviewed queue. Agents wake on ledger events — they do not poll — and never decide; they flag, explain, and route to a clinician.

1 event ledger 2 agent families 1 review queue 4 severity tiers human-in-the-loop wake-on-event · no polling
Provenance: Konte proved the immutable double-entry ledger in production accounting. HelenisCare proved the clinical domain — a working HIS with referrals, pharmacy, an append-only audit spine and a live decision-support feature. This layer is the fresh agentic work that unifies them.
Core information flow

How an event becomes a reviewed decision

Every status change in a HelenisCare module lands on the append-only ledger. A database trigger wakes a dispatcher; a deterministic check runs first; the expensive model runs only when something is worth reasoning about.

Agentic system / ledger Deterministic check / flag Human-in-the-loop / cleared Escalation
HelenisCare modules · event sources
Referrals+ federation hub
Pharmacyprescriptions
Triagevitals context
Consultationsdiagnoses
Laboratoryresults
emit status-changing events▼
Care event ledger
Append-only · rules block UPDATE / DELETE
The source of truth. Obligations and their resolutions are themselves recorded as events.
referral.created referral.missed referral.stalled prescription.issued prescription.filled obligation.raised obligation.cleared obligation.escalated
AFTER INSERT trigger → pg_net · fire-and-forget▼
Dispatcher + deterministic pre-filter
Check before you reason
Referral: timeline / stall evaluation.  Prescription: normalize drug name to RxNorm, check the authoritative interaction dataset. The LLM is never the interaction authority.
only flagged events proceed to reasoning▼
Agent family · backbone
Referral coordination
Monitor stalled states · chase next steps over WhatsApp · escalate. Built on the real referral + federation substrate.
Agent family · flagship
Medication safety
Interpret the deterministic finding in patient context — age, conditions, duplicate therapy, severity — and draft a plain-language explanation.
both call the shared model gateway · raise an attributed obligation▼
Review queue · human-in-the-loop
Attributed obligation, awaiting a human
Every obligation carries the agent's rationale, its severity, and the deterministic findings behind it. A pharmacist or clinician clears or escalates.
clears / escalates▼
Decision
Recorded as a ledger event ↺
The human's decision loops back onto the ledger — a closed, fully attributed audit trail.
Outbound · Twilio
WhatsApp follow-up
The coordination channel of Caribbean healthcare — sent to the patient or the referring clinician.
Cross-cutting rails Model gateway — one interface, Claude as the qualified provider Audit — agent_runs + audit_log Twilio — WhatsApp channel
Two end-to-end flows

The same spine, two obligations

Both families emit onto one ledger and land in one queue. Numbered because each is a genuine sequence a judge can watch end to end.

Flagship Medication safety

Deterministic → reasoning → human. Never blocks, never prescribes.

  1. 1
    Prescription issued
    A clinician prescribes; prescription.issued lands on the ledger.
  2. 2
    Deterministic check
    Drug name → RxNorm → interaction dataset. A real interaction is found.
  3. 3
    Contextual reasoning
    The agent explains the finding for this patient — age, conditions, timing, severity.
  4. 4
    Pharmacist reviews
    A medication_flag obligation appears with rationale; the pharmacist clears or escalates.
  5. 5
    Decision on the ledger
    The clearance/escalation is recorded as an event — closed loop.

Backbone Referral coordination

On the real referral + federation substrate. The "front door."

  1. 1
    Referral created
    A referral is raised across the network; the ledger records the chain.
  2. 2
    Timeline watch
    The monitor sees no next step past the expected window → referral.stalled.
  3. 3
    WhatsApp follow-up
    The follow-up agent chases the next step over Twilio WhatsApp.
  4. 4
    Escalation raised
    Threshold trips → a referral_escalation obligation in the same queue.
  5. 5
    Clinician resolves
    A human acts; the decision is recorded — the patient no longer falls through the cracks.
The safety model

Three layers, one fixed order

The order is non-negotiable and it is the pitch: an authoritative dataset decides what is true, the model only interprets, and a human always owns the decision. Framed the way the founder thinks — in accounting terms.

Layer 1
Deterministic
"the chart of accounts"
The authoritative checking core
Drug names normalize to RxNorm; ingredient pairs check against DDInter — the deterministic authority. It grades every finding into one of four tiers: major, moderate, unclassified, minor. The LLM is never the source of truth.
Layer 2
Reasoning
"the accountant"
The agent interprets in context
Only when the deterministic layer flags: the model drafts a plain-language explanation for this patient — age, conditions, duplicate therapy. It can never raise or lower a severity — enforced in code and by the eval harness. The expensive model never runs on every prescription.
Layer 3
Human
"the decision"
A clinician clears or escalates
The agent flags and explains — it never blocks, prescribes, or diagnoses. The human decision is itself a ledger event. Positioning everywhere: clinical decision support.
The flagship, deepened

A governed severity index, on a classification clock

Beyond the original plan: the medication-safety flag is deepening into a four-tier severity index with a classification SLA and a UK-first medical-device compliance posture behind it. The deterministic dataset owns the tier; a human owns the decision.

Status: LIVE end-to-end — merged, schema-applied, and the dispatcher runtime is deployed and verified: a synthetic unknown-severity wake now flows through the real trigger → dispatcher chain and is written as an unclassified obligation. The running app serves the governed mapping today, and the classification-SLA clock is active. Enforced in code and by the eval harness.

Severity tiers · DDInter is the authority
Four tiers, and one of them is a governed decision
The LLM drafts the explanation but can never raise or lower a tier — enforced in code and by the eval harness.
major — pages a human moderate — logged for review unclassified — a clinician must classify minor — recorded
“Unclassified” is the honest tier. DDInter evidence exists but the severity is unknown. Rather than fold unknown-severity evidence into “minor” — the one tier nothing ever chases — the classification model gives it its own tier: evidence exists, severity unknown, a clinician must classify it. A governed decision, not a default. (The dispatcher runtime is deployed and verified — the running app now serves this mapping; unknown-severity evidence is no longer folded into “minor.”)
SLA Escalation is a classification clock

A major flag pages the prescriber and the on-call at t=0, reminds at +30, and re-pages the Medical Director at +60. Unclassified reminds but never pages; moderate logs. The clock starts at WhatsApp delivered, set by Twilio's live status callback — a never-delivered alert is treated as the faster hazard, not a pass. Live end-to-end — merged, schema-applied, and the dispatcher runtime is deployed and verified.

REG A real compliance posture

UK-first: the severity index is a Class I medical device under MHRA / UK MDR 2002, designed to the EU MDR ceiling. Clinical risk management is modelled on ISO 14971 and NHS DCB0129, with a hazard log — every regulatory claim traced to a primary source. In final review.

Module interaction

How the agentic layer touches HelenisCare

It reads widely for context and writes narrowly — only ever the ledger, obligations, follow-up messages, and human-confirmed referral status. It never mutates a clinical record directly.

ModuleWakes agent onAgent readsAgent writes
Referrals / FederationReferrals.jsx · referrals broker · hub referral.* status, timeline, chain, pathways, vitals snapshot stalled event, follow-up, escalation obligation; status via broker (human-confirmed)
Pharmacy / Prescriptionsmedications · drug_catalogue · dispensing_log prescription.issued patient meds, active diagnoses, age medication_flag obligation + rationale
Triagetriage_records — latest vitals for context read-only
Patientspatients · diagnoses — demographics, active conditions read-only
Outpatient / Labsoutpatient · lab_results — recent results for reasoning context read-only
Auditaudit_log · logAudit · agent_runs — — every agent turn + tool call (telemetry)
Review Queuenew HIS surface · reuses referral-inbox pattern — open obligations human decisions → ledger events
Existing CDSdifferential-dx — — pattern reused, not a runtime dependency
The rule: reads widely, writes narrowly. The clinical record stays under human control; the agentic layer only ever appends to the ledger, raises obligations, sends follow-ups, and applies human-confirmed referral status.
Why it is efficient

Thoughtful, not compute-heavy

The rubric rewards systems that are efficient by design. Two mechanisms keep model calls rare and deliberate.

01 Wake on events, don't poll

A database trigger fires pg_net the instant an event lands. No cron loops scanning the whole table on a schedule.

before HelenisCare polls daily via pg_cron now agents wake the moment an event is written
02 Deterministic pre-filter

The authoritative check runs first, cheaply. The expensive model is invoked only when there is genuinely something worth reasoning about.

naive model on every prescription here model only on a flagged interaction