{% extends 'layouts/base.html' %} {% load i18n %} {% load static %} {% block title %}{{ report.indicator_title }} - {% trans "KPI Report" %}{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{{ report.kpi_id }} | {{ report.report_period_display }}

{{ report.indicator_title }}

{{ report.hospital.name }}

{% trans "Export PDF" %}
{% csrf_token %}
{% for m in monthly_data %} {% endfor %} {% for m in monthly_data %} {% endfor %} {% for m in monthly_data %} {% endfor %}
{% trans "KPI ID" %} {% trans "Indicator Title" %} {% trans "Numerator / Denominator" %} {% trans "Jan" %} {% trans "Feb" %} {% trans "Mar" %} {% trans "Apr" %} {% trans "May" %} {% trans "Jun" %} {% trans "Jul" %} {% trans "Aug" %} {% trans "Sep" %} {% trans "Oct" %} {% trans "Nov" %} {% trans "Dec" %} {% trans "TOTAL" %}
{{ report.kpi_id }} {{ report.indicator_title }} {{ report.numerator_label }} {% if m %}{{ m.numerator }}{% else %}-{% endif %}{{ report.total_numerator }}
{{ report.denominator_label }} {% if m %}{{ m.denominator }}{% else %}-{% endif %}{{ report.total_denominator }}
{% trans "Result (%)" %} {% if m %}{{ m.percentage }}%{% else %}-{% endif %} {{ report.overall_result }}%
{% trans "Category:" %} {{ report.category }}
{% trans "Type:" %} {{ report.kpi_type }}
{% trans "Risk:" %} {{ report.risk_level }}
{% trans "Data coll.:" %} {{ report.data_collection_method }}
{% trans "Method:" %} {{ report.data_collection_frequency }}
{% trans "Dimension:" %} {{ report.dimension }}
{% trans "Gather freq.:" %} {{ report.data_collection_frequency }}
{% trans "Reporting:" %} {{ report.reporting_frequency }}
{% trans "Collector:" %} {{ report.collector_name|default:"-" }}
{% trans "Analyzer:" %} {{ report.analyzer_name|default:"-" }}

{% trans "Monthly Performance Trend (%)" %} [{% trans "Target:" %} {{ report.target_percentage }}%]

{% trans "Complaints by Source" %}

{% trans "Department Breakdown" %}

{% for dept in department_breakdowns %}

{{ dept.get_department_category_display }}

{% trans "Complaints:" %} {{ dept.complaint_count }}
{% trans "Resolved:" %} {{ dept.resolved_count }}
{% if dept.avg_resolution_days %}
{% trans "Avg Days:" %} {{ dept.avg_resolution_days }}
{% endif %}
{% if dept.top_areas %}

{% trans "Top Areas:" %}

{{ dept.top_areas }}

{% endif %}
{% endfor %}

{% trans "AI-Generated Analysis" %} {% if report.ai_analysis_generated_at %} ({% trans "Generated:" %} {{ report.ai_analysis_generated_at|date:"Y-m-d H:i" }}) {% endif %}

{% if report.ai_analysis %} {% endif %}
{% if report.ai_analysis %} {% with analysis=report.ai_analysis %} {% if analysis.executive_summary %}

{% trans "Executive Summary" %}

{{ analysis.executive_summary }}

{% endif %} {% if analysis.performance_analysis %}

{% trans "Performance Analysis" %}

{{ analysis.performance_analysis }}

{% endif %} {% if analysis.key_findings %}

{% trans "Key Findings" %}

    {% for finding in analysis.key_findings %}
  • {{ finding }}
  • {% endfor %}
{% endif %} {% if analysis.reasons_for_delays %}

{% trans "Reasons for Delays" %}

    {% for reason in analysis.reasons_for_delays %}
  • {{ reason }}
  • {% endfor %}
{% endif %} {% if analysis.resolution_time_analysis %}

{% trans "Resolution Time Breakdown" %}

{% if analysis.resolution_time_analysis.within_24h %}

{% trans "Within 24h" %}

{{ analysis.resolution_time_analysis.within_24h.count }}

{{ analysis.resolution_time_analysis.within_24h.percentage }}

{% endif %} {% if analysis.resolution_time_analysis.within_48h %}

{% trans "Within 48h" %}

{{ analysis.resolution_time_analysis.within_48h.count }}

{{ analysis.resolution_time_analysis.within_48h.percentage }}

{% endif %} {% if analysis.resolution_time_analysis.within_72h %}

{% trans "Within 72h" %}

{{ analysis.resolution_time_analysis.within_72h.count }}

{{ analysis.resolution_time_analysis.within_72h.percentage }}

{% endif %} {% if analysis.resolution_time_analysis.over_72h %}

{% trans "Over 72h" %}

{{ analysis.resolution_time_analysis.over_72h.count }}

{{ analysis.resolution_time_analysis.over_72h.percentage }}

{% endif %}
{% endif %} {% if analysis.recommendations %}

{% trans "Recommendations" %}

    {% for rec in analysis.recommendations %}
  • {{ rec }}
  • {% endfor %}
{% endif %} {% endwith %} {% else %}

{% trans "No AI analysis available yet. Click 'Generate Analysis' to create one." %}

{% endif %}

{% trans "Generated" %}: {{ report.generated_at|default:"-" }} {% if report.generated_by %}{% trans "by" %} {{ report.generated_by.get_full_name }}{% endif %} | {% trans "Status" %}: {{ report.get_status_display }}

{% endblock %} {% block extra_js %} {% endblock %}