ระบบนี้เป็นเครื่องมือช่วยตัดสินใจทางคลินิก ไม่ใช้แทนดุลยพินิจของแพทย์·This system is a clinical decision support tool and does not replace clinician judgment. Research prototype — not a medical device, not for autonomous diagnosis.

System Architecture

Six explicit layers separate presentation, data, reasoning, governance, and evaluation. Each layer can be inspected, audited, and replaced independently.

Frontend

React + TanStack Start
Layer 1/6
  • Clinical intake form (TH/EN)
  • AI Analysis & Evidence Panel
  • Clinician review & override UI
  • Case report export (Markdown / PDF)

Backend

Lovable Cloud (managed Postgres + Auth)
Layer 2/6
  • patient_cases, ai_results
  • clinician_observations
  • case_outcomes
  • expert_validations

Knowledge Base

Curated TTM ontology tables
Layer 3/6
  • explainability_traces
  • therapeutic_directions
  • clinical_safety_rules
  • knowledge_consensus
  • ml_feature_schema / ai_response_schema

AI / Reasoning Layer

Rule-based syndrome prediction
Layer 4/6
  • Deterministic rules over symptom features
  • Outputs syndrome_id, risk_level, referral
  • Confidence + reasoning text
  • Hook-points for future ML models

Governance Layer

Safety + clinician oversight
Layer 5/6
  • Safety rule triggers → urgent_referral
  • Clinician override always wins
  • Override comparison & audit log
  • Mandatory disclaimers

Validation Layer

Expert evaluation
Layer 6/6
  • 1–5 ratings across 5 dimensions
  • Reviewer role + free-text comments
  • Dashboard aggregates by dimension/role
  • Drives thesis evaluation

Data flow


  Clinician input  ──▶  Frontend form
        │
        ▼
  patient_cases  ──▶  Rule engine  ──▶  ai_results (syndrome_id, risk, confidence)
                                          │
                                          ▼
                          Knowledge base lookup (syndrome_id)
                            ├─ explainability_traces
                            ├─ therapeutic_directions
                            ├─ clinical_safety_rules  ──▶  Safety escalation?
                            └─ knowledge_consensus
                                          │
                                          ▼
                              Evidence Panel (UI)
                                          │
                                          ▼
                       Clinician review / override  ──▶  clinician_observations
                                          │
                                          ▼
                         Case report (Markdown / PDF)
                                          │
                                          ▼
                       Expert validation  ──▶  expert_validations