Projet

Général

Profil

« Précédent | Suivant » 

Révision fce3e1e6

Ajouté par Mikaël Ates il y a plus de 9 ans

Display a dialog for the reading of a cv2.

Voir les différences:

calebasse/dossiers/urls.py
49 49
        url(r'^(?P<patientrecord_id>\d+)/prescription-transport$', 'prescription_transport'),
50 50
        url(r'^(?P<patientrecord_id>\d+)/protection/new$', 'new_protection'),
51 51
        url(r'^(?P<patientrecord_id>\d+)/protection/(?P<pk>\d+)/update$', 'update_protection'),
52
        url(r'^(?P<patientrecord_id>\d+)/protection/(?P<pk>\d+)/del$', 'delete_protection'),)
52
        url(r'^(?P<patientrecord_id>\d+)/protection/(?P<pk>\d+)/del$', 'delete_protection'),
53
        url(r'^(?P<patientrecord_id>\d+)/read-cv2$', 'read_cv2'),
54
        )
calebasse/dossiers/views.py
36 36

  
37 37
from calebasse.decorators import validator_only
38 38

  
39
from ..utils import get_service_setting, is_validator
39
from ..utils import get_service_setting, is_validator, get_last_file
40 40

  
41 41
class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin):
42 42
    form_class = forms.NewPatientRecordForm
......
353 353

  
354 354
tab3_addresses = PatientRecordAddrView.as_view()
355 355

  
356
class ReadCV2View(cbv.FormView):
357
    template_name = 'dossiers/cv2.html'
358
    form_class = Form
359
    success_url = './view#tab=2'
360

  
361
    def get_context_data(self, **kwargs):
362
        ctx = super(ReadCV2View, self).get_context_data(**kwargs)
363
        cv_files_path = get_service_setting('cv_files_path')
364
        if not cv_files_path or not os.path.isdir(cv_files_path):
365
            return ctx
366
        reader_identifier = None
367
        try:
368
            reader_identifier = self.request.user.userworker.worker.cv2_reader_name
369
        except:
370
            pass
371
        filename = get_last_file(cv_files_path,
372
                prefix=reader_identifier, suffix='.xml')
373
        ctx['carte_vitale'] = filename
374
        return ctx
375

  
376
read_cv2 = validator_only(ReadCV2View.as_view())
377

  
356 378
class PatientRecordNotifsView(cbv.DetailView):
357 379
    model = PatientRecord
358 380
    template_name = 'dossiers/patientrecord_tab4_notifs.html'
calebasse/static/css/dossiers.css
90 90
	clear: both;
91 91
}
92 92

  
93
#new-address-btn, #new-contact-btn {
93
#new-address-btn, #new-contact-btn #read-cv2{
94 94
    font-size: 1.1em;
95 95
}
96 96

  
calebasse/static/js/calebasse.dossiers.js
227 227
        generic_ajaxform_dialog('address/' + $(this).data('id') + '/del', 'Supprimer une addresse',
228 228
            '#ajax-dlg', '500px', 'Supprimer');
229 229
    });
230

  
230
    $('#read-cv2').click(function() {
231
        generic_ajaxform_dialog('read-cv2', 'Lecture de la Carte Vitale',
232
            '#ajax-dlg', '600px', 'Ok');
233
    });
231 234

  
232 235
      $('.place_of_life').click(function() {
233 236
          if ((this.checked) == true) {

Formats disponibles : Unified diff