Project

General

Profile

0001-patient-record-id-grayed-on-all-pages-in-order-to-av.patch

Serghei Mihai, 18 August 2014 05:00 PM

Download (8.24 KB)

View differences:

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(-)
calebasse/actes/templates/actes/act_listing.html
109 109
      {% for act in object_list %}
110 110
      <tr data-id="{{ act.id }}" data-isbilled="{{ act.is_billed }}"
111 111
      {% if not act.is_billed %}class="non-factu"{% else %}{% if not act.invoice_set.all.0.number %}data-oldbilled="True"{% endif %}{% endif %}>
112
        <td>{{ act.patient.paper_id }} ({{ act.patient.id }})
112
        <td>{{ act.patient.paper_id|default_if_none:'' }} <span class="lightgray">({{ act.patient.id }})</span>
113 113
            {{ act.patient.first_name }}
114 114
            <span class="lastname">{{ act.patient.last_name }}</span>
115 115
        </td>
calebasse/agenda/templates/agenda/act-validation.html
38 38
    {% for acte, last_status, last_status_name in actes %}
39 39
    <div class="frame acte" id="acte-frame-{{ acte.id }}">
40 40
      <h3>{{ acte.time|time:"H:i" }} - <strong><span class="lastname">{{ acte.patient.last_name }}</span> {{ acte.patient.first_name }}</strong>
41
          {% if acte.patient.paper_id %} {{ acte.patient.paper_id }} {% endif %}({{ acte.patient.id }}) -
41
          {% if acte.patient.paper_id %} {{ acte.patient.paper_id }} {% endif %}
42 42
          <strong>{{ acte.act_type }}</strong>
43 43
          <p>{% if acte.doctors %}{% for doctor in acte.doctors.all %}<span class="lastname">{{ doctor.last_name }}</span> {{ doctor.first_name }} {% endfor %}{% endif %}</p>
44 44
          {% if acte.description %} <span title="Un commentaire existe" class="icon-comment"></span>{% endif%}
calebasse/dossiers/templates/dossiers/index.html
77 77
      {% for patient_record in patient_records %}
78 78
      <tr style="display: table-row;" class="pr-line {{ patient_record.state_class }}" data-link="{{ patient_record.object.id }}/view">
79 79
          <td>{{ patient_record.object.paper_id|default_if_none:"" }} </td>
80
          <td>{{ patient_record.object.id }}</td>
80
          <td class="lightgray">{{ patient_record.object.id }}</td>
81 81
          <td>{% if patient_record.object.confidential %}<span title="Dossier confidentiel" class="icon-lock" style="margin-right: 5px;"></span>{% endif %}<span class="lastname">{{ patient_record.object.last_name }}</span></td>
82 82
          <td>{{ patient_record.object.first_name }}</td>
83 83
          <td>{{ patient_record.object.birthdate|date:"d/m/Y" }}</td>
calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html
7 7
    <label>N° dossier papier :</label> {{ object.paper_id|default_if_none:"Non renseigné" }}
8 8
    <button id="update-paper-id-btn" type='button' class="icon-edit" title="Modifier"></button>
9 9
    </li>
10
    <li><label>N° dossier informatique :</label> <span class="lightgray">{{ object.id }}</span></li>
10 11
    <li><label>Nom :</label> <span class="lastname">{{ object.last_name }}</span></li>
11 12
    <li><label>Prénom :</label> {{ object.first_name }}</li>
12 13
    <li><label>Genre :</label> {{ object.get_gender_display|default_if_none:"Non renseigné" }}</li>
calebasse/static/css/style.css
1402 1402

  
1403 1403
.clear {
1404 1404
    clear: both;
1405
}
1406

  
1407
.lightgray {
1408
    color: #bbb;
1405 1409
}
calebasse/statistics/statistics.py
672 672
        active_states = ('SUIVI', )
673 673
    else:
674 674
        active_states = ('TRAITEMENT', )
675
    patients = [(p.last_name, p.first_name, p.paper_id) \
675
    patients = [(p.last_name, p.first_name, p.paper_id, p.pk) \
676 676
        for p in PatientRecord.objects.filter(service=statistic.in_service) \
677 677
            if p.get_state_at_day(statistic.in_start_date) and \
678 678
                p.get_state_at_day(statistic.in_start_date).status.type in active_states]
679 679
    data_tables_set=[[[['En date du :', formats.date_format(statistic.in_start_date, "SHORT_DATE_FORMAT"), len(patients)]]]]
680 680
    data = []
681
    data.append(['Nom', 'Prénom', 'N° Dossier'])
681
    data.append(['Nom', 'Prénom', 'N° Dossier', 'N° dossier informatique'])
682 682
    p_list = []
683
    for ln, fn, pid in patients:
683
    for ln, fn, paper_id, pid in patients:
684 684
        ln = ln or ''
685 685
        if len(ln) > 1:
686 686
            ln = ln[0].upper() + ln[1:].lower()
687 687
        fn = fn or ''
688 688
        if len(fn) > 1:
689 689
            fn = fn[0].upper() + fn[1:].lower()
690
        p_list.append((ln, fn, str(pid or '')))
690
        p_list.append((ln, fn, str(paper_id or ''), {'data': pid, 'style': 'lightgray'}))
691 691
    data.append(sorted(p_list,
692 692
        key=lambda k: k[0]+k[1]))
693 693
    data_tables_set[0].append(data)
......
1746 1746
        self.no_synthesis = inputs.get('no_synthesis')
1747 1747

  
1748 1748
    def get_data(self):
1749
        print self.name
1749 1750
        func = globals()[self.name]
1750 1751
        data = func(self)
1751 1752
        self.data = [[[["Date du jour", "Service", "Nom statistique"],
calebasse/statistics/templates/statistics/detail.html
28 28
        {% for values in data.1 %}
29 29
        <tr>
30 30
            {% for value in values %}
31
                {% if not value|is_list %}
32
                <td class="width-limited">{{ value }}</td>
33
                {% else %}
31
                {% if value|is_list %}
34 32
                <td class="width-limited">
35 33
                    <ul>
36 34
                        {% for val in value %}
......
38 36
                        {% endfor %}
39 37
                    </ul>
40 38
                </td>
39
                {% elif value|is_dict %}
40
                <td class="width-limited {{ value.style }}">{{ value.data }}</td>
41
                {% else %}
42
                <td class="width-limited">{{ value }}</td>
41 43
                {% endif %}
42 44
            {% endfor %}
43 45
        </tr>
calebasse/statistics/templatetags/statistics_filters.py
6 6
@register.filter
7 7
def is_list(value):
8 8
    return isinstance(value, (list, tuple))
9

  
10
@register.filter
11
def is_dict(value):
12
    return isinstance(value, dict)
9
-