{% extends 'base.html' %} {% load static %} {% block title %}Appointment Statistics{% endblock %} {% block css %} {% endblock %} {% block content %}

Appointment Statistics

{{ stats.total_appointments|default:0 }}
Total Appointments
{{ stats.completed_appointments|default:0 }}
Completed
{{ stats.cancelled_appointments|default:0 }}
Cancelled
{{ stats.no_show_appointments|default:0 }}
No Shows

Appointments by Status

{% for status in stats.by_status %} {% endfor %}
Status Count Percentage Visual
{{ status.status|title }} {{ status.count }} {{ status.percentage|floatformat:1 }}%

Appointments by Department

{% for dept in stats.by_department %} {% endfor %}
Department Total Completed Cancelled No Shows
{{ dept.department_name }} {{ dept.total }} {{ dept.completed }} {{ dept.cancelled }} {{ dept.no_shows }}

Key Metrics

Show Rate:
{{ stats.show_rate|floatformat:1 }}%
Completion Rate:
{{ stats.completion_rate|floatformat:1 }}%
Cancellation Rate:
{{ stats.cancellation_rate|floatformat:1 }}%
Average Duration:
{{ stats.avg_duration|default:"N/A" }} min
Peak Hour:
{{ stats.peak_hour|default:"N/A" }}

Top Providers

{% for provider in stats.top_providers %}
{{ provider.provider_name }}
{{ provider.department }}
{{ provider.appointment_count }}
appointments
{% endfor %}

Recent Trends

This Week:
{{ stats.this_week|default:0 }}
Last Week:
{{ stats.last_week|default:0 }}
This Month:
{{ stats.this_month|default:0 }}
Last Month:
{{ stats.last_month|default:0 }}
{% endblock %} {% block js %} {% endblock %}