feat: ajout viewer Flask CIM-10 avec config Ollama centralisée et chronométrage
Ajoute une interface web Flask pour visualiser les dossiers médicaux CIM-10, avec temps de traitement par PDF, sélecteur de modèle Ollama, et centralisation de la config Ollama dans src/config.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
72
src/viewer/templates/index.html
Normal file
72
src/viewer/templates/index.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Accueil{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% for group_name, items in groups.items() %}
|
||||
<div class="group-title">{{ group_name }}</div>
|
||||
{% for item in items %}
|
||||
<a href="/dossier/{{ item.path_rel }}">{{ item.name }}</a>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Dossiers médicaux traités</h2>
|
||||
|
||||
{% if not groups %}
|
||||
<div class="card">
|
||||
<p>Aucun dossier trouvé dans <code>output/structured/</code>.</p>
|
||||
<p style="margin-top:0.5rem;font-size:0.85rem;color:#64748b">
|
||||
Lancez le pipeline avec <code>python -m src.main</code> pour générer des fichiers.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for group_name, items in groups.items() %}
|
||||
<div class="section">
|
||||
{% set ns = namespace(total=0.0, count=0) %}
|
||||
{% for item in items %}
|
||||
{% if item.dossier.processing_time_s is not none %}
|
||||
{% set ns.total = ns.total + item.dossier.processing_time_s %}
|
||||
{% set ns.count = ns.count + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<h3 style="display:flex;align-items:baseline;gap:0.75rem;">
|
||||
{{ group_name }}
|
||||
<span style="font-size:0.75rem;font-weight:400;color:#64748b;">
|
||||
{{ items|length }} fichier(s){% if ns.count %} — total : {{ ns.total|round(1) }}s{% endif %}
|
||||
</span>
|
||||
</h3>
|
||||
<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem;">
|
||||
{% for item in items %}
|
||||
<a href="/dossier/{{ item.path_rel }}" style="text-decoration:none;color:inherit;">
|
||||
<div class="card" style="cursor:pointer;transition:box-shadow 0.15s;">
|
||||
<div style="font-weight:600;font-size:0.9rem;margin-bottom:0.4rem;color:#0f172a;">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
{% if item.dossier.document_type %}
|
||||
<span class="badge" style="background:#e0e7ff;color:#3730a3;">{{ item.dossier.document_type }}</span>
|
||||
{% endif %}
|
||||
{% if item.dossier.diagnostic_principal %}
|
||||
<div style="margin-top:0.5rem;font-size:0.8rem;color:#334155;">
|
||||
<strong>DP :</strong> {{ item.dossier.diagnostic_principal.texte[:80] }}{% if item.dossier.diagnostic_principal.texte|length > 80 %}…{% endif %}
|
||||
</div>
|
||||
{% if item.dossier.diagnostic_principal.cim10_suggestion %}
|
||||
<div style="margin-top:0.25rem;">
|
||||
<span class="badge" style="background:#dbeafe;color:#1d4ed8;">{{ item.dossier.diagnostic_principal.cim10_suggestion }}</span>
|
||||
{{ item.dossier.diagnostic_principal.cim10_confidence | confidence_badge }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if item.dossier.processing_time_s is not none %}
|
||||
<div style="margin-top:0.5rem;font-size:0.75rem;color:#64748b;">
|
||||
Traitement : {{ item.dossier.processing_time_s }}s
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user