- {% if c.ctrl.dp_ucr %}
DP: {{ c.ctrl.dp_ucr }}{% endif %}
- {% if c.ctrl.da_ucr %}
DA: {{ c.ctrl.da_ucr }}{% endif %}
- {% if c.ctrl.dr_ucr %}
DR: {{ c.ctrl.dr_ucr }}{% endif %}
- {% if c.ctrl.actes_ucr %}
Actes: {{ c.ctrl.actes_ucr }}{% endif %}
+ {% if c.ctrl.dp_ucr %}
DP: {{ c.ctrl.dp_ucr }}{% endif %}
+ {% if c.ctrl.da_ucr %}
DA: {{ c.ctrl.da_ucr }}{% endif %}
+ {% if c.ctrl.dr_ucr %}
DR: {{ c.ctrl.dr_ucr }}{% endif %}
+ {% if c.ctrl.actes_ucr %}
Actes: {{ c.ctrl.actes_ucr }}{% endif %}
{% if not c.ctrl.dp_ucr and not c.ctrl.da_ucr and not c.ctrl.dr_ucr and not c.ctrl.actes_ucr %}
{% if c.ctrl.contre_argumentation %}
@@ -95,13 +95,13 @@
{% if c.jours_restants is not none %}
{% if c.jours_restants < 0 %}
- Hors délai
+ Hors délai
{% elif c.jours_restants < 7 %}
- {{ c.jours_restants }}j
+ {{ c.jours_restants }}j
{% elif c.jours_restants < 15 %}
- {{ c.jours_restants }}j
+ {{ c.jours_restants }}j
{% else %}
- {{ c.jours_restants }}j
+ {{ c.jours_restants }}j
{% endif %}
{% if c.ctrl.date_limite_reponse %}
{{ c.ctrl.date_limite_reponse }}
@@ -112,11 +112,11 @@
|
{% if c.ctrl.validation_dim == 'valide' %}
- Validé
+ Validé
{% elif c.ctrl.validation_dim == 'rejete' %}
- Rejeté
+ Rejeté
{% elif c.ctrl.validation_dim == 'en_revision' %}
- En révision
+ En révision
{% else %}
—
{% endif %}
diff --git a/src/viewer/templates/detail.html b/src/viewer/templates/detail.html
index 41f484a..b17f7cf 100644
--- a/src/viewer/templates/detail.html
+++ b/src/viewer/templates/detail.html
@@ -17,10 +17,10 @@
{{ current_group | format_dossier_name if current_group else (dossier.source_file or filepath) }}
{% if dossier.document_type %}
- {{ dossier.document_type }}
+ {{ dossier.document_type }}
{% endif %}
{% if dossier.source_files %}
- fusionné
+ fusionné
{% endif %}
{% if dossier.processing_time_s is not none %}
{{ dossier.processing_time_s|format_duration }}
@@ -83,22 +83,22 @@
{{ ghm.ghm_approx }}
{% endif %}
{% if ghm.type_ghm == 'C' %}
- C — Chirurgical
+ C — Chirurgical
{% elif ghm.type_ghm == 'K' %}
- K — Interventionnel
+ K — Interventionnel
{% elif ghm.type_ghm == 'M' %}
- M — Médical
+ M — Médical
{% endif %}
{% if ghm.severite <= 1 %}
- Niv. {{ ghm.severite }}
+ Niv. {{ ghm.severite }}
{% elif ghm.severite == 2 %}
- Niv. {{ ghm.severite }}
+ Niv. {{ ghm.severite }}
{% elif ghm.severite == 3 %}
- Niv. {{ ghm.severite }}
+ Niv. {{ ghm.severite }}
{% else %}
- Niv. {{ ghm.severite }}
+ Niv. {{ ghm.severite }}
{% endif %}
- {{ ghm.cma_count }} CMA, {{ ghm.cms_count }} CMS
+ {{ ghm.cma_count }} CMA, {{ ghm.cms_count }} CMS
{% endif %}
@@ -112,16 +112,16 @@
{% else %}{% set vr_color = '#ef4444' %}{% endif %}
{% if vr.verdict == 'PASS' %}
- CONFORME
+ CONFORME
{% elif vr.verdict == 'NEED_INFO' %}
- À COMPLÉTER
+ À COMPLÉTER
{% else %}
- NON CONFORME
+ NON CONFORME
{% endif %}
-
+
- {{ vr.score_contestabilite }}/100
+ {{ vr.score_contestabilite }}/100
{% endif %}
@@ -149,13 +149,13 @@
Complétude Documentaire DIM
{% if compl.verdict_global == 'defendable' %}
- DÉFENDABLE
+ DÉFENDABLE
{% set compl_color = '#22c55e' %}
{% elif compl.verdict_global == 'fragile' %}
- FRAGILE
+ FRAGILE
{% set compl_color = '#f59e0b' %}
{% else %}
- INDÉFENDABLE
+ INDÉFENDABLE
{% set compl_color = '#ef4444' %}
{% endif %}
@@ -293,7 +293,7 @@
Diagnostics associés ({{ dossier.diagnostics_associes|length }})
- | Code CIM-10 | Libellé | CMA | Confiance | Source |
+ | Code CIM-10 | Libellé | CMA | Confiance | Source |
{% for das in dossier.diagnostics_associes %}
@@ -318,7 +318,7 @@
{% endif %}
{% if das.status == 'needs_info' %}
- Info requise
+ Info requise
{% if das.cim10_decision and das.cim10_decision.needs_info %}
détails
@@ -351,7 +351,7 @@
{% if das.niveau_cma and das.niveau_cma > 1 %}
{{ das.niveau_cma | cma_level_badge }}
{% elif das.est_cma %}
- CMA
+ CMA
{% else %}
—
{% endif %}
@@ -394,7 +394,7 @@
Actes CCAM ({{ dossier.actes_ccam|length }})
- | Code CCAM | Libellé | Regroupement | Date | Validité | Source |
+ | Code CCAM | Libellé | Regroupement | Date | Validité | Source |
{% for a in dossier.actes_ccam %}
@@ -407,8 +407,8 @@
| {{ a.date or '' }} |
- {% if a.validite == 'valide' %}Valide
- {% elif a.validite == 'obsolete' %}Obsolète
+ {% if a.validite == 'valide' %}Valide
+ {% elif a.validite == 'obsolete' %}Obsolète
{% else %}—{% endif %}
{% for alerte in a.alertes %} {{ alerte }} {% endfor %}
|
@@ -491,9 +491,9 @@
{{ issue.veto }} |
- {% if issue.severity == 'HARD' %}Bloquant
- {% elif issue.severity == 'MEDIUM' %}À vérifier
- {% else %}Optimisation{% endif %}
+ {% if issue.severity == 'HARD' %}Bloquant
+ {% elif issue.severity == 'MEDIUM' %}À vérifier
+ {% else %}Optimisation{% endif %}
|
{{ issue.where|human_where }} |
{{ issue.message }} |
@@ -539,11 +539,11 @@
{{ ctrl.decision_ucr }}
{% endif %}
{% if ctrl.quality_tier == 'A' %}
- Qualité A
+ Qualité A
{% elif ctrl.quality_tier == 'B' %}
- Qualité B
+ Qualité B
{% elif ctrl.quality_tier == 'C' %}
- Qualité C
+ Qualité C
{% endif %}
@@ -697,13 +697,13 @@
{% if ctrl.validation_dim == 'valide' %}
- Validé
+ Validé
{% elif ctrl.validation_dim == 'rejete' %}
- Rejeté
+ Rejeté
{% elif ctrl.validation_dim == 'en_revision' %}
- En révision
+ En révision
{% else %}
- Non validé
+ Non validé
{% endif %}
{% if ctrl.date_validation %}
@@ -745,9 +745,9 @@
{{ b.valeur or '' }} |
{% if b.quality == 'suspect' %}
- Suspect
+ Suspect
{% elif b.anomalie %}
- Oui
+ Oui
{% if b.test in bio_normals and b.valeur_num is not none %}
{% set lo, hi = bio_normals[b.test] %}
{% if b.valeur_num > hi %}
diff --git a/src/viewer/templates/dim.html b/src/viewer/templates/dim.html
index f20d0cb..8aa0416 100644
--- a/src/viewer/templates/dim.html
+++ b/src/viewer/templates/dim.html
@@ -1,7 +1,23 @@
{% extends "base.html" %}
-{% block title %}Synthese DIM{% endblock %}
+{% block title %}Synthèse DIM{% endblock %}
{% block content %}
+
+
← Retour
Synthèse DIM
@@ -14,47 +30,54 @@
Diagnostic Principal
-
+
-
+
-
{% if dim.dp.total %}
-
+
Taux de modification DP : {{ ((dim.dp.modified / dim.dp.total) * 100) | round(1) }}%
({{ dim.dp.modified }}/{{ dim.dp.total }})
{% endif %}
{# Confiance DP #}
- Confiance DP
+ Niveau de confiance DP
{% set dp_tot = dim.dp.total or 1 %}
{% if dim.dp.confidence.get('high', 0) %}
-
+
{% endif %}
{% if dim.dp.confidence.get('medium', 0) %}
-
+
{% endif %}
{% if dim.dp.confidence.get('low', 0) %}
-
+
{% endif %}
{% if dim.dp.confidence.get('none', 0) %}
-
+
{% endif %}
+ {# Légende confiance #}
+
+ Haute
+ Moyenne
+ Basse
+ Non évaluée
+
{# Source DP #}
- Source DP
+ Source du DP
{% for src, cnt in dim.dp.source.items() %}
- {{ src }}: {{ cnt }}
+ {{ src }} : {{ cnt }}
{% endfor %}
@@ -63,19 +86,19 @@
Diagnostics Associés
-
+
-
+
-
+
-
+
@@ -114,26 +137,26 @@
{# --- Contestabilité (Vetos) --- #}
- Contestabilité (Veto Engine)
+ Contestabilité (Moteur de règles)
-
+
-
+
-
-
+
Score moyen de défendabilité : {{ dim.veto.avg_score }}/100
{% if dim.veto.top_issues %}
- Alertes les plus fréquentes
+ Règles les plus fréquemment enfreintes
{% for veto_id, count in dim.veto.top_issues %}
{{ veto_id }}
@@ -144,32 +167,44 @@
{% endfor %}
{% endif %}
+ {# Légende #}
+
+ Conforme = règles ATIH respectées
+ Info. requise = pièces à compléter
+ Non conforme = codage contestable
+
{# --- Complétude documentaire --- #}
Complétude documentaire
-
+
-
+
-
-
- Score moyen : {{ dim.completude.avg_score }}/100
+
+ Score moyen de complétude : {{ dim.completude.avg_score }}/100
+
+ {# Légende #}
+
+ Défendable = dossier complet
+ Fragile = pièces manquantes
+ Indéfendable = documentation insuffisante
{# --- Synthèse CPAM --- #}
{% if dim.cpam.total %}
- Contrôles CPAM
+ Contrôles CPAM
{{ dim.cpam.total }} contrôles
{% if dim.cpam.impact_total %}
@@ -178,7 +213,7 @@
{% for prio, cnt in dim.cpam.by_priority.items() %}
- {{ prio }}: {{ cnt }}
+ {{ prio }} : {{ cnt }}
{% endfor %}
@@ -195,14 +230,14 @@
{% if dim.alertes.fail %}
-
- Veto FAIL — Codage contestable ({{ dim.alertes.fail | length }})
+
+ Non conformes — Codage contestable ({{ dim.alertes.fail | length }})
{% for d in dim.alertes.fail %}
{{ d.name }}
Score {{ d.score }}/100
- {{ d.issues }} issues
+ {{ d.issues }} anomalie{{ 's' if d.issues > 1 else '' }}
{% endfor %}
@@ -210,8 +245,8 @@
{% if dim.alertes.review %}
-
- DP en REVIEW — À valider ({{ dim.alertes.review | length }})
+
+ DP à revoir — Validation requise ({{ dim.alertes.review | length }})
{% for d in dim.alertes.review %}
@@ -225,14 +260,14 @@
{% if dim.alertes.indefendable %}
-
- Complétude indéfendable ({{ dim.alertes.indefendable | length }})
+
+ Documentation indéfendable ({{ dim.alertes.indefendable | length }})
{% for d in dim.alertes.indefendable %}
{{ d.name }}
Score {{ d.score }}/100
- {{ d.manquants }} docs manquants
+ {{ d.manquants }} pièce{{ 's' if d.manquants > 1 else '' }} manquante{{ 's' if d.manquants > 1 else '' }}
{% endfor %}
diff --git a/src/viewer/templates/index.html b/src/viewer/templates/index.html
index e0c35e7..a1bcaff 100644
--- a/src/viewer/templates/index.html
+++ b/src/viewer/templates/index.html
@@ -7,12 +7,12 @@
{% if stats %}
Vue globale
- {{ stats.total_dossiers }} dossiers
- {{ stats.total_das }} DAS
- {{ stats.total_actes }} actes
- {% if stats.total_alertes %}{{ stats.total_alertes }} alertes{% endif %}
- {% if stats.total_cma %}{{ stats.total_cma }} CMA{% endif %}
- {% if stats.total_cpam %}{{ stats.total_cpam }} CPAM{% endif %}
+ {{ stats.total_dossiers }} dossiers
+ {{ stats.total_das }} DAS
+ {{ stats.total_actes }} actes
+ {% if stats.total_alertes %}{{ stats.total_alertes }} alertes{% endif %}
+ {% if stats.total_cma %}{{ stats.total_cma }} CMA{% endif %}
+ {% if stats.total_cpam %}{{ stats.total_cpam }} CPAM{% endif %}
{% if stats.processing_time_total %}
Total : {{ stats.processing_time_total|format_duration }}
{% endif %}
@@ -32,12 +32,12 @@
| Patient |
- DP |
- DAS |
- Actes |
- Sévérité |
- Alertes |
- CPAM |
+ DP |
+ DAS |
+ Actes |
+ Sévérité |
+ Alertes |
+ CPAM |
@@ -81,14 +81,14 @@
{% if gstats.das_count is defined and gstats.das_count > 0 %}
- {{ gstats.das_count }}
+ {{ gstats.das_count }}
{% else %}
0
{% endif %}
|
{% if gstats.actes_count is defined and gstats.actes_count > 0 %}
- {{ gstats.actes_count }}
+ {{ gstats.actes_count }}
{% else %}
0
{% endif %}
@@ -102,14 +102,14 @@
|
{% if gstats.alertes_count is defined and gstats.alertes_count > 0 %}
- {{ gstats.alertes_count }}
+ {{ gstats.alertes_count }}
{% else %}
0
{% endif %}
|
{% if d.controles_cpam %}
- {{ d.controles_cpam|length }}
+ {{ d.controles_cpam|length }}
{% else %}
—
{% endif %}
diff --git a/tests/test_referentiels.py b/tests/test_referentiels.py
index ae287e4..76e9fac 100644
--- a/tests/test_referentiels.py
+++ b/tests/test_referentiels.py
@@ -3,6 +3,7 @@
from __future__ import annotations
import json
+import os
from pathlib import Path
from unittest.mock import patch, MagicMock
@@ -74,13 +75,13 @@ class TestReferentielManager:
def test_file_stored_on_disk(self, manager, tmp_path):
ref = manager.add_file("test.txt", b"file content here")
- stored_path = manager._dir / ref["stored_name"]
+ stored_path = manager._base / ref["stored_name"]
assert stored_path.exists()
assert stored_path.read_bytes() == b"file content here"
def test_remove_deletes_file(self, manager):
ref = manager.add_file("test.txt", b"content")
- stored_path = manager._dir / ref["stored_name"]
+ stored_path = manager._base / ref["stored_name"]
assert stored_path.exists()
manager.remove(ref["id"])
assert not stored_path.exists()
@@ -144,9 +145,10 @@ class TestReferentielRoutes:
def app(self, tmp_path):
"""Crée une app Flask de test avec un manager temporaire."""
from src.viewer.app import create_app
- app = create_app()
- app.config["TESTING"] = True
- return app
+ with patch.dict(os.environ, {"T2A_DEMO_USER": "", "T2A_DEMO_PASS": ""}):
+ app = create_app()
+ app.config["TESTING"] = True
+ yield app
@pytest.fixture
def client(self, app):
@@ -155,7 +157,7 @@ class TestReferentielRoutes:
def test_admin_page_loads(self, client):
resp = client.get("/admin/referentiels")
assert resp.status_code == 200
- assert "Référentiels RAG" in resp.data.decode()
+ assert "Referentiels" in resp.data.decode()
def test_upload_no_file(self, client):
resp = client.post("/admin/referentiels/upload")
| | |