@* Views/Admin/SurveyAnalysis/HighRiskResponses.cshtml *@ @model List @{ ViewData["Title"] = $"High Risk Responses — {ViewBag.QuestionnaireName}"; } @section Styles { }
@if (Model != null && Model.Any()) { var criticalCount = Model.Count(r => r.RiskAssessment?.RiskLevel == Services.AIViewModel.RiskLevel.Critical); var highCount = Model.Count(r => r.RiskAssessment?.RiskLevel == Services.AIViewModel.RiskLevel.High); var immediateCount = Model.Count(r => r.RiskAssessment?.RequiresImmediateAttention == true);

MENTAL HEALTH ALERT: @Model.Count CASES REQUIRING ATTENTION

@if (criticalCount > 0) { @criticalCount CRITICAL } @if (highCount > 0) { @highCount HIGH RISK } @if (immediateCount > 0) { @immediateCount IMMEDIATE }
Professional intervention recommended — Privacy-protected analysis powered by Claude AI
@foreach (var resp in Model.OrderByDescending(r => r.RiskAssessment?.RiskScore ?? 0)) { var riskLevel = resp.RiskAssessment?.RiskLevel ?? Services.AIViewModel.RiskLevel.Low; var riskScore = resp.RiskAssessment?.RiskScore ?? 0; var needsAttn = resp.RiskAssessment?.RequiresImmediateAttention ?? false; var riskClass = riskLevel.ToString().ToLower();
@riskLevel RISK
RESPONSE #@resp.ResponseId
@Math.Round(riskScore * 100, 0)%
@if (needsAttn) {
IMMEDIATE
}
Question Context
@resp.QuestionText
Response (Privacy Protected)
@(resp.AnonymizedResponseText?.Length > 150 ? resp.AnonymizedResponseText.Substring(0, 150) + "…" : resp.AnonymizedResponseText)
@if (resp.RiskAssessment?.RiskIndicators?.Any() == true) {
Risk Indicators
@foreach (var ind in resp.RiskAssessment.RiskIndicators.Take(3)) { @ind }
} @if (!string.IsNullOrEmpty(resp.RiskAssessment?.RecommendedAction)) {
Recommended Action
@resp.RiskAssessment.RecommendedAction
} @if (resp.Insights?.Any() == true) {
Key Insights
@foreach (var ins in resp.Insights.Take(2)) {
@ins.Category
@ins.RecommendedIntervention
}
} @if (resp.RiskAssessment?.ProtectiveFactors?.Any() == true) {
Protective Factors
@foreach (var f in resp.RiskAssessment.ProtectiveFactors.Take(3)) { @f }
}
ANALYZED: @resp.AnalyzedAt.ToString("MMM dd, HH:mm").ToUpper()
DETAILS @if (needsAttn) { }
}

Professional Actions

Evidence-based intervention protocols

IMMEDIATE
  • Contact Critical/High risk employees
  • Schedule follow-up conversations
  • Refer to mental health professionals
DOCUMENTATION
  • Document interventions taken
  • Track response to interventions
  • Update risk assessments
ORGANIZATIONAL
  • Alert management to workplace issues
  • Implement preventive measures
  • Schedule team interventions
VIEW TRENDS
} else {

EXCELLENT MENTAL HEALTH STATUS

No high-risk or critical cases identified. This indicates a generally positive workplace mental health environment.

}
@functions { private string GetRiskIcon(Services.AIViewModel.RiskLevel riskLevel) { return riskLevel switch { Services.AIViewModel.RiskLevel.Critical => "fa-skull-crossbones", Services.AIViewModel.RiskLevel.High => "fa-triangle-exclamation", Services.AIViewModel.RiskLevel.Moderate => "fa-circle-exclamation", _ => "fa-circle-check" }; } } @section Scripts { }