1 |
31dbe39d
|
Frédéric Péters
|
function add_datepickers(that) {
|
2 |
0bbd4c47
|
Jérôme Schneider
|
$('input#id_birthdate', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button',
|
3 |
|
|
changeMonth: true, changeYear: true, yearRange: 'c-80:c+2' });
|
4 |
31dbe39d
|
Frédéric Péters
|
$('input#id_start_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
5 |
638113d6
|
Mikaël Ates
|
$('input#id_request_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
6 |
|
|
$('input#id_agree_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
7 |
|
|
$('input#id_insist_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
8 |
31dbe39d
|
Frédéric Péters
|
$('input#id_end_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
9 |
|
|
$('input#id_date_selected', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
10 |
61405b31
|
Mikaël Ates
|
$('input#id_prolongation_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
11 |
31dbe39d
|
Frédéric Péters
|
}
|
12 |
f78e473c
|
Jérôme Schneider
|
|
13 |
f8f0eb15
|
Jérôme Schneider
|
function load_add_address_dialog() {
|
14 |
6d9e4005
|
Jérôme Schneider
|
var str = $("#contactform").serialize();
|
15 |
|
|
$.cookie('contactform', str, { path: window.location.pathname });
|
16 |
|
|
generic_ajaxform_dialog('address/new', 'Ajouter une adresse',
|
17 |
|
|
'#address-dlg', '600px', 'Ajouter');
|
18 |
c6f5c60f
|
Jérôme Schneider
|
}
|
19 |
|
|
|
20 |
54f8d003
|
Jérôme Schneider
|
function state_dialog(url, state_title, state_type) {
|
21 |
f78e473c
|
Jérôme Schneider
|
$('#change-record').load(url,
|
22 |
|
|
function () {
|
23 |
0070972e
|
Frédéric Péters
|
var patient_id = $(this).data('id');
|
24 |
|
|
var service_id = $(this).data('service-id');
|
25 |
f78e473c
|
Jérôme Schneider
|
function onsuccess(response, status, xhr, form) {
|
26 |
|
|
var parse = $(response);
|
27 |
|
|
if ($('.errorlist', parse).length != 0) {
|
28 |
|
|
$('#change-record').html(response);
|
29 |
|
|
$('#change-record form').ajaxForm({
|
30 |
|
|
success: onsuccess,
|
31 |
0070972e
|
Frédéric Péters
|
data: { patient_id: patient_id, state_type: state_type, service_id: service_id }
|
32 |
f78e473c
|
Jérôme Schneider
|
});
|
33 |
|
|
} else {
|
34 |
|
|
window.location.reload(true);
|
35 |
|
|
}
|
36 |
|
|
}
|
37 |
0bb70851
|
Mikaël Ates
|
if (state_type == 'CLOS_RDV') {
|
38 |
|
|
var message = $('p.message')
|
39 |
|
|
message.append($('<span id="highlight">Attention ce patient a encore des rendez-vous de planifiés !</span>'));
|
40 |
|
|
state_type = 'CLOS';
|
41 |
|
|
}
|
42 |
31dbe39d
|
Frédéric Péters
|
$('input.date', this).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
43 |
f78e473c
|
Jérôme Schneider
|
$('form', this).ajaxForm({
|
44 |
|
|
success: onsuccess,
|
45 |
0070972e
|
Frédéric Péters
|
data: { patient_id: patient_id, state_type: state_type, service_id: service_id }
|
46 |
f78e473c
|
Jérôme Schneider
|
});
|
47 |
54f8d003
|
Jérôme Schneider
|
$(this).dialog({title: "Changement - " + state_title,
|
48 |
f78e473c
|
Jérôme Schneider
|
width: '500px',
|
49 |
|
|
buttons: [ { text: "Annuler",
|
50 |
|
|
click: function() { $(this).dialog("close"); } },
|
51 |
|
|
{ text: "Valider",
|
52 |
|
|
click: function() { $("#change-record form").submit(); } }]});
|
53 |
|
|
});
|
54 |
|
|
}
|
55 |
|
|
|
56 |
8f67b4a1
|
Jérôme Schneider
|
function load_tab1_general() {
|
57 |
80def702
|
Jérôme Schneider
|
$('#update-paper-id-btn').click(function() {
|
58 |
|
|
generic_ajaxform_dialog('update/paper_id', 'Modifier le numéro du dossier papier',
|
59 |
|
|
'#ajax-dlg', '500px', 'Modifier');
|
60 |
10fa2da0
|
Frédéric Péters
|
});
|
61 |
f78e473c
|
Jérôme Schneider
|
$('#close-patientrecord').click(function() {
|
62 |
54f8d003
|
Jérôme Schneider
|
state_dialog('update-state', 'Clore', 'CLOS');
|
63 |
f3407c83
|
Jérôme Schneider
|
});
|
64 |
0bb70851
|
Mikaël Ates
|
$('#close-rdv-patientrecord').click(function() {
|
65 |
|
|
state_dialog('update-state', 'Clore', 'CLOS_RDV');
|
66 |
|
|
});
|
67 |
54f8d003
|
Jérôme Schneider
|
$('#reopen-patientrecord').click(function() {
|
68 |
|
|
state_dialog('update-state', 'Réaccueil', 'ACCUEIL');
|
69 |
f3407c83
|
Jérôme Schneider
|
});
|
70 |
85eb4072
|
Jérôme Schneider
|
$('#diagnostic-patientrecord').click(function() {
|
71 |
|
|
state_dialog('update-state', 'Diagnostic', 'DIAGNOSTIC');
|
72 |
|
|
});
|
73 |
|
|
$('#traitement-patientrecord').click(function() {
|
74 |
|
|
state_dialog('update-state', 'Traitement', 'TRAITEMENT');
|
75 |
|
|
});
|
76 |
|
|
$('#finaccueil-patientrecord').click(function() {
|
77 |
|
|
state_dialog('update-state', "Fin d'accueil", 'FIN_ACCUEIL');
|
78 |
|
|
});
|
79 |
|
|
$('#bilan-patientrecord').click(function() {
|
80 |
|
|
state_dialog('update-state', 'Bilan', 'BILAN');
|
81 |
|
|
});
|
82 |
|
|
$('#surveillance-patientrecord').click(function() {
|
83 |
|
|
state_dialog('update-state', 'Surveillance', 'SURVEILLANCE');
|
84 |
|
|
});
|
85 |
|
|
$('#suivi-patientrecord').click(function() {
|
86 |
|
|
state_dialog('update-state', 'Suivi', 'SUIVI');
|
87 |
|
|
});
|
88 |
54f8d003
|
Jérôme Schneider
|
$('#patientrecord-history').click(function() {
|
89 |
f3407c83
|
Jérôme Schneider
|
$('#dossier-histo-dlg').dialog({title: 'Historique dossier',
|
90 |
|
|
width: '500px',
|
91 |
|
|
buttons: [ { text: "Fermer",
|
92 |
|
|
click: function() { $(this).dialog("close"); } }]}
|
93 |
|
|
);
|
94 |
|
|
});
|
95 |
84416ac3
|
Frédéric Péters
|
if (location.hash.indexOf('histo') != -1) {
|
96 |
|
|
$('#patientrecord-history').click();
|
97 |
|
|
location.hash = '';
|
98 |
|
|
}
|
99 |
80def702
|
Jérôme Schneider
|
$('#id_pause').click(function() {
|
100 |
|
|
$('#general-form').submit();
|
101 |
|
|
});
|
102 |
|
|
$('#id_confidential').click(function() {
|
103 |
|
|
$('#general-form').submit();
|
104 |
|
|
});
|
105 |
|
|
}
|
106 |
|
|
|
107 |
8f67b4a1
|
Jérôme Schneider
|
function load_tab2_adm() {
|
108 |
80def702
|
Jérôme Schneider
|
init_magic_dialog();
|
109 |
|
|
$('#prescription-transport-btn').click(function() {
|
110 |
|
|
$('#ajax-dlg').load('prescription-transport',
|
111 |
|
|
function () {
|
112 |
|
|
$(this).dialog({title: 'Prescription de transport', width: '800px',
|
113 |
|
|
buttons: [ { text: "Fermer",
|
114 |
|
|
click: function() { $(this).dialog("close"); } },
|
115 |
|
|
{ text: "Prescrire",
|
116 |
|
|
click: function() { $("#ajax-dlg form").submit(); $(this).dialog("close"); } }]});
|
117 |
|
|
$('.addresses input[type=radio]').first().click();
|
118 |
|
|
});
|
119 |
|
|
return false;
|
120 |
|
|
});
|
121 |
|
|
$('#new-protection-btn').click(function() {
|
122 |
|
|
generic_ajaxform_dialog('protection/new', 'Ajouter une mesure de protection',
|
123 |
|
|
'#ajax-dlg', '800px', 'Ajouter', null, add_datepickers);
|
124 |
|
|
});
|
125 |
|
|
$('.update-protection-btn').click(function() {
|
126 |
|
|
generic_ajaxform_dialog('protection/' + $(this).data('id') + '/update', 'Modifier une mesure de protection',
|
127 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
128 |
|
|
});
|
129 |
|
|
$('.del-protection').click(function() {
|
130 |
|
|
generic_ajaxform_dialog('protection/' + $(this).data('id') + '/del', 'Supprimer une mesure de protection',
|
131 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
132 |
|
|
});
|
133 |
277ad21d
|
Jérôme Schneider
|
$('input#id_id-birthdate').datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
134 |
243e22a9
|
Jérôme Schneider
|
calebasse_ajax_form('#tabs-2');
|
135 |
80def702
|
Jérôme Schneider
|
}
|
136 |
|
|
|
137 |
8f67b4a1
|
Jérôme Schneider
|
function load_tab3_addresses() {
|
138 |
|
|
function nir_check(that) {
|
139 |
0bbd4c47
|
Jérôme Schneider
|
add_datepickers($(that));
|
140 |
8f67b4a1
|
Jérôme Schneider
|
$(that).find('#social-security-id input').keyup(function() {
|
141 |
|
|
if ($(this).val().length < 13) {
|
142 |
|
|
$('p#nir-key span').removeAttr('id')
|
143 |
|
|
$('p#nir-key span').text('-');
|
144 |
|
|
} else {
|
145 |
|
|
$('p#nir-key span').attr('id', 'highlight')
|
146 |
|
|
var nir = $(this).val();
|
147 |
|
|
var minus = 0;
|
148 |
|
|
if (nir.charAt(6) == 'A'){
|
149 |
|
|
nir = nir.replace('A', '0');
|
150 |
|
|
minus = 1000000;
|
151 |
|
|
}
|
152 |
|
|
if (nir.charAt(6) == 'B'){
|
153 |
|
|
nir = nir.replace('B', '0');
|
154 |
|
|
minus = 2000000;
|
155 |
|
|
}
|
156 |
|
|
nir = parseInt(nir, 10);
|
157 |
|
|
nir = nir - minus;
|
158 |
|
|
var key = 97 - (nir % 97);
|
159 |
|
|
if (isNaN(key)) {
|
160 |
|
|
$('p#nir-key span').text('NIR invalide');
|
161 |
|
|
} else {
|
162 |
|
|
$('p#nir-key span').text(key);
|
163 |
|
|
}
|
164 |
|
|
}
|
165 |
|
|
});
|
166 |
|
|
}
|
167 |
4e7cbf81
|
Jérôme Schneider
|
$('.policyholder-radio').click(function() {
|
168 |
|
|
$("#policyholder-form").submit();
|
169 |
|
|
});
|
170 |
|
|
$('#new-contact-btn').click(function() {
|
171 |
|
|
generic_ajaxform_dialog('contact/new', 'Ajouter un contact',
|
172 |
3a91ff50
|
Jérôme Schneider
|
'#ajax-dlg', '900px', 'Ajouter', null, nir_check, 850);
|
173 |
4e7cbf81
|
Jérôme Schneider
|
});
|
174 |
|
|
$('.update-contact-btn').click(function() {
|
175 |
|
|
generic_ajaxform_dialog('contact/' + $(this).data('id') + '/update', 'Modifier un contact',
|
176 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, nir_check);
|
177 |
|
|
});
|
178 |
|
|
$('.del-contact').click(function() {
|
179 |
|
|
generic_ajaxform_dialog('contact/' + $(this).data('id') + '/del?address=' + $(this).data('address-id'),
|
180 |
|
|
'Supprimer un contact', '#ajax-dlg', '500px', 'Supprimer');
|
181 |
|
|
});
|
182 |
|
|
$('#new-address-btn').click(function() {
|
183 |
|
|
generic_ajaxform_dialog('address/new', 'Ajouter une adresse',
|
184 |
|
|
'#ajax-dlg', '600px', 'Ajouter');
|
185 |
|
|
});
|
186 |
|
|
$('.update-address-btn').click(function() {
|
187 |
|
|
generic_ajaxform_dialog('address/' + $(this).data('id') + '/update', 'Modifier une adresse',
|
188 |
|
|
'#ajax-dlg', '600px', 'Modifier');
|
189 |
|
|
});
|
190 |
|
|
$('.del-address').click(function() {
|
191 |
|
|
generic_ajaxform_dialog('address/' + $(this).data('id') + '/del', 'Supprimer une addresse',
|
192 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
193 |
|
|
});
|
194 |
|
|
|
195 |
|
|
|
196 |
|
|
$('.place_of_life').click(function() {
|
197 |
|
|
if ((this.checked) == true) {
|
198 |
|
|
var value = "true";
|
199 |
|
|
} else {
|
200 |
|
|
var value = "false";
|
201 |
|
|
}
|
202 |
|
|
var prev = $(this).prev();
|
203 |
|
|
$.ajax({
|
204 |
|
|
url: '/api/v1/patientaddress/' + $(this).data("id") + '/?format=json',
|
205 |
|
|
type: 'PATCH',
|
206 |
dcf67ab1
|
Jérôme Schneider
|
async: false,
|
207 |
4e7cbf81
|
Jérôme Schneider
|
contentType: 'application/json',
|
208 |
|
|
data: '{"place_of_life": ' + value + '}',
|
209 |
|
|
success: function(data) {
|
210 |
|
|
(prev).show();
|
211 |
|
|
(prev).html('<li>Modification appliquée avec succés</li>');
|
212 |
|
|
$('.ajax_messages').delay(1500).fadeOut('slow');
|
213 |
|
|
location.reload();
|
214 |
|
|
}
|
215 |
|
|
});
|
216 |
|
|
});
|
217 |
|
|
$('.social-security-label').click(function() {
|
218 |
|
|
var label = $(this).html();
|
219 |
|
|
var data = $(this).next();
|
220 |
|
|
if (($(data).is(':hidden'))) {
|
221 |
|
|
$(this).html(label.replace('+', '-'));
|
222 |
|
|
$(this).css("font-weight", "bold");
|
223 |
|
|
} else {
|
224 |
|
|
$(this).html(label.replace('-', '+'));
|
225 |
|
|
$(this).css("font-weight", "");
|
226 |
|
|
}
|
227 |
|
|
$(data).toggle();
|
228 |
|
|
});
|
229 |
f8f0eb15
|
Jérôme Schneider
|
var hashes = location.hash.split('&');
|
230 |
|
|
for (i in hashes) {
|
231 |
|
|
if (hashes[i] == "newcontact") {
|
232 |
6d9e4005
|
Jérôme Schneider
|
var form = $.cookie('contactform');
|
233 |
|
|
generic_ajaxform_dialog('contact/new?'+ form, 'Ajouter un contact',
|
234 |
|
|
'#ajax-dlg', '900px', 'Ajouter', null, nir_check, 850);
|
235 |
|
|
$.removeCookie('contactform', { path: window.location.pathname });
|
236 |
f8f0eb15
|
Jérôme Schneider
|
}
|
237 |
|
|
}
|
238 |
|
|
location.hash = hashes[0];
|
239 |
80def702
|
Jérôme Schneider
|
}
|
240 |
4e7cbf81
|
Jérôme Schneider
|
|
241 |
8f67b4a1
|
Jérôme Schneider
|
function load_tab4_notifs() {
|
242 |
|
|
$('#new-hctrait-btn').click(function() {
|
243 |
|
|
generic_ajaxform_dialog('healthcare_treatment/new', 'Ajouter une prise en charge de traitement',
|
244 |
|
|
'#ajax-dlg', '600px', 'Ajouter', null, add_datepickers);
|
245 |
|
|
});
|
246 |
|
|
$('#new-hcdiag-btn').click(function() {
|
247 |
|
|
generic_ajaxform_dialog('healthcare_diagnostic/new', 'Ajouter une prise en charge de diagnostic',
|
248 |
|
|
'#ajax-dlg', '600px', 'Ajouter', null, add_datepickers);
|
249 |
|
|
});
|
250 |
|
|
$('#new-notification-btn').click(function() {
|
251 |
|
|
generic_ajaxform_dialog('healthcare_notification/new', 'Ajouter une notification',
|
252 |
|
|
'#ajax-dlg', '600px', 'Ajouter', null, add_datepickers);
|
253 |
|
|
});
|
254 |
|
|
$('.update-hctrait-btn').click(function() {
|
255 |
|
|
generic_ajaxform_dialog('healthcare_treatment/' + $(this).data('id') + '/update', 'Modifier une prise en charge de traitement',
|
256 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
257 |
|
|
});
|
258 |
|
|
$('.update-hcdiag-btn').click(function() {
|
259 |
|
|
generic_ajaxform_dialog('healthcare_diagnostic/' + $(this).data('id') + '/update', 'Modifier une prise en charge de diagnostic',
|
260 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
261 |
|
|
});
|
262 |
|
|
$('.update-notification-btn').click(function() {
|
263 |
|
|
generic_ajaxform_dialog('healthcare_notification/' + $(this).data('id') + '/update', 'Modifier une notification',
|
264 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
265 |
|
|
});
|
266 |
|
|
$('.del-hctrait').click(function() {
|
267 |
|
|
generic_ajaxform_dialog('healthcare_treatment/' + $(this).data('id') + '/del', 'Supprimer une prise en charge de traitement',
|
268 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
269 |
|
|
});
|
270 |
|
|
$('.del-hcdiag').click(function() {
|
271 |
|
|
generic_ajaxform_dialog('healthcare_diagnostic/' + $(this).data('id') + '/del', 'Supprimer une prise en charge de diagnostic',
|
272 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
273 |
|
|
});
|
274 |
|
|
$('.del-notification').click(function() {
|
275 |
|
|
generic_ajaxform_dialog('healthcare_notification/' + $(this).data('id') + '/del', 'Supprimer une notification',
|
276 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
277 |
|
|
});
|
278 |
|
|
|
279 |
80def702
|
Jérôme Schneider
|
}
|
280 |
8f67b4a1
|
Jérôme Schneider
|
|
281 |
|
|
function load_tab5_last_acts() {
|
282 |
80def702
|
Jérôme Schneider
|
}
|
283 |
8f67b4a1
|
Jérôme Schneider
|
|
284 |
|
|
function load_tab6_next_rdv() {
|
285 |
80def702
|
Jérôme Schneider
|
}
|
286 |
8f67b4a1
|
Jérôme Schneider
|
|
287 |
|
|
function load_tab7_socialisation() {
|
288 |
|
|
$('#new-socialisation-duration-btn').click(function() {
|
289 |
|
|
generic_ajaxform_dialog('socialisation/new', 'Ajouter une période de socialisation',
|
290 |
|
|
'#ajax-dlg', '800px', 'Ajouter', null, add_datepickers);
|
291 |
|
|
});
|
292 |
|
|
$('.update-duration-btn').click(function() {
|
293 |
|
|
generic_ajaxform_dialog('socialisation/' + $(this).data('id') + '/update', 'Modifier une période de socialisation',
|
294 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
295 |
|
|
});
|
296 |
|
|
$('.del-duration').click(function() {
|
297 |
|
|
generic_ajaxform_dialog('socialisation/' + $(this).data('id') + '/del', 'Supprimer une période de socialisation',
|
298 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
299 |
|
|
});
|
300 |
|
|
$('#new-mdph-request-btn').click(function() {
|
301 |
|
|
generic_ajaxform_dialog('mdph_request/new', 'Ajouter une demande MDPH',
|
302 |
|
|
'#ajax-dlg', '800px', 'Ajouter', null, add_datepickers);
|
303 |
|
|
});
|
304 |
|
|
$('.update-mdph-request-btn').click(function() {
|
305 |
|
|
generic_ajaxform_dialog('mdph_request/' + $(this).data('id') + '/update', 'Modifier une demande MDPH',
|
306 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
307 |
|
|
});
|
308 |
|
|
$('.del-mdph-request').click(function() {
|
309 |
|
|
generic_ajaxform_dialog('mdph_request/' + $(this).data('id') + '/del', 'Supprimer une demande MDPH',
|
310 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
311 |
|
|
});
|
312 |
|
|
$('#new-mdph-response-btn').click(function() {
|
313 |
|
|
generic_ajaxform_dialog('mdph_response/new', 'Ajouter une réponse MDPH',
|
314 |
|
|
'#ajax-dlg', '800px', 'Ajouter', null, add_datepickers);
|
315 |
|
|
});
|
316 |
|
|
$('.update-mdph-response-btn').click(function() {
|
317 |
|
|
generic_ajaxform_dialog('mdph_response/' + $(this).data('id') + '/update', 'Modifier une réponse MDPH',
|
318 |
|
|
'#ajax-dlg', '800px', 'Modifier', null, add_datepickers);
|
319 |
|
|
});
|
320 |
|
|
$('.del-mdph-response').click(function() {
|
321 |
|
|
generic_ajaxform_dialog('mdph_response/' + $(this).data('id') + '/del', 'Supprimer une réponse MDPH',
|
322 |
|
|
'#ajax-dlg', '500px', 'Supprimer');
|
323 |
|
|
});
|
324 |
80def702
|
Jérôme Schneider
|
}
|
325 |
0052d801
|
Jérôme Schneider
|
|
326 |
8f67b4a1
|
Jérôme Schneider
|
function load_tab8_medical() {
|
327 |
243e22a9
|
Jérôme Schneider
|
calebasse_ajax_form('#tabs-8');
|
328 |
63975fa8
|
Jérôme Schneider
|
SelectFilter.init("id_mises_1", "Catégorie", 0, "/static/admin/");
|
329 |
|
|
SelectFilter.init("id_mises_2", "Catégorie", 0, "/static/admin/");
|
330 |
|
|
SelectFilter.init("id_mises_3", "Catégorie", 0, "/static/admin/");
|
331 |
80def702
|
Jérôme Schneider
|
}
|
332 |
|
|
|
333 |
|
|
|
334 |
|
|
(function($) {
|
335 |
|
|
$(function() {
|
336 |
|
|
var $tabs = $('#tabs').tabs({
|
337 |
0052d801
|
Jérôme Schneider
|
load: function(event, ui) {
|
338 |
|
|
var tabid = $(ui.tab).attr('id');
|
339 |
|
|
if (tabid == "ui-id-1")
|
340 |
|
|
load_tab1_general();
|
341 |
|
|
else if (tabid == "ui-id-2")
|
342 |
|
|
load_tab2_adm();
|
343 |
|
|
else if (tabid == "ui-id-3")
|
344 |
|
|
load_tab3_addresses();
|
345 |
|
|
else if (tabid == "ui-id-4")
|
346 |
|
|
load_tab4_notifs();
|
347 |
|
|
else if (tabid == "ui-id-7")
|
348 |
|
|
load_tab7_socialisation();
|
349 |
|
|
else if (tabid == "ui-id-8")
|
350 |
|
|
load_tab8_medical();
|
351 |
|
|
},
|
352 |
3803222f
|
Jérôme Schneider
|
selected: -1,
|
353 |
|
|
collapsible: true,
|
354 |
0052d801
|
Jérôme Schneider
|
});
|
355 |
80def702
|
Jérôme Schneider
|
|
356 |
|
|
|
357 |
|
|
$('.atabs').click(function() {
|
358 |
|
|
location.hash = 'tab=' + $(this).data('id');
|
359 |
|
|
});
|
360 |
|
|
|
361 |
|
|
$('#btn_all_state').click(function() {
|
362 |
|
|
$('.checkbox_state').attr('checked', true);
|
363 |
|
|
});
|
364 |
|
|
$('#btn_none_state').click(function() {
|
365 |
|
|
$('.checkbox_state').attr('checked', false);
|
366 |
|
|
});
|
367 |
|
|
$('.checkbox_state').click(function() {
|
368 |
|
|
$("#search").click();
|
369 |
|
|
});
|
370 |
|
|
|
371 |
|
|
$('.pr-line').click(function() {
|
372 |
|
|
window.open($(this).data('link'), $(this).data('link'));
|
373 |
|
|
});
|
374 |
|
|
$('button#reset').click(function() {
|
375 |
|
|
window.location.href = window.location.pathname;
|
376 |
|
|
return false;
|
377 |
|
|
});
|
378 |
2c6641c8
|
Serghei MIHAI
|
$('#print-button').click(function() {
|
379 |
|
|
var button = $(this);
|
380 |
|
|
var title = button.html();
|
381 |
|
|
button.html('Préparation de l\'impression en cours');
|
382 |
|
|
button.attr({disabled: 'disabled'});
|
383 |
|
|
button.toggleClass('icon-wip');
|
384 |
|
|
$('.pagination').next().remove();
|
385 |
|
|
$.get(window.location + '&all', function(data) {
|
386 |
|
|
button.toggleClass('icon-wip');
|
387 |
|
|
button.removeAttr('disabled');
|
388 |
|
|
button.html(title);
|
389 |
|
|
$('.content').append(data);
|
390 |
|
|
window.print();
|
391 |
|
|
});
|
392 |
|
|
});
|
393 |
380f5426
|
Jérôme Schneider
|
|
394 |
554289d5
|
Jérôme Schneider
|
$('#new-patientrecord').click(function() {
|
395 |
317bcb4c
|
Jérôme Schneider
|
generic_ajaxform_dialog('new', 'Nouveau dossier',
|
396 |
a6638759
|
Jérôme Schneider
|
'#dossier-dlg', '700px', 'Ajouter', false, function(that) {
|
397 |
31dbe39d
|
Frédéric Péters
|
$('input#id_date_selected', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
398 |
8f17cc4e
|
Frédéric Péters
|
$(that).find('#id_last_name').keyup(function() {
|
399 |
|
|
var val = $(this).val();
|
400 |
|
|
if (val.length < 3) {
|
401 |
|
|
$(that).find('#last_name_matches').empty();
|
402 |
|
|
return;
|
403 |
|
|
}
|
404 |
|
|
$.ajax({
|
405 |
|
|
url: "/lookups/ajax_lookup/patientrecord?term=" + val,
|
406 |
|
|
success: function(json) {
|
407 |
|
|
var list = $(that).find('#last_name_matches');
|
408 |
|
|
list.empty();
|
409 |
|
|
$(eval(json)).each(function(a, b) {
|
410 |
|
|
list.append($('<li><a href="' + b.pk + '/view" target="new">' + b.value + '</a></li>'));
|
411 |
|
|
});
|
412 |
|
|
}
|
413 |
|
|
});
|
414 |
|
|
});
|
415 |
|
|
});
|
416 |
554289d5
|
Jérôme Schneider
|
});
|
417 |
e7898322
|
Jérôme Schneider
|
$('#patientrecord-delete').click(function() {
|
418 |
317bcb4c
|
Jérôme Schneider
|
generic_ajaxform_dialog('delete', 'Supprimer le dossier',
|
419 |
4e9e8ae5
|
Jérôme Schneider
|
'#ajax-dlg', '500px', 'Oui', '..');
|
420 |
e7898322
|
Jérôme Schneider
|
});
|
421 |
554289d5
|
Jérôme Schneider
|
|
422 |
b412ba62
|
Frédéric Péters
|
|
423 |
4a0ff5ea
|
Frédéric Péters
|
$('.update-patient-state-btn').click(function() {
|
424 |
|
|
generic_ajaxform_dialog('state/' + $(this).data('id') + '/update', 'Modifier un état',
|
425 |
31dbe39d
|
Frédéric Péters
|
'#ajax-dlg', '500px', 'Modifier', '#histo', add_datepickers);
|
426 |
4a0ff5ea
|
Frédéric Péters
|
});
|
427 |
|
|
$('.del-patient-state-btn').click(function() {
|
428 |
|
|
generic_ajaxform_dialog('state/' + $(this).data('id') + '/del', 'Supprimer un état',
|
429 |
84416ac3
|
Frédéric Péters
|
'#ajax-dlg', '500px', 'Supprimer', '#histo');
|
430 |
4a0ff5ea
|
Frédéric Péters
|
});
|
431 |
|
|
|
432 |
f3407c83
|
Jérôme Schneider
|
$('button.blind').next().hide();
|
433 |
|
|
$('button.blind').click(function() {
|
434 |
|
|
$(this).next().toggle('blind');
|
435 |
7328a577
|
Jérôme Schneider
|
});
|
436 |
380f5426
|
Jérôme Schneider
|
var tabid = $.url($(location).attr('href')).fparam('tab');
|
437 |
447e737b
|
Mikaël Ates
|
if (tabid) {
|
438 |
380f5426
|
Jérôme Schneider
|
$tabs.tabs('select', parseInt(tabid));
|
439 |
447e737b
|
Mikaël Ates
|
}
|
440 |
3803222f
|
Jérôme Schneider
|
else {
|
441 |
|
|
$tabs.tabs('select', 0);
|
442 |
|
|
}
|
443 |
447e737b
|
Mikaël Ates
|
});
|
444 |
c6f5c60f
|
Jérôme Schneider
|
|
445 |
7328a577
|
Jérôme Schneider
|
})(window.jQuery)
|