Build a Medical Triage Page with Buzz Components + AI
This guide is written for beginners. Follow each step in order, copy the snippets, then use the full final code block.
Suggested AI Context
Use this for components that support AI source/reference text.
Emergency triage workflow for outpatient intake. Prioritize unstable vitals and rapid escalation clarity.Step-by-step path
Create model
Define a medical case model with triage fields.
Step 1: Create your triage data model
Start with one record that tracks key triage fields.
private sealed record MedicalCase(\n Guid Id,\n string PatientName,\n string Complaint,\n string Severity,\n string ArrivalDate,\n int? Spo2,\n bool NeedsImmediateReview,\n bool IsClosed);Step 2: Build a patient intake form
Use text, select, date, and checkbox controls for fast structured data entry.
<BuzzTextBox Label=\"Patient Name\" @bind-InputText=\"_patientName\" />\n<BuzzTextBox Label=\"Primary Complaint\" @bind-InputText=\"_complaint\" />\n<BuzzSelectBox Label=\"Triage Severity\" Options=\"@_severityOptions\" @bind-Value=\"_severity\" />\n<BuzzDatePicker Label=\"Arrival Date\" @bind-Value=\"_arrivalDate\" />\n<BuzzCheckBox Label=\"Requires immediate physician review\" @bind-Value=\"_needsImmediateReview\" />Step 3: Add workflow actions + risk banner
Use clear actions to add, seed, and clean up cases. Show warnings for high-risk conditions.
<BuzzButton Text=\"Add Case\" Variant=\"primary\" OnClick=\"AddCaseAsync\" />\n<BuzzAlert Title=\"Critical Cases Detected\" Variant=\"warning\" Dismissible=\"false\" />\n<BuzzProgress Label=\"Active high-risk ratio\" Value=\"@HighRiskPercent\" Max=\"100\" />Step 4: Add AI assistance components
Use BuzzFormAssistant for clinical note quality and BuzzSmartTable for triage analysis.
<BuzzFormAssistant AiContextSubject=\"medical-triage\" SourceText=\"@_aiContextText\" />\n<BuzzSmartTable AiContextSubject=\"medical-triage\" SourceText=\"@_aiContextText\" />Step 5: Bootstrap seed context (important for first deployment)
Enable seed-first AI so suggestions are useful before enough user memory exists.
{\n \"Buzz\": {\n \"EnableAiContextEnrichment\": true,\n \"EnableSeedKnowledgeBootstrap\": true,\n \"SeedKnowledgeFilePath\": \"seed/buzz-seed-knowledge.json\",\n \"EnableSeedKnowledgeWarmupOnStartup\": true\n }\n}Step 6: Add a seed knowledge entry
Use a subject key like medical-triage so knowledge and live memory stay scoped.
{\n \"subject\": \"medical-triage\",\n \"component\": \"BuzzFormAssistant\",\n \"title\": \"Triage escalation baseline\",\n \"text\": \"Escalate when SpO2 is below 92 or severe chest pain is present.\",\n \"tags\": [\"triage\", \"risk\", \"escalation\"]\n}Live Medical Triage Demo
Try the same flow you would build in your own project.
Recommended: Medium(Best typed match)
Recommended: Mon, May 11, 2026(Best typed match)
Clinical Note Assistant
Missing required fields
- Patient Name
- Primary Complaint
Message draft rewrite
Live Triage Board
Recommended sort: Patient
Rows: 2 / 2
| Mila Stone | Chest pain with shortness of breath | Critical | 5/11/2026 | 90 | Yes |
| Samir Khan | Fever and cough | Medium | 5/11/2026 | 95 | No |
| Count: 2 | Distinct: 2 | Max: 5/11/2026 | Min: 90 |
Missing values: 0 / 12 (0.0%)
Duplicate rows: 0
Patient: Most common: 'Mila Stone' (1), Distinct: 2, Missing: 0
Complaint: Most common: 'Chest pain with shortness of breath' (1), Distinct: 2, Missing: 0
Severity: Most common: 'Critical' (1), Distinct: 2, Missing: 0
Arrival: Valid dates: 2, Invalid dates: 0, Missing: 0
SpO2: Valid numbers: 2, Invalid numbers: 0, Missing: 0
Immediate Review: Most common: 'false' (1), Distinct: 2, Missing: 0
You are analyzing a data table for support operations. Return exactly three short bullet points: 1) key trend, 2) possible anomaly/risk, 3) next action recommendation. Keep it concise and practical.: Component: BuzzSmartTable Subject: medical-triage UserContext (highest precedence): Rows=2; MissingCells=0; MissingPct=0.0%; Duplicates=0 Columns: - Patient (Text) - Complaint (Text) - Severity (Text) - Arrival (Date) - SpO2 (Number) - Immediate Review (Boolean) Sample rows: Patient=Mila Stone; Complaint=Chest pain with shortness of breath; Severity=Critical; Arrival=5/11/2026; SpO2=90; Immediate Review=Yes Patient=Samir Khan; Complaint=Fever and cough; Severity=Medium; Arrival=5/11/2026; SpO2=95; Immediate Review=No DeveloperContext: Emergency triage workflow for outpatient intake. Prioritize unstable vitals and rapid escalation clarity. [Context: 50 chars]
Final Step: Full Code (Copy-Paste)
This is the complete single-page sample. Start with this, then adapt labels and triage policy to your domain.
@page "/medical-triage"
@rendermode InteractiveServer
@using Buzz.Blazor.Models
<h1>Medical Triage</h1>
<BuzzTextBox Label="Patient Name" InputText="@_patientName" InputTextChanged="OnPatientNameChanged" />
<BuzzTextBox Label="Primary Complaint" InputText="@_complaint" InputTextChanged="OnComplaintChanged" />
<BuzzSelectBox Label="Triage Severity" Options="@_severityOptions" Value="@_severity" ValueChanged="OnSeverityChanged" />
<BuzzDatePicker Label="Arrival Date" Value="@_arrivalDate" ValueChanged="OnArrivalDateChanged" />
<BuzzTextBox Label="SpO2 (%)" InputText="@_spo2" InputTextChanged="OnSpo2Changed" />
<BuzzCheckBox Label="Requires immediate physician review" Value="@_needsImmediateReview" ValueChanged="OnNeedsImmediateReviewChanged" />
<BuzzStack Direction="horizontal" Gap="0.45rem" Wrap="true" Align="center">
<BuzzButton Text="Add Case" Variant="primary" OnClick="AddCaseAsync" />
<BuzzButton Text="Seed Example Cases" Variant="outline" OnClick="SeedCasesAsync" />
<BuzzButton Text="Clear Closed Cases" Variant="secondary" OnClick="ClearClosedCasesAsync" />
</BuzzStack>
@if (HasCriticalCases)
{
<BuzzAlert Title="Critical Cases Detected"
Message="At least one active case is high risk. Review triage actions now."
Variant="warning"
Dismissible="false" />
}
<BuzzProgress Label="Active high-risk ratio" Value="@HighRiskPercent" Max="100" Variant="danger" ShowValueLabel="true" />
<BuzzFormAssistant Label="Clinical Note Assistant"
Fields="@AssistantFields"
EnableAiRiskInsight="true"
EnableAiRewriteForMessage="true"
MessageDraft="@_handoverDraft"
MessageDraftChanged="OnHandoverDraftChanged"
AiContextSubject="medical-triage"
SourceText="@_aiContextText" />
<BuzzSmartTable Label="Live Triage Board"
Columns="@_tableColumns"
Rows="@TableRows"
Modules="@BuzzSmartTableModules.Analytics"
ShowAiInsightsPanel="true"
EnableAiInsights="true"
AiContextSubject="medical-triage"
SourceText="@_aiContextText" />
@code {
private sealed record MedicalCase(
Guid Id,
string PatientName,
string Complaint,
string Severity,
string ArrivalDate,
int? Spo2,
bool NeedsImmediateReview,
bool IsClosed);
private string _patientName = string.Empty;
private string _complaint = string.Empty;
private string _severity = "Medium";
private string _arrivalDate = DateTime.UtcNow.Date.ToString("yyyy-MM-dd");
private string _spo2 = string.Empty;
private bool _needsImmediateReview;
private string _handoverDraft = "Patient is under triage assessment.";
private readonly string _aiContextText = "Emergency triage workflow for outpatient intake.";
private readonly IReadOnlyList<string> _severityOptions = ["Low", "Medium", "High", "Critical"];
private readonly List<MedicalCase> _cases =
[
new(Guid.NewGuid(), "Mila Stone", "Chest pain with shortness of breath", "Critical", DateTime.UtcNow.Date.ToString("yyyy-MM-dd"), 90, true, false),
new(Guid.NewGuid(), "Samir Khan", "Fever and cough", "Medium", DateTime.UtcNow.Date.ToString("yyyy-MM-dd"), 95, false, false)
];
private readonly IReadOnlyList<BuzzTableColumn> _tableColumns =
[
new("patient", "Patient", BuzzTableDataType.Text),
new("complaint", "Complaint", BuzzTableDataType.Text),
new("severity", "Severity", BuzzTableDataType.Text),
new("arrival", "Arrival", BuzzTableDataType.Date),
new("spo2", "SpO2", BuzzTableDataType.Number),
new("review", "Immediate Review", BuzzTableDataType.Boolean)
];
private IReadOnlyList<BuzzFormFieldState> AssistantFields =>
[
new("patient", "Patient Name", _patientName, true),
new("complaint", "Primary Complaint", _complaint, true),
new("severity", "Triage Severity", _severity, true)
];
private IReadOnlyList<IReadOnlyDictionary<string, string>> TableRows =>
_cases.Where(entry => !entry.IsClosed)
.Select(entry => new Dictionary<string, string>
{
["patient"] = entry.PatientName,
["complaint"] = entry.Complaint,
["severity"] = entry.Severity,
["arrival"] = entry.ArrivalDate,
["spo2"] = entry.Spo2?.ToString() ?? string.Empty,
["review"] = entry.NeedsImmediateReview ? "true" : "false"
})
.ToList();
private bool HasCriticalCases => _cases.Any(entry => !entry.IsClosed && (entry.Spo2 is <= 91 || entry.Severity is "Critical"));
private double HighRiskPercent => _cases.Count == 0 ? 0 : Math.Round((_cases.Count(entry => !entry.IsClosed && (entry.NeedsImmediateReview || entry.Severity is "High" or "Critical")) / (double)_cases.Count) * 100, 2);
private Task OnPatientNameChanged(string value) { _patientName = value; return Task.CompletedTask; }
private Task OnComplaintChanged(string value) { _complaint = value; return Task.CompletedTask; }
private Task OnSeverityChanged(string value) { _severity = string.IsNullOrWhiteSpace(value) ? "Medium" : value; return Task.CompletedTask; }
private Task OnArrivalDateChanged(string value) { _arrivalDate = string.IsNullOrWhiteSpace(value) ? DateTime.UtcNow.Date.ToString("yyyy-MM-dd") : value; return Task.CompletedTask; }
private Task OnSpo2Changed(string value) { _spo2 = value; return Task.CompletedTask; }
private Task OnNeedsImmediateReviewChanged(bool value) { _needsImmediateReview = value; return Task.CompletedTask; }
private Task OnHandoverDraftChanged(string value) { _handoverDraft = value; return Task.CompletedTask; }
private Task AddCaseAsync()
{
if (string.IsNullOrWhiteSpace(_complaint))
{
return Task.CompletedTask;
}
_cases.Insert(0, new MedicalCase(
Guid.NewGuid(),
string.IsNullOrWhiteSpace(_patientName) ? "Unknown" : _patientName.Trim(),
_complaint.Trim(),
_severity,
_arrivalDate,
int.TryParse(_spo2, out var spo2) ? spo2 : null,
_needsImmediateReview,
false));
_patientName = string.Empty;
_complaint = string.Empty;
_spo2 = string.Empty;
_needsImmediateReview = false;
return Task.CompletedTask;
}
private Task SeedCasesAsync()
{
_cases.Add(new MedicalCase(Guid.NewGuid(), "Anita Wells", "Dizziness and low oxygen reading", "High", DateTime.UtcNow.Date.ToString("yyyy-MM-dd"), 91, true, false));
return Task.CompletedTask;
}
private Task ClearClosedCasesAsync()
{
_cases.RemoveAll(entry => entry.IsClosed);
return Task.CompletedTask;
}
}