Skip to content

BiobadamexAI architecture

The React console uses one note list for daily work. Filters show what needs attention. Review screens show source, structured record, corrections, treatment episodes, and a separate submission confirmation.

Mounted surfaces include intake, uploads, drafts, RheumAI audit, dedicated agent, and PHI-light lifecycle routes. Console routes require authentication, resolved user, and research access. Machine-to-machine routes use separate service keys.

R2 holds encrypted original files. PostgreSQL stores metadata, jobs, drafts, audit, and submission outcomes. agentRecord is the immutable extraction; record is the clinician-correctable copy. Draft source text is encrypted when master-key configuration is available.

pg-boss separates extraction from registration. Workers register only when BIOBADAMEX_QUEUE_ENABLED=1. Extraction has retries and dead letter. Registration is a separate queue processed one at a time per worker. Multiple app instances need extra coordination for global serialization.

@pokta/biobadamex-registry owns the record schema, unknown semantics, disease rules, DAS-28, job contracts, external field map, corrections, and completeness.

A Playwright worker runs in a disposable microVM. It logs in, traverses crdA through crdE, reads idpac after crdA, and requires the final summary to show the same id.

Boundary Controls Does not prove
Extraction Turns note into typed record Every value is correct
Clinical review Corrects and approves External platform received every field
Worker confirmation Reads idpac and summary Field-by-field read-back