| import { useOncologyStore } from '../store/useOncologyStore'; |
|
|
| |
| |
| |
| |
| |
| 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(); |
| |
| |
| store.setMutation(test.input); |
| |
| |
| await store.fetchMatches(); |
| |
| |
| 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 ---"); |
| }; |