MVP Flow
This page is the map of the full journey of the clinician. The map comes from the code (apps/web), not from memory. One clinician uses one authenticated session. From the console, the clinician has two product lanes. Lane B is the MVP. Extraction and registry submission are the two hinges of the flow. Each of the two depends on a configuration flag.
| Term | Meaning |
|---|---|
| Lane | One product journey from the console. The console has two lanes: Lane A and Lane B. |
| Wedge | Lane B: the registry that is graded by completeness. It is the MVP. |
| Moat | The advantage of the product. The wedge builds the moat. |
| Gate | A condition that stops the next step. |
| Flag | A configuration variable that turns a function on or off, for example QUEUE_ENABLED. |
| Decision point | A branch, a gate, or a conditional state in a screen. At a decision point, the flow branches and we make product decisions. |
| Grade | The completeness verdict of a note. The /consola/notas/:id/calificacion screen shows the grade. |
| Owner | The physician of the draft (draft.medicId === me.id). |
Each screen has one of four statuses:
| Status | Meaning | In Figure 1 |
|---|---|---|
| Shipped | The screen is in production and is accessible. | Solid border |
| Behind a flag | The screen is conditional. A flag controls it. | Dashed border |
| Not built | The function is pending or is a stub. | Dashed border, gray |
| Separate app | The function is in a different app (app.rheumai.xyz or the landing). |
Gray, solid border |
The journey
Section titled “The journey”Figure 1 shows the full journey. First, the clinician signs in. Then, the clinician selects a lane from the console home. At the end, one record gives three outputs.
The Lane B screens use the /consola/notas/* routes. The old /consola/biobadamex/* routes redirect to the equivalent /consola/notas/* route. The redirect keeps the draft id and the query. Thus old bookmarks and the review links already sent through WhatsApp continue to work.
The Lane B journey
Section titled “The Lane B journey”Lane B has six steps. The numbers in Figure 2 are the numbers in this list.
- Intake. The clinician uploads notes in
/consola/notas/subir, or sends a file through WhatsApp. - Inventory. The note goes into the inventory at
/consola/notas. - Extraction. The clinician selects “Extract”. The system extracts and grades the note. This step depends on
QUEUE_ENABLED. - Review. The clinician opens the review gate at
/consola/notas/:id. The “Review note” button in the inventory opens this screen. The review link in the WhatsApp milestone also opens this screen. The clinician confirms each row of the checklist by variant. - Approval. The owner approves the record. The approval needs all checks.
- Submission. The owner submits the record. Submission needs
SUBMIT_ENABLED=1. The submission goes through pg-boss and Tenki to the BIOBADAMEX registry.
The grade screen (/consola/notas/:id/calificacion) is not a step of this sequence. No screen in the app links to it. The clinician opens it only with the direct URL. Each prompt resolves to acted or dismissed. Acted and “Go to the full review” open the review gate of the same note.
Each screen, each decision point
Section titled “Each screen, each decision point”| Screen | Purpose | Decision points and gates | Status |
|---|---|---|---|
/iniciar-sesion: Sign in |
Login that Privy hosts. | After authentication, the screen returns to ?next=. For example, a review link that the clinician opens from WhatsApp returns to that review. |
Shipped |
/solicitar-acceso: Request access |
Fail-closed gate. An authenticated physician who is not approved requests access here. | useAccessStatus has 4 states. none: form (name, cédula, specialty, and consent). pending. approved: “Enter” button. rejected. The screen shows in the side shell with logout. The server seals the email. |
Shipped |
/consola/perfil: Onboarding |
First-time profile (name, specialty, cédula). | The gate is in Shell: canUseApp = onboarded || role==="admin". Admins skip this gate. If a physician without onboarding opens a different route, the app sends the physician here. |
Shipped |
/consola: Home |
RheumAI home: “New consult” and the recent consults. | States: loading, empty, and list. Rows with a draftId link to the Approval editor. It is the entry of Lane A: the consult product. Lane A is not the wedge. |
Shipped |
/consola/notas: Inventory |
One list for the full wedge. The status is a filter, not a screen. | The status filter has a smart default. Order: review, not extracted, in progress, approved, submitted, rejected, all. The channel filter (whatsapp, console, bulk) is independent. The channel filter shows only with more than 1 channel. Batch “Extract” shows only in the “not extracted” filter. | Shipped |
/consola/notas/subir: Upload |
Intake from the console. | Two modes. Paste: extraction starts immediately. File: the note stays in the inventory, and extraction occurs later. It accepts .docx .doc .pdf .txt, 25 files maximum. Extraction depends on QUEUE_ENABLED. |
Shipped |
| WhatsApp file-drop (server, no screen) | The native chat intake lane. | Whitelist, or pass-through to triage. Steps: consent (ACEPTO/BAJA), document classification by extension, fail-closed clinical auth, exactly-once acknowledgment, intake (shared core), and PHI-free milestones. The coach uses a different flag (BIOBADAMEX_WHATSAPP_COACH_ENABLED). This flag is off by default. |
Behind a flag |
/consola/notas/:id: Review gate |
Completeness review and approval that the clinician cannot skip. The screen does not edit the record silently. It only approves, rejects, or corrects. | Checklist by variant. RA: tender joint count, swollen joint count, DAS-28, ESR, CRP. Vasculitis: BVAS. SLE: SLEDAI (not required; a clinical owner is pending). SSc: Valentini/EUSTAR. SpA and Sjögren: no required instrument. Approval gate: diagnosis resolved, each row confirmed, and biologic episodes confirmed. “Correct” resets all confirmations. This screen has no “Second opinion”. | Shipped |
…/:id → Submit: Registry submission |
Sends the approved record to BIOBADAMEX (pg-boss → Tenki). | It shows only on the terminal (approved) screen. Owner only (draft.medicId === me.id). Admins see text, with no button. Hard gate: SUBMIT_ENABLED=1. If Charlson comorbidities are not documented, the physician must select a “confirm absence” checkbox. |
Behind a flag |
/consola/notas/:id/calificacion: The grade |
The first impression of the physician, and the source of the moat. The screen shows the verdict before any question. | No screen links to this route; the clinician opens it with the direct URL. One prompt for each missing field. Each prompt resolves to acted (goes to the review gate) or dismissed (with a reason). The answers go into the interruption-quality log. | Shipped |
/consola/borradores/:id: Approval editor (Lane A) |
The original consult approval screen: diagnosis and treatment decisions. | The clinician cannot skip it: the clinician confirms all rows before approval. The screen flags low-confidence codes. After approval, “Share” makes a patient magic link. | Shipped |
/p/plan: Patient plan |
Read-only view by token, with no login. It is the result of Lane A. | The view is complete: treatment compared with plain language, and provenance. It has one stub: “Ask RheumAI · coming soon”. | Shipped (+ stub) |
Where the launch gates apply
Section titled “Where the launch gates apply”This table comes from the gate register (workstreams/biobadamexai/LAUNCH-GATES.md). Each gate is at its location in the flow. Severities:
- Blocker: resolve before the public launch.
- CDSS: resolve before we announce “Ask” as cited clinical decision support.
- Build: a promised surface that is not wired yet.
| Gate | Severity | Where it applies |
|---|---|---|
| G8 · G9: Privy origins and auth smoke test | Blocker | Sign-in step. Login does not work off-domain until the origins are allowed. |
G4: protect GET /api/registry/queue |
Blocker. The gate register says open. On main, the route already requires the Privy session and the physician allowlist (PR #133); the register row is stale. |
app.rheumai.xyz (separate app, apps/bioagent) |
| G5: WhatsApp intake | Blocker. The gate register says “model decided, branch reviewed, enablement open”. The intake is already in production; the register row is stale. | WhatsApp file-drop lane |
| G5c: WhatsApp coach | Build (fast-follow to G5). The gate register says “built, behind a flag, not pushed”. The coach is already merged to main and runs in production behind a flag; the register row is stale. |
WhatsApp file-drop lane |
| G5b: patient-triage auto-reply bypass | Blocker (patient-facing). The gate register says open. The whitelist isolates it from the pilot. |
Pass-through route |
| G1 · G2 · G3: “recommends, does not diagnose” guardrail, unverified statistics, unify citations | CDSS | “Ask” output. This output can ship with a limited scope without these gates. |
| G6: Patient Plans wiring | Build | Plans output. Lane A already makes /p/plan. The chat in the plan is the stub. |
| G10: field-dictionary drift check | Build | Review gate |
| G7: “Ask” block on the landing (design) | Build | Landing |
Open decisions
Section titled “Open decisions”The map leaves these decisions open for the MVP flow. We make them during the walkthrough.
- Is “Ask / Second opinion” in the MVP, and from where? The console does not have this function wired. The review gate has no second-opinion UI.
consultRheumaSupportis dead code. The function is only in the separateapp.rheumai.xyzapp. Decide: link to that app, wire the function, or remove it from the MVP framing. - Two lanes or one? The console has the original consult → plan product (Lane A) and the BiobadamexAI wedge (Lane B). The rebrand keeps the two lanes in the top-level navigation. For the MVP, decide: is Lane A in scope, or is the launch only the wedge?
- Where does the clinician arrive first, and what does the clinician see? The console home is the original consult surface, not the wedge. Some clinicians come for BIOBADAMEX. Decide: does
/consolaopen with the wedge (notes to review) instead of “New consult”? - SLEDAI and the required sets by variant. The screen shows the SLE instruments, but they are not required (a clinical owner is pending). SpA and Sjögren do not require an instrument. The set of required fields by variant is the definition of completeness. This set needs clinical sign-off before we grade real notes.
- Is registry submission active for the pilot? Submission is owner only and has the hard gate
SUBMIT_ENABLED. Confirm the flag position for the 20-physician pilot. Options: the physicians submit to the live registry, or they stop at “approved” while we validate the loop.