{% extends "base.html" %} {% block title %}Dashboard{% endblock %} {% block sidebar %} {% for group_name, items in groups.items() %}
{{ group_name | format_dossier_name }}
{% for item in items %} {% if 'fusionne' in item.name %} ★ Fusionné {% else %} {{ item.name | format_doc_name }} {% endif %} {% endfor %} {% endfor %} {% endblock %} {% block content %} ← Retour à la liste

Dashboard

{# ---- Cartes métriques ---- #}
{% set cards = [ ("Dossiers", stats.total_dossiers, "#3b82f6", "#dbeafe"), ("Fichiers", stats.total_fichiers, "#6366f1", "#e0e7ff"), ("DAS total", stats.total_das, "#1d4ed8", "#dbeafe"), ("Actes total", stats.total_actes, "#3730a3", "#e0e7ff"), ("Alertes", stats.total_alertes, "#c2410c", "#ffedd5"), ("CMA", stats.total_cma, "#dc2626", "#fee2e2"), ("Contrôles CPAM", stats.total_cpam, "#b45309", "#fef3c7"), ("Temps total", stats.processing_time_total | format_duration, "#065f46", "#d1fae5"), ] %} {% for label, value, fg, bg in cards %}
{{ label }}
{{ value }}
{% endfor %}
{# ---- Temps moyen ---- #} {% if stats.processing_time_avg %}
Temps moyen par fichier : {{ stats.processing_time_avg | format_duration }}
{% endif %} {# ---- Distribution confiance DP ---- #} {% set conf = stats.dp_confidence %} {% set conf_total = (conf.get('high', 0) + conf.get('medium', 0) + conf.get('low', 0) + conf.get('none', 0)) or 1 %}

Confiance DP

{% if conf.get('high', 0) %}
{% endif %} {% if conf.get('medium', 0) %}
{% endif %} {% if conf.get('low', 0) %}
{% endif %} {% if conf.get('none', 0) %}
{% endif %}
Haute : {{ conf.get('high', 0) }} Moyenne : {{ conf.get('medium', 0) }} Basse : {{ conf.get('low', 0) }} Aucune : {{ conf.get('none', 0) }}
{# ---- Top 15 codes CIM-10 ---- #} {% if stats.top_codes %}

Top 15 codes CIM-10

{% for code, count in stats.top_codes %}
{{ code }}
{{ count }}
{% endfor %}
{% endif %} {# ---- Distribution GHM types ---- #} {% set ghm = stats.ghm_types %} {% set ghm_total = (ghm.get('C', 0) + ghm.get('M', 0) + ghm.get('K', 0)) or 1 %} {% if ghm.get('C', 0) or ghm.get('M', 0) or ghm.get('K', 0) %}

Types GHM

{% if ghm.get('C', 0) %}
{% endif %} {% if ghm.get('M', 0) %}
{% endif %} {% if ghm.get('K', 0) %}
{% endif %}
C — Chirurgical : {{ ghm.get('C', 0) }} M — Médical : {{ ghm.get('M', 0) }} K — Interventionnel : {{ ghm.get('K', 0) }}
{% endif %} {# ---- Distribution sévérité ---- #} {% set sev = stats.severity_dist %} {% set sev_total = (sev.get(1, 0) + sev.get(2, 0) + sev.get(3, 0) + sev.get(4, 0)) or 1 %} {% if sev.get(1, 0) or sev.get(2, 0) or sev.get(3, 0) or sev.get(4, 0) %}

Sévérité GHM

{% if sev.get(1, 0) %}
{% endif %} {% if sev.get(2, 0) %}
{% endif %} {% if sev.get(3, 0) %}
{% endif %} {% if sev.get(4, 0) %}
{% endif %}
Niveau 1 : {{ sev.get(1, 0) }} Niveau 2 : {{ sev.get(2, 0) }} Niveau 3 : {{ sev.get(3, 0) }} Niveau 4 : {{ sev.get(4, 0) }}
{% endif %} {% endblock %}