From 949a48e834f1fc7d61e4ca75ad6a97c6ca72d872 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Thu, 31 Jul 2014 17:39:40 +0200 Subject: [PATCH] dossiers: printing each patient record tab with filtering past and future appointments by dates Closes #3109 --- calebasse/dossiers/forms.py | 7 +++ .../dossiers/patientrecord_tab1_general.html | 9 +++- .../dossiers/patientrecord_tab2_fiche_adm.html | 7 +++ .../dossiers/patientrecord_tab3_adresses.html | 7 +++ .../dossiers/patientrecord_tab4_notifs.html | 7 +++ .../dossiers/patientrecord_tab5_actes_passes.html | 21 +++++++- .../dossiers/patientrecord_tab6_next_rdv.html | 21 +++++++- .../dossiers/patientrecord_tab7_socialisation.html | 8 +++ .../dossiers/patientrecord_tab8_medical.html | 7 +++ calebasse/static/css/agenda.css | 4 -- calebasse/static/css/dossiers.css | 27 +++++++++- calebasse/static/css/print.css | 57 +++++++++++++++++++++- calebasse/static/css/style.css | 7 +++ calebasse/static/js/calebasse.agenda.js | 14 ------ calebasse/static/js/calebasse.dossiers.js | 40 +++++++++++++++ calebasse/static/js/common.js | 13 +++++ calebasse/templates/calebasse/base.html | 1 + 17 files changed, 234 insertions(+), 23 deletions(-) create mode 100644 calebasse/static/js/common.js diff --git a/calebasse/dossiers/forms.py b/calebasse/dossiers/forms.py index 0fbc495..5aa3adc 100644 --- a/calebasse/dossiers/forms.py +++ b/calebasse/dossiers/forms.py @@ -398,3 +398,10 @@ class QuotationsForm(Form): date_actes_start = forms.DateField(label=u'Date', localize=True) date_actes_end = forms.DateField(label=u'Date', localize=True) without_quotations = forms.BooleanField() + +class PatientRecordPrintForm(Form): + + prev_appointment_start_date = forms.DateField(label=u'De', required=False) + prev_appointment_end_date = forms.DateField(label=u'au', required=False) + next_appointment_start_date = forms.DateField(label=u'De', required=False) + next_appointment_end_date = forms.DateField(label=u'au', required=False) diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html index 656aa57..b96bd6c 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html @@ -1,3 +1,4 @@ +
{% csrf_token %}
    @@ -84,7 +85,7 @@ {% for state in status %} {% endfor %} -
    +
    {{ form.confidential.label_tag }} : {{ form.confidential }} @@ -114,3 +115,9 @@

+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab2_fiche_adm.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab2_fiche_adm.html index 465ce3b..3a4bc98 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab2_fiche_adm.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab2_fiche_adm.html @@ -1,4 +1,5 @@ {% load dossiers %} +
{% csrf_token %}

@@ -164,3 +165,9 @@ {% endfor %}
+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html index 1dbe5ba..52ed122 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html @@ -1,4 +1,5 @@ {% load dossiers %} +
{% csrf_token %}

@@ -97,3 +98,9 @@ {% endfor %}

+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab4_notifs.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab4_notifs.html index 7b4223a..57e4e14 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab4_notifs.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab4_notifs.html @@ -1,3 +1,4 @@ +
{% if object.service.slug == "cmpp" %}
@@ -215,3 +216,9 @@ {% endif %} {% endif %}
+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab5_actes_passes.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab5_actes_passes.html index c7c55fc..b3aa1d4 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab5_actes_passes.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab5_actes_passes.html @@ -1,3 +1,13 @@ +
+
+
Filtrer par date
+ du + au +
+ +
+ +
{% for state, last_rdvs in history %}
@@ -10,7 +20,8 @@ {% for act, state, missing_workers in last_rdvs %} - {{ act.date|date:"SHORT_DATE_FORMAT" }} {{ act.time|date:"H:i" }}{% if missing_workers %} {% endif %} + {{ act.date|date:"SHORT_DATE_FORMAT" }} + {{ act.time|date:"H:i" }}{% if missing_workers %} {% endif %} {% if state %}{% if act.is_absent %}{% endif %}{% if state.state_name == 'ACT_DOUBLE' or state.state_name == 'ACT_LOST' %}Présent ({{ state }}){% else %}{{ state }}{% endif %}{% if act.is_absent %}{% endif %}{% else %}Non pointé.{% endif %} {{ act.act_type }} {% for doctor in act.doctors.all %} @@ -27,3 +38,11 @@
{% endfor %}
+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab6_next_rdv.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab6_next_rdv.html index e84f7e5..253b31d 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab6_next_rdv.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab6_next_rdv.html @@ -1,3 +1,13 @@ +
+
+
Filtrer par date
+ du + au +
+ +
+
+
@@ -6,7 +16,8 @@ {% for event, state, missing_participants, inactive_participants in next_rdvs %} - +
{% firstof event.start_datetime|date:"l d/m/y H:i"|title %}{% if missing_participants or inactive_participants %} {% endif %}{{ event.start_datetime|date:"SHORT_DATE_FORMAT" }} + {% firstof event.start_datetime|date:"H:i"|title %}{% if missing_participants or inactive_participants %} {% endif %} {% if state %}{% if state.state_name != 'VALIDE' %}{% endif %}{{ state }}{% if state.state_name != 'VALIDE' %}{% endif %}{% else %}Non pointé.{% endif %} {{ event.act_type }} {% for participant in event.participants.all %} @@ -32,3 +43,11 @@
+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab7_socialisation.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab7_socialisation.html index a80a11b..f6daff5 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab7_socialisation.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab7_socialisation.html @@ -1,3 +1,5 @@ + +

Périodes de socialisation

@@ -68,3 +70,9 @@ {% endfor %}
+ diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab8_medical.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab8_medical.html index 43633f6..c16aa4e 100644 --- a/calebasse/dossiers/templates/dossiers/patientrecord_tab8_medical.html +++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab8_medical.html @@ -1,3 +1,4 @@ +
{% csrf_token %} @@ -16,3 +17,9 @@
+ diff --git a/calebasse/static/css/agenda.css b/calebasse/static/css/agenda.css index 3d3326d..633aea8 100644 --- a/calebasse/static/css/agenda.css +++ b/calebasse/static/css/agenda.css @@ -1,7 +1,3 @@ -br.clear { - clear: both; -} - td#dispos { vertical-align: top; } diff --git a/calebasse/static/css/dossiers.css b/calebasse/static/css/dossiers.css index dc958cf..14081a3 100644 --- a/calebasse/static/css/dossiers.css +++ b/calebasse/static/css/dossiers.css @@ -126,4 +126,29 @@ div#tabs-4 div div.buttons { input[type=checkbox] + button { display: none; -} \ No newline at end of file +} + +.patientrecord_print ul { + margin: 0; + padding: 0; +} + +.patientrecord_print li { + list-style-type: none; + display: inline; +} + +.patientrecord_print label { + margin: 0 .5em; +} + +.print { + float: right; +} +.print h5 { + margin: 0; +} + +.print form { + display: inline; +} diff --git a/calebasse/static/css/print.css b/calebasse/static/css/print.css index 9287787..136ad6c 100644 --- a/calebasse/static/css/print.css +++ b/calebasse/static/css/print.css @@ -7,8 +7,12 @@ html { color: black; } +button { + display: none; +} + div#header, div#splash, div#footer, div#appbar, div#datesel, -div#djDebugToolbarHandle, button#uncheck-all, button#check-all, input.printable { +div#djDebugToolbarHandle, input.printable { display: none; } @@ -100,4 +104,55 @@ table.main { table.main td, table.main th { border: 1px solid #555; padding: 0 .5em; +} + + + /* Patient record printing */ + +textarea, input[type=text], select { + border: 0; +} + +textarea[value=''] { + display: none; +} + +input[value=''] { + display: none; +} + +#tabs > ul { + display: none; +} + +.social-security-contact ul { + display: block; +} + + /* tabs-7 */ + +#tabs-7 .subframe { + padding: 0 .5em; +} + + /* tabs-8 */ + +#tabs-8 label { + display: inline; +} + +.select2-results { + display: none; +} + +.select2-choices { + list-style-type:none; +} + +.select2-container + select { + display: none; +} + +#tabs-8 label:after { + content: ':'; } \ No newline at end of file diff --git a/calebasse/static/css/style.css b/calebasse/static/css/style.css index 69e6886..6d2e472 100644 --- a/calebasse/static/css/style.css +++ b/calebasse/static/css/style.css @@ -1407,3 +1407,10 @@ label.social-security-label:hover { display: none; } +.right { + float: right; +} + +.clear { + clear: both; +} \ No newline at end of file diff --git a/calebasse/static/js/calebasse.agenda.js b/calebasse/static/js/calebasse.agenda.js index 2f35134..7b47029 100644 --- a/calebasse/static/js/calebasse.agenda.js +++ b/calebasse/static/js/calebasse.agenda.js @@ -4,15 +4,6 @@ var app_name = path[2]; var current_date = path[3]; COOKIE_PATH = '/' + service + '/agenda'; -function delete_prompt(text) { - var r = prompt(text + '\n Pour cela veuillez entrer DEL'); - if (r.toLowerCase().replace(/^\s+|\s+$/g, '') == 'del') { - return true; - } else { - return false; - } -} - function get_initial_fields(button, base) { var participants = new Array(); var ressource = null; @@ -273,11 +264,6 @@ function toggle_ressource(ressource) { return $(ressource_target).find('a.tab'); } -function init_datepickers(dialog) { - $('.datepicker-date', dialog).datepicker({dateFormat: 'd/m/yy', showOn: 'button'}); - $('.datepicker input', dialog).datepicker({dateFormat: 'd/m/yy', showOn: 'button'}); -} - function event_dialog(url, title, width, btn_text) { function add_periodic_events(base) { init_datepickers(base); diff --git a/calebasse/static/js/calebasse.dossiers.js b/calebasse/static/js/calebasse.dossiers.js index 1388a68..eb6217d 100644 --- a/calebasse/static/js/calebasse.dossiers.js +++ b/calebasse/static/js/calebasse.dossiers.js @@ -10,6 +10,40 @@ function add_datepickers(that) { $('input#id_prolongation_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' }); } +function print_cleanup() { + $.each($('textarea'), function() { + if(!$(this).val()) + $(this).addClass('screen-only'); + else + $(this).removeClass('screen-only'); + }); + + // $.each($('select'), function() { + // $(this).addClass('screen-only'); + // var span = $(''); + // span.addClass('print-only'); + // span.html($(this).val()); + // $(this).parent().append(span); + // console.log($(this).val()); + // }); +} + +function filter_date_bounds(selector) { + var from = $('form.filter input[name=from]').datepicker('getDate'); + var to = $('form.filter input[name=to]').datepicker('getDate'); + if (to) { + to.setHours(23); to.setMinutes(59); to.setSeconds(59); + } + $.each($(selector), function(){ + var current = $.datepicker.parseDate('d/m/yy', $(this).text()); + if (current < from || (to && current >= to)) { + $(this).parent().parent().addClass('screen-only'); + } else { + $(this).parent().parent().removeClass('screen-only'); + } + }); +} + function load_add_address_dialog() { var str = $("#contactform").serialize(); $.cookie('contactform', str, { path: window.location.pathname }); @@ -391,6 +425,12 @@ function load_tab8_medical() { }); }); + $('#patientrecord-print-button').on('click', function(event) { + event.preventDefault(); + generic_ajaxform_dialog($(this).attr('href'), 'Impression dossier patient', + '#ajax-dlg', '450px', 'Imprimer', false, false); + }); + $('#new-patientrecord').click(function() { generic_ajaxform_dialog('new', 'Nouveau dossier', '#dossier-dlg', '700px', 'Ajouter', false, function(that) { diff --git a/calebasse/static/js/common.js b/calebasse/static/js/common.js new file mode 100644 index 0000000..8d29cd8 --- /dev/null +++ b/calebasse/static/js/common.js @@ -0,0 +1,13 @@ +function delete_prompt(text) { + var r = prompt(text + '\n Pour cela veuillez entrer DEL'); + if (r.toLowerCase().replace(/^\s+|\s+$/g, '') == 'del') { + return true; + } else { + return false; + } +} + +function init_datepickers(on) { + $('.datepicker-date', on).datepicker({dateFormat: 'd/m/yy', showOn: 'button'}); + $('.datepicker input', on).datepicker({dateFormat: 'd/m/yy', showOn: 'button'}); +} diff --git a/calebasse/templates/calebasse/base.html b/calebasse/templates/calebasse/base.html index 584ee4b..eefd03a 100644 --- a/calebasse/templates/calebasse/base.html +++ b/calebasse/templates/calebasse/base.html @@ -20,6 +20,7 @@ + -- 2.0.1