{% extends "base.html" %} {% block title %}{{ dossier.source_file or filepath }}{% endblock %} {% block content %} ← Retour à la liste {# ==================================================================== #} {# 1. BANDEAU PATIENT — Identité + Séjour + Codage DP + GHM + Score #} {# ==================================================================== #} {% set s = dossier.sejour %} {% set dp = dossier.diagnostic_principal %} {% set ghm = dossier.ghm_estimation %} {% set vr = dossier.veto_report %}
{{ ghm.ghm_approx }}
{% 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 %}
Niv. {{ ghm.severite }}
{% elif ghm.severite == 2 %}
Niv. {{ ghm.severite }}
{% elif ghm.severite == 3 %}
Niv. {{ ghm.severite }}
{% else %}
Niv. {{ ghm.severite }}
{% endif %}
{{ ghm.cma_count }} CMA, {{ ghm.cms_count }} CMS
{{ dp.raisonnement }}
{{ src.document }}{% if src.code %} — {{ src.code }}{% endif %}{% if src.page %} [p.{{ src.page }}]{% endif %}
{{ src.extrait or '' }}
{% endfor %}
| Code CIM-10 | Libellé | CMA | Confiance | Source |
|---|---|---|---|---|
|
{% if das.cim10_suggestion %}
{% if das.cim10_final and das.cim10_final != das.cim10_suggestion %}
{{ das.cim10_suggestion }}
→
{{ das.cim10_final }}
{% elif das.status == 'ruled_out' %}
{{ das.cim10_suggestion }}
{% else %}
{{ das.cim10_suggestion }}
{% endif %}
{% if das.cim10_decision and das.cim10_decision.action != 'KEEP' %}
{{ das.cim10_decision | decision_badge }}
{% for rule in das.cim10_decision.applied_rules %}
{{ rule }}
{% endfor %}
{% endif %}
{% if das.status == 'needs_info' %}
Info requise
{% if das.cim10_decision and das.cim10_decision.needs_info %}
{% endif %}
{% endif %}
détails
|
{{ das.texte }}
{% if das.justification %}
{{ das.justification }}
{% endif %}
{% if das.preuves_cliniques %}
preuves ({{ das.preuves_cliniques|length }})
|
{% if das.niveau_cma and das.niveau_cma > 1 %} {{ das.niveau_cma | cma_level_badge }} {% elif das.est_cma %} CMA {% else %} — {% endif %} | {{ das.cim10_confidence | confidence_badge }} | {% if das.source %} {{ das.source }} {% endif %} {% if das.source_page %} {% endif %} |
{{ das.ruled_out_reason }} | ||||
{{ das.cim10_decision.reason }} | ||||
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 %}
| ||||
| Code CCAM | Libellé | Regroupement | Date | Validité | Source |
|---|---|---|---|---|---|
| {% if a.code_ccam_suggestion %}{{ a.code_ccam_suggestion }}{% endif %} | {{ a.texte }} | {% 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 %}
|
{% if a.source_page %}{% endif %} |
| Règle | Sévérité | Localisation | Message d'alerte | Source / Référence |
|---|---|---|---|---|
{{ issue.veto }} |
{% if issue.severity == 'HARD' %}Bloquant {% elif issue.severity == 'MEDIUM' %}À vérifier {% else %}Optimisation{% endif %} | {{ issue.where|human_where }} | {{ issue.message }} | {{ issue.citation or '—' }} |
[{{ ref.document or '' }}{% if ref.page %}, p.{{ ref.page }}{% endif %}] {{ ref.citation or '' }}{% elif ref is string %}
{{ ref }}
{% endif %} {% endfor %}{{ ctrl.contre_argumentation }}
{{ src.document }}{% if src.code %} — {{ src.code }}{% endif %}{% if src.page %} [p.{{ src.page }}]{% endif %}
{{ src.extrait or '' }}
{% endfor %}
| Test | Valeur | Anomalie | Source |
|---|---|---|---|
| {{ b.test }} | {{ b.valeur or '' }} | {% if b.quality == 'suspect' %} Suspect {% elif b.anomalie %} 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 %} ↑ {{ b.valeur }} > {{ hi }} (N: {{ lo }}–{{ hi }}) {% elif b.valeur_num < lo %} ↓ {{ b.valeur }} < {{ lo }} (N: {{ lo }}–{{ hi }}) {% endif %} {% elif b.test in bio_normals %} {% set lo, hi = bio_normals[b.test] %} (N: {{ lo }}–{{ hi }}) {% endif %} {% else %}—{% endif %} | {% if b.source_page %}{% endif %} |
| Test | Valeur | Raison |
|---|---|---|
| {{ b.test or '' }} | {{ b.valeur or '' }} | {{ b.discard_reason or '—' }} |
| Médicament | Posologie | Code ATC | Source |
|---|---|---|---|
| {{ t.medicament }} | {{ t.posologie or '' }} | {% if t.code_atc %}{{ t.code_atc }}{% endif %} | {% if t.source_page %}{% endif %} |
| Document | Type | DAS | Actes |
|---|---|---|---|
| {{ sib.name | format_doc_name }} {% if sib.path_rel == filepath %} actuel {% endif %} {% if 'fusionne' in sib.name %} fusionné {% endif %} | {% if sib.dossier.document_type %}{{ sib.dossier.document_type }}{% endif %} | {{ sib.dossier.diagnostics_associes|length }} | {{ sib.dossier.actes_ccam|length }} |