{% extends "base.html" %} {% block title %}{{ dossier.source_file or filepath }}{% endblock %} {% block sidebar %}
Navigation
Retour à la liste {% if siblings %}
{{ current_group }}
{% for sib in siblings %} {{ sib.name }} {% endfor %} {% endif %}
Actions
{% endblock %} {% block content %} ← Retour à la liste {# ---- En-tête ---- #}

{{ dossier.source_file or filepath }}

{% if dossier.document_type %}
{{ dossier.document_type }}
{% endif %} {% if dossier.processing_time_s is not none %}
{{ dossier.processing_time_s|format_duration }}
{% endif %}
{% if dossier.source_files %}
{% for sf in dossier.source_files %} {{ sf }}{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %}
{# ---- Séjour ---- #} {% set s = dossier.sejour %} {% if s.sexe or s.age or s.date_entree or s.date_sortie or s.duree_sejour is not none or s.imc or s.poids or s.taille %}

Séjour

{% if s.sexe %}
{{ s.sexe }}
{% endif %} {% if s.age is not none %}
{{ s.age }} ans
{% endif %} {% if s.date_entree %}
{{ s.date_entree }}
{% endif %} {% if s.date_sortie %}
{{ s.date_sortie }}
{% endif %} {% if s.duree_sejour is not none %}
{{ s.duree_sejour }} jour(s)
{% endif %} {% if s.mode_entree %}
{{ s.mode_entree }}
{% endif %} {% if s.mode_sortie %}
{{ s.mode_sortie }}
{% endif %} {% if s.poids %}
{{ s.poids }} kg
{% endif %} {% if s.taille %}
{{ s.taille }} cm
{% endif %} {% if s.imc %}
{{ s.imc }}
{% endif %}
{% endif %} {# ---- Estimation GHM ---- #} {% if dossier.ghm_estimation %} {% set ghm = dossier.ghm_estimation %}

Estimation GHM

{% if ghm.cmd %}
{{ ghm.cmd }}{% if ghm.cmd_libelle %} — {{ ghm.cmd_libelle }}{% endif %}
{% endif %}
{% if ghm.type_ghm == 'C' %} C — Chirurgical {% elif ghm.type_ghm == 'K' %} K — Interventionnel {% elif ghm.type_ghm == 'M' %} M — Médical {% endif %}
{% if ghm.severite <= 1 %} Niveau {{ ghm.severite }} {% elif ghm.severite == 2 %} Niveau {{ ghm.severite }} {% elif ghm.severite == 3 %} Niveau {{ ghm.severite }} {% else %} Niveau {{ ghm.severite }} {% endif %}
{% if ghm.ghm_approx %}
{{ ghm.ghm_approx }}
{% endif %}
{{ ghm.cma_count }} CMA, {{ ghm.cms_count }} CMS
{% if ghm.alertes %}
{% for alerte in ghm.alertes %}
{{ alerte }}
{% endfor %}
{% endif %}
Estimation heuristique — le GHM définitif nécessite le groupeur officiel ATIH
{% endif %} {# ---- Contrôle CPAM ---- #} {% if dossier.controles_cpam %}

Contrôle CPAM ({{ dossier.controles_cpam|length }})

{% for ctrl in dossier.controles_cpam %}
OGC {{ ctrl.numero_ogc }} — {{ ctrl.titre }} {% if 'retient' in ctrl.decision_ucr|lower %} {{ ctrl.decision_ucr }} {% elif 'confirme' in ctrl.decision_ucr|lower %} {{ ctrl.decision_ucr }} {% else %} {{ ctrl.decision_ucr }} {% endif %}
{# Argument CPAM #} {% if ctrl.arg_ucr %}
Argument CPAM
{{ ctrl.arg_ucr }}
{% endif %} {# Codes contestés #} {% if ctrl.dp_ucr or ctrl.da_ucr or ctrl.dr_ucr or ctrl.actes_ucr %}
Codes contestés
{% if ctrl.dp_ucr %}DP: {{ ctrl.dp_ucr }}{% endif %} {% if ctrl.da_ucr %}DA: {{ ctrl.da_ucr }}{% endif %} {% if ctrl.dr_ucr %}DR: {{ ctrl.dr_ucr }}{% endif %} {% if ctrl.actes_ucr %}Actes: {{ ctrl.actes_ucr }}{% endif %}
{% endif %} {# Contre-argumentation #} {% if ctrl.contre_argumentation %}
Contre-argumentation
{{ ctrl.contre_argumentation }}
{% endif %} {# Sources RAG #} {% if ctrl.sources_reponse %}
Sources RAG ({{ ctrl.sources_reponse|length }}) {% for src in ctrl.sources_reponse %}
{{ src.document }}{% if src.code %} — {{ src.code }}{% endif %}{% if src.page %} [p.{{ src.page }}]{% endif %}
{{ src.extrait or '' }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %} {# ---- Alertes de codage ---- #} {% if dossier.alertes_codage %}

Alertes de codage ({{ dossier.alertes_codage|length }})

{% endif %} {# ---- Diagnostic principal ---- #} {% if dossier.diagnostic_principal %} {% set dp = dossier.diagnostic_principal %}

Diagnostic principal

{{ dp.texte }}
{% if dp.cim10_suggestion %} {{ dp.cim10_suggestion }} {{ dp.cim10_confidence | confidence_badge }} {% if dp.est_cma %}CMA{% endif %} {{ dp.niveau_severite | severity_badge }} {% endif %} {% if dp.justification %}
{{ dp.justification }}
{% endif %} {% if dp.raisonnement %}
Raisonnement LLM
{{ dp.raisonnement }}
{% endif %} {% if dp.sources_rag %}
Sources RAG ({{ dp.sources_rag|length }}) {% for src in dp.sources_rag %}
{{ src.document }}{% if src.code %} — {{ src.code }}{% endif %}{% if src.page %} [p.{{ src.page }}]{% endif %}
{{ src.extrait or '' }}
{% endfor %}
{% endif %}
{% endif %} {# ---- Diagnostics associés ---- #} {% if dossier.diagnostics_associes %}

Diagnostics associés ({{ dossier.diagnostics_associes|length }})

{% for das in dossier.diagnostics_associes %} {% if das.raisonnement %} {% endif %} {% if das.sources_rag %} {% endif %} {% endfor %}
TexteCIM-10ConfianceSévéritéJustification
{{ das.texte }} {% if das.est_cma %}CMA{% endif %} {% if das.cim10_suggestion %}{{ das.cim10_suggestion }}{% endif %} {{ das.cim10_confidence | confidence_badge }} {{ das.niveau_severite | severity_badge }} {{ das.justification or '' }}
Raisonnement LLM
{{ das.raisonnement }}
Sources RAG ({{ das.sources_rag|length }}) {% for src in das.sources_rag %}
{{ src.document }}{% if src.code %} — {{ src.code }}{% endif %}{% if src.page %} [p.{{ src.page }}]{% endif %}
{{ src.extrait or '' }}
{% endfor %}
{% endif %} {# ---- Actes CCAM ---- #} {% if dossier.actes_ccam %}

Actes CCAM ({{ dossier.actes_ccam|length }})

{% for a in dossier.actes_ccam %} {% endfor %}
TexteCode CCAMRegroupementDateValidité
{{ a.texte }} {% if a.code_ccam_suggestion %}{{ a.code_ccam_suggestion }}{% endif %} {% if a.code_ccam_suggestion and ccam_dict.get(a.code_ccam_suggestion, {}).get('regroupement') %} {{ ccam_dict[a.code_ccam_suggestion]['regroupement'] }} {% else %} — {% endif %} {{ a.date or '' }} {% if a.validite == 'valide' %}Valide {% elif a.validite == 'obsolete' %}Obsolète {% else %}—{% endif %} {% for alerte in a.alertes %}
{{ alerte }}
{% endfor %}
{% endif %} {# ---- Biologie clé ---- #} {% if dossier.biologie_cle %}

Biologie clé ({{ dossier.biologie_cle|length }})

{% for b in dossier.biologie_cle %} {% endfor %}
TestValeurAnomalie
{{ b.test }} {{ b.valeur or '' }} {% if b.anomalie %}Oui{% else %}—{% endif %}
{% endif %} {# ---- Imagerie ---- #} {% if dossier.imagerie %}

Imagerie ({{ dossier.imagerie|length }})

{% for img in dossier.imagerie %}
{{ img.type }} {% if img.score %} — Score : {{ img.score }}{% endif %} {% if img.conclusion %}
{{ img.conclusion }}
{% endif %}
{% endfor %}
{% endif %} {# ---- Traitements de sortie ---- #} {% if dossier.traitements_sortie %}

Traitements de sortie ({{ dossier.traitements_sortie|length }})

{% for t in dossier.traitements_sortie %} {% endfor %}
MédicamentPosologieCode ATC
{{ t.medicament }} {{ t.posologie or '' }} {% if t.code_atc %}{{ t.code_atc }}{% endif %}
{% endif %} {# ---- Antécédents ---- #} {% if dossier.antecedents %}

Antécédents ({{ dossier.antecedents|length }})

{% endif %} {# ---- Complications ---- #} {% if dossier.complications %}

Complications ({{ dossier.complications|length }})

{% endif %} {% endblock %} {% block scripts %} {% endblock %}