import { useOncologyStore } from '../store/useOncologyStore'; /** * Validation Suite for Abyssinia v15 Protocol Mapping * Run this in the browser console or a test runner to verify * the integrity of the Clinical Hub logic. */ export const runProtocolValidation = async () => { const testCases = [ { input: 'KRAS G12C', expected: 'Sotorasib 960mg QD', minRisk: 0.20 }, { input: 'EGFR L858R', expected: 'Osimertinib 80mg QD', minRisk: 0.15 }, { input: 'ALK FUSION', expected: 'Alectinib 600mg BID', minRisk: 0.10 } ]; console.log("--- STARTING ABYSSINIA v15 VALIDATION ---"); for (const test of testCases) { const store = useOncologyStore.getState(); // 1. Set mutation store.setMutation(test.input); // 2. Trigger analysis await store.fetchMatches(); // 3. Verify resulting state const updatedStore = useOncologyStore.getState(); const latestSession = updatedStore.sessions[0]; const match = latestSession.protocol?.firstLine === test.expected; const riskValid = (latestSession.toxicity?.aeRiskScore || 0) >= test.minRisk; if (match && riskValid) { console.log(`✅ PASS: ${test.input} -> ${test.expected} (Risk: ${latestSession.toxicity?.aeRiskScore})`); } else { console.error(`❌ FAIL: ${test.input} mapping mismatch.`); } } console.log("--- VALIDATION COMPLETE ---"); };