| from __future__ import annotations | |
| from .models import CaseClassification, DecisionOutput | |
| def render_alert_banner(decision: DecisionOutput) -> str: | |
| if decision.classification == CaseClassification.SUSPECTED: | |
| icon = "🚨" | |
| label = "SUSPECTED EVD CASE ALERT" | |
| elif decision.classification == CaseClassification.PROBABLE: | |
| icon = "🚨" | |
| label = "PROBABLE EVD CASE ALERT" | |
| else: | |
| return "" | |
| evidence_lines = "\n".join(f"- {item}" for item in decision.evidence) or "- No evidence captured" | |
| return ( | |
| f"{icon} **{label}**\n\n" | |
| f"**Evidence**\n{evidence_lines}\n\n" | |
| f"**Rule Triggered**\n{decision.triggered_rule}\n\n" | |
| f"**Recommended Action**\n{decision.recommended_action}" | |
| ) | |
| def render_classification_panel(decision: DecisionOutput) -> str: | |
| return ( | |
| f"**Classification:** {decision.classification.value}\n\n" | |
| f"**Rule:** {decision.triggered_rule}\n\n" | |
| f"**Recommended Action:** {decision.recommended_action}" | |
| ) | |