Project

General

Profile

« Previous | Next » 

Revision 0bb70851

Added by Mikaël Ates over 12 years ago

dossiers: warn user when closing a patient record with future appointments.

View differences:

calebasse/dossiers/states.py
'DIAGNOSTIC': ('diagnostic-patientrecord', 'En diagnostic'),
'TRAITEMENT': ('traitement-patientrecord', 'En traitement'),
'CLOS': ('close-patientrecord', 'Clore'),
'CLOS_RDV': ('close-rdv-patientrecord', 'Clore'),
'BILAN': ('bilan-patientrecord', 'En bilan'),
'SURVEILLANCE': ('surveillance-patientrecord', 'En surveillance'),
'SUIVI': ('suivi-patientrecord', 'En suivi'),
......
#STATES_MAPPING = dict(CMPP_STATES, **CAMSP_STATES)
#STATES_MAPPING = dict(STATES_MAPPING, **SESSAD_STATES)
calebasse/dossiers/templates/dossiers/state.html
<form action="{{ request.get_full_path }}" method="post">
{% csrf_token %}
<p class="message"/>
<p>
<label for="id_date">Date :</label>
{{ form.date.errors }}
calebasse/dossiers/views.py
ctx['missing_birthdate'] = True
ctx['status'] = []
close_btn = STATES_BTN_MAPPER['CLOS']
if 'next_rdv' in ctx:
close_btn = STATES_BTN_MAPPER['CLOS_RDV']
if ctx['object'].service.name == "CMPP":
ctx['can_rediag'] = self.object.create_diag_healthcare(self.request.user)
status = self.object.get_healthcare_status()
......
elif ctx['object'].last_state.status.type == "DIAGNOSTIC":
# Passage automatique en traitement
ctx['status'] = [STATES_BTN_MAPPER['TRAITEMENT'],
STATES_BTN_MAPPER['CLOS'],
close_btn,
STATES_BTN_MAPPER['ACCUEIL']]
elif ctx['object'].last_state.status.type == "TRAITEMENT":
# Passage automatique en diagnostic si on ajoute une prise en charge diagnostic,
# ce qui est faisable dans l'onglet prise en charge par un bouton visible sous conditions
ctx['status'] = [STATES_BTN_MAPPER['DIAGNOSTIC'],
STATES_BTN_MAPPER['CLOS'],
close_btn,
STATES_BTN_MAPPER['ACCUEIL']]
elif ctx['object'].last_state.status.type == "CLOS":
# Passage automatique en diagnostic ou traitement
......
STATES_BTN_MAPPER['BILAN'],
STATES_BTN_MAPPER['SURVEILLANCE'],
STATES_BTN_MAPPER['SUIVI'],
STATES_BTN_MAPPER['CLOS']]
close_btn]
elif ctx['object'].last_state.status.type == "BILAN":
ctx['status'] = [STATES_BTN_MAPPER['SURVEILLANCE'],
STATES_BTN_MAPPER['SUIVI'],
STATES_BTN_MAPPER['CLOS'],
close_btn,
STATES_BTN_MAPPER['ACCUEIL']]
elif ctx['object'].last_state.status.type == "SURVEILLANCE":
ctx['status'] = [STATES_BTN_MAPPER['SUIVI'],
STATES_BTN_MAPPER['CLOS'],
close_btn,
STATES_BTN_MAPPER['ACCUEIL'],
STATES_BTN_MAPPER['BILAN']]
elif ctx['object'].last_state.status.type == "SUIVI":
ctx['status'] = [STATES_BTN_MAPPER['CLOS'],
ctx['status'] = [close_btn,
STATES_BTN_MAPPER['ACCUEIL'],
STATES_BTN_MAPPER['BILAN'],
STATES_BTN_MAPPER['SURVEILLANCE']]
......
elif ctx['object'].last_state.status.type == "FIN_ACCUEIL":
ctx['status'] = [STATES_BTN_MAPPER['ACCUEIL'],
STATES_BTN_MAPPER['TRAITEMENT'],
STATES_BTN_MAPPER['CLOS']]
close_btn]
elif ctx['object'].last_state.status.type == "TRAITEMENT":
ctx['status'] = [STATES_BTN_MAPPER['CLOS'],
ctx['status'] = [close_btn,
STATES_BTN_MAPPER['ACCUEIL']]
elif ctx['object'].last_state.status.type == "CLOS":
ctx['status'] = [STATES_BTN_MAPPER['ACCUEIL'],
calebasse/static/js/calebasse.dossiers.js
window.location.reload(true);
}
}
if (state_type == 'CLOS_RDV') {
var message = $('p.message')
message.append($('<span id="highlight">Attention ce patient a encore des rendez-vous de planifiés !</span>'));
state_type = 'CLOS';
}
$('input.date', this).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
$('form', this).ajaxForm({
success: onsuccess,
......
$('#close-patientrecord').click(function() {
state_dialog('update-state', 'Clore', 'CLOS');
});
$('#close-rdv-patientrecord').click(function() {
state_dialog('update-state', 'Clore', 'CLOS_RDV');
});
$('#reopen-patientrecord').click(function() {
state_dialog('update-state', 'Réaccueil', 'ACCUEIL');
});

Also available in: Unified diff