{% extends 'base.html' %} {% load static %} {% block title %}QC Trend Analysis{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

QC Trend Analysis

{{ stats.total_samples }}

Total Samples

{{ stats.pass_rate }}%

Pass Rate

{{ stats.out_of_range }}

Out of Range

{{ stats.westgard_violations }}

Westgard Violations

QC Trend Chart
Control Limits:
+3σ: --
+2σ: --
Mean: --
-2σ: --
-3σ: --
Westgard Rules Analysis
1₃s Rule: 1 control observation exceeds ±3s
Pass
2₂s Rule: 2 consecutive controls exceed ±2s
Pass
R₄s Rule: Range of 4 consecutive controls exceeds 4s
Pass
4₁s Rule: 4 consecutive controls exceed ±1s
Pass
10x̄ Rule: 10 consecutive controls on same side of mean
Pass
Test Type Trends
{% for test_trend in test_trends %}
{{ test_trend.test_type.name }}
{% if test_trend.trend_direction == 'up' %} {{ test_trend.trend_percentage }}% {% elif test_trend.trend_direction == 'down' %} {{ test_trend.trend_percentage }}% {% else %} Stable {% endif %}
Samples
{{ test_trend.sample_count }}
Pass Rate
{{ test_trend.pass_rate }}%
CV
{{ test_trend.cv }}%
{% empty %}

No trend data available

{% endfor %}
Recent Violations
{% for violation in recent_violations %}
{{ violation.rule_name }}
{{ violation.test_type.name }} - {{ violation.sample_id }}
{{ violation.created_at|date:"M d, Y H:i" }}
{{ violation.severity }}
{% empty %}

No recent violations

{% endfor %}
Control Statistics

{{ control_stats.mean|floatformat:2 }}

Mean

{{ control_stats.sd|floatformat:2 }}

Standard Deviation
{{ control_stats.cv|floatformat:1 }}%
CV
{{ control_stats.range|floatformat:2 }}
Range

+3σ Limit: {{ control_stats.plus_3s|floatformat:2 }}
+2σ Limit: {{ control_stats.plus_2s|floatformat:2 }}
-2σ Limit: {{ control_stats.minus_2s|floatformat:2 }}
-3σ Limit: {{ control_stats.minus_3s|floatformat:2 }}
{% endblock %} {% block extra_js %} {% endblock %}