From 1f4ae3b347f15c0133b00b968bfc1ad9aab281d5 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Mon, 18 Aug 2014 16:06:50 +0200 Subject: [PATCH] patient record id grayed on all pages in order to avoid confusion Closes #3120 --- calebasse/actes/templates/actes/act_listing.html | 2 +- calebasse/agenda/templates/agenda/act-validation.html | 2 +- calebasse/dossiers/templates/dossiers/index.html | 2 +- .../dossiers/templates/dossiers/patientrecord_tab1_general.html | 1 + calebasse/static/css/style.css | 4 ++++ calebasse/statistics/statistics.py | 9 +++++---- calebasse/statistics/templates/statistics/detail.html | 8 +++++--- calebasse/statistics/templatetags/statistics_filters.py | 4 ++++ 8 files changed, 22 insertions(+), 10 deletions(-) diff --git a/calebasse/actes/templates/actes/act_listing.html b/calebasse/actes/templates/actes/act_listing.html index 62d01e9..9a28e52 100644 --- a/calebasse/actes/templates/actes/act_listing.html +++ b/calebasse/actes/templates/actes/act_listing.html @@ -109,7 +109,7 @@ {% for act in object_list %} - {{ act.patient.paper_id }} ({{ act.patient.id }}) + {{ act.patient.paper_id|default_if_none:'' }} ({{ act.patient.id }}) {{ act.patient.first_name }} {{ act.patient.last_name }} diff --git a/calebasse/agenda/templates/agenda/act-validation.html b/calebasse/agenda/templates/agenda/act-validation.html index e9e90fa..6fbd220 100644 --- a/calebasse/agenda/templates/agenda/act-validation.html +++ b/calebasse/agenda/templates/agenda/act-validation.html @@ -38,7 +38,7 @@ {% for acte, last_status, last_status_name in actes %}

{{ acte.time|time:"H:i" }} - {{ acte.patient.last_name }} {{ acte.patient.first_name }} - {% if acte.patient.paper_id %} {{ acte.patient.paper_id }} {% endif %}({{ acte.patient.id }}) - + {% if acte.patient.paper_id %} {{ acte.patient.paper_id }} {% endif %} {{ acte.act_type }}

{% if acte.doctors %}{% for doctor in acte.doctors.all %}{{ doctor.last_name }} {{ doctor.first_name }} {% endfor %}{% endif %}

{% if acte.description %} {% endif%} diff --git a/calebasse/dossiers/templates/dossiers/index.html b/calebasse/dossiers/templates/dossiers/index.html index 0ee72a8..e3fc2b9 100644 --- a/calebasse/dossiers/templates/dossiers/index.html +++ b/calebasse/dossiers/templates/dossiers/index.html @@ -77,7 +77,7 @@ {% for patient_record in patient_records %} {{ patient_record.object.paper_id|default_if_none:"" }} - {{ patient_record.object.id }} + {{ patient_record.object.id }} {% if patient_record.object.confidential %}{% endif %}{{ patient_record.object.last_name }} {{ patient_record.object.first_name }} {{ patient_record.object.birthdate|date:"d/m/Y" }} diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html index a829da8..0c2e48c 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html @@ -7,6 +7,7 @@ {{ object.paper_id|default_if_none:"Non renseigné" }} +
  • {{ object.id }}
  • {{ object.last_name }}
  • {{ object.first_name }}
  • {{ object.get_gender_display|default_if_none:"Non renseigné" }}
  • diff --git a/calebasse/static/css/style.css b/calebasse/static/css/style.css index 6ac8f8d..44674c8 100644 --- a/calebasse/static/css/style.css +++ b/calebasse/static/css/style.css @@ -1402,4 +1402,8 @@ div.statistic { .clear { clear: both; +} + +.lightgray { + color: #bbb; } \ No newline at end of file diff --git a/calebasse/statistics/statistics.py b/calebasse/statistics/statistics.py index 603becf..fb9a6b8 100644 --- a/calebasse/statistics/statistics.py +++ b/calebasse/statistics/statistics.py @@ -672,22 +672,22 @@ def active_patients_by_state_only(statistic): active_states = ('SUIVI', ) else: active_states = ('TRAITEMENT', ) - patients = [(p.last_name, p.first_name, p.paper_id) \ + patients = [(p.last_name, p.first_name, p.paper_id, p.pk) \ for p in PatientRecord.objects.filter(service=statistic.in_service) \ if p.get_state_at_day(statistic.in_start_date) and \ p.get_state_at_day(statistic.in_start_date).status.type in active_states] data_tables_set=[[[['En date du :', formats.date_format(statistic.in_start_date, "SHORT_DATE_FORMAT"), len(patients)]]]] data = [] - data.append(['Nom', 'Prénom', 'N° Dossier']) + data.append(['Nom', 'Prénom', 'N° Dossier', 'N° dossier informatique']) p_list = [] - for ln, fn, pid in patients: + for ln, fn, paper_id, pid in patients: ln = ln or '' if len(ln) > 1: ln = ln[0].upper() + ln[1:].lower() fn = fn or '' if len(fn) > 1: fn = fn[0].upper() + fn[1:].lower() - p_list.append((ln, fn, str(pid or ''))) + p_list.append((ln, fn, str(paper_id or ''), {'data': pid, 'style': 'lightgray'})) data.append(sorted(p_list, key=lambda k: k[0]+k[1])) data_tables_set[0].append(data) @@ -1746,6 +1746,7 @@ class Statistic(object): self.no_synthesis = inputs.get('no_synthesis') def get_data(self): + print self.name func = globals()[self.name] data = func(self) self.data = [[[["Date du jour", "Service", "Nom statistique"], diff --git a/calebasse/statistics/templates/statistics/detail.html b/calebasse/statistics/templates/statistics/detail.html index 4b62657..8b0ca5e 100644 --- a/calebasse/statistics/templates/statistics/detail.html +++ b/calebasse/statistics/templates/statistics/detail.html @@ -28,9 +28,7 @@ {% for values in data.1 %} {% for value in values %} - {% if not value|is_list %} - {{ value }} - {% else %} + {% if value|is_list %}
      {% for val in value %} @@ -38,6 +36,10 @@ {% endfor %}
    + {% elif value|is_dict %} + {{ value.data }} + {% else %} + {{ value }} {% endif %} {% endfor %} diff --git a/calebasse/statistics/templatetags/statistics_filters.py b/calebasse/statistics/templatetags/statistics_filters.py index 1a905f1..e4ff48e 100644 --- a/calebasse/statistics/templatetags/statistics_filters.py +++ b/calebasse/statistics/templatetags/statistics_filters.py @@ -6,3 +6,7 @@ register = template.Library() @register.filter def is_list(value): return isinstance(value, (list, tuple)) + +@register.filter +def is_dict(value): + return isinstance(value, dict) -- 2.1.0