{% extends 'hr/base.html' %} {% load static %} {% load i18n %} {% block title %}{% trans "Employee Lab Tests Dashboard" %}{% endblock %} {% block sidebar.employee_lab_tests %} class="active" {% endblock %} {% block header.add_script %} {% endblock %} {% block content %}
{% if company_groups.exists %}
{% endif %} {% if selected_company %}
{% trans "Total Employees" %}
{{ total_employees }}
{% trans "Employees with Tests" %}
{{ employees_with_tests }}
{% if total_employees > 0 %} ({{ employees_with_tests|floatformat:0 }}% {% trans "coverage" %}) {% endif %}
{% trans "Total Lab Tests" %}
{{ total_lab_tests }}
{% trans "Average Health Score" %}
{% if aggregate_stats.avg_overall_score %} {{ aggregate_stats.avg_overall_score }} {% else %} - {% endif %}
{% if aggregate_stats.avg_overall_score %}
{% trans "Health Distribution" %}
{% trans "Excellent" %} (90-100)
{{ aggregate_stats.health_distribution.excellent }}
{% trans "Good" %} (70-89)
{{ aggregate_stats.health_distribution.good }}
{% trans "Fair" %} (50-69)
{{ aggregate_stats.health_distribution.fair }}
{% trans "Poor" %} (<50)
{{ aggregate_stats.health_distribution.poor }}
{% trans "Average Health Indices" %}
{% for index_name, index_data in aggregate_stats.index_averages.items %}
{{ index_name }}
{{ index_data.average|floatformat:0 }}
{% trans "Range" %}: {{ index_data.min|floatformat:0 }} - {{ index_data.max|floatformat:0 }} ({{ index_data.count }} {% trans "tests" %})
{% endfor %}
{% trans "Health Risk Summary" %}
{% trans "CVD Risk" %}
{% trans "Low" %}: {{ aggregate_stats.risk_summary.cvd.low }}
{% trans "Medium" %}: {{ aggregate_stats.risk_summary.cvd.medium }}
{% trans "High" %}: {{ aggregate_stats.risk_summary.cvd.high }}
{% trans "Diabetes Risk" %}
{% trans "Low" %}: {{ aggregate_stats.risk_summary.diabetes.low }}
{% trans "Medium" %}: {{ aggregate_stats.risk_summary.diabetes.medium }}
{% trans "High" %}: {{ aggregate_stats.risk_summary.diabetes.high }}
{% trans "Liver Risk" %}
{% trans "Low" %}: {{ aggregate_stats.risk_summary.liver.low }}
{% trans "Medium" %}: {{ aggregate_stats.risk_summary.liver.medium }}
{% trans "High" %}: {{ aggregate_stats.risk_summary.liver.high }}
{% if aggregate_stats.concerning_biomarkers %}
{% trans "Most Concerning Biomarkers" %}

{% trans "Biomarkers with >30% of employees needing attention" %}

{% for biomarker in aggregate_stats.concerning_biomarkers %}
{{ biomarker.name }} {{ biomarker.concerning_percentage|floatformat:1 }}% {% trans "concerning" %} {% if biomarker.average_score %} ({% trans "Avg Score" %}: {{ biomarker.average_score|floatformat:0 }}) {% endif %}
{% endfor %}
{% endif %}
{% trans "Employee Health Status" %}

{% trans "Sorted by health score (lowest first - most concerning)" %}

{% for emp_stat in employee_stats %} {% empty %} {% endfor %}
{% trans "Employee Name" %} {% trans "National ID" %} {% trans "Latest Test Date" %} {% trans "Health Score" %} {% trans "Total Tests" %} {% trans "Actions" %}
{% if emp_stat.employee.profile %} {{ emp_stat.employee.profile.first_name }} {{ emp_stat.employee.profile.last_name }} {% else %} {% trans "Unknown" %} {% endif %} {% if emp_stat.employee.profile.national_id %} {{ emp_stat.employee.profile.national_id }} {% else %} - {% endif %} {% if emp_stat.test_date %} {{ emp_stat.test_date|date:"Y-m-d" }} {% else %} - {% endif %} {% if emp_stat.overall_score is not None %} {{ emp_stat.overall_score }}
{% else %} {% trans "No Score" %} {% endif %}
{{ emp_stat.total_tests }} {% trans "View Details" %}
{% trans "No employees with lab tests found." %}
{% else %}
{% trans "No Lab Test Data Available" %}

{% trans "No lab tests found for employees in this company." %}

{% endif %} {% else %}
{% trans "No Company Selected" %}

{% trans "Please select a company to view employee lab test data." %}

{% endif %}
{% endblock %}