Questionnaire trim + labeled suggestions (backend gateway + physician portal)
Backend/portal half of the Round-2 client UX. The rn_dermadetect half is a separate PR.
Questionnaire trim
Cut the symptom questionnaire to what the model actually uses (Stream-3 ablation) plus the non-visual history the clinicians value:
- Dropped (visual and/or unused by the trimmed model):
bleeding,size,shape,elevation,swelling,color,pus(+ itspus_colorAUTO row),fever.exists,fever.is_24h,hair_loss.exists,hair_loss.type. - Added:
cough(boolean; the deployed model consumescough— ~+0.6 top-1 — but the app never asked it). Folded onto the existing combined-boolean screen alongsidevesicle, so no new step. - Un-gated
vesicle: was gated onelevation is above; since elevation is dropped, vesicle is now unconditional. - Kept: age/gender (prefilled), duration, location + photos, texture, distribution, vesicle, itch, pain (+type), pregnancy, free-text.
Files
src/api_gateway/src/core/next_question/question_flow.csv— authoritative served schema (the apps fetch this viaGET /api/ai/question_schema). 41 questions now.src/api_gateway/physician_portal/src/features/assessment/engine/fallbackSchema.ts— offline fallback, kept in sync.src/api_gateway/physician_portal/src/pages/DiagnosisPage.tsx— combined-bool list →vesicle+cough.src/api_gateway/src/schemas/anamnesis.py— the dropped fields wererequiredhere (validates/red_flags+/triagebodies). Made optional so the apps don’t 422 once they stop sending them; addedcough.
Note / follow-up: dropping
feverandbleedingremoves those inputs from red-flag evaluation (they’ll read as absent). If any red-flag rule depended on them it silently stops firing — worth a review pass on the red-flag rules.
Labeled AI-suggestions UI (physician CaseDetailPage)
Replaced the raw confidence % + bar in the “Differential Diagnosis” list with tier-driven labels (this is the dermatologist’s view, not the patient’s):
- The top
highlight_countpredictions are Recommended (confident tier) or Possible (possible tier); the rest are Alternate. - Refer tier shows a low-confidence notice above the list and highlights nothing (all Alternate).
tier/confidence/highlight_count added to the DiagnosisResult type. These
come from the serving PRs (#110 merged, #112 open); the UI degrades gracefully if
they’re absent (everything renders as Alternate).
Verification
- Served schema: 41 questions, no dropped keys leak,
coughpresent,vesicleunconditional. - Backend:
next_question+anamnesistests pass (37); two schema tests repointed off the droppedbleeding/swellingexamples. Ruff clean. - Portal:
tsc -bclean.
Do-after
- rn_dermadetect gets the same trim + labeled review screen (separate PR).
- Re-fit tier thresholds (PR #114 brief) so the labels’ Confident/Possible/Refer split matches production.