Révision 3a796ed8
Ajouté par Mikaël Ates il y a plus de 9 ans
calebasse/dossiers/views.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
|
3 | 3 |
import os |
4 |
import logging |
|
4 | 5 |
|
5 | 6 |
from datetime import datetime, date |
6 | 7 |
|
... | ... | |
38 | 39 |
|
39 | 40 |
from ..utils import get_service_setting, is_validator, get_last_file |
40 | 41 |
|
42 |
logger = logging.getLogger('calebasse.dossiers') |
|
43 |
|
|
41 | 44 |
if settings.CV2PARSER: |
42 |
import cv2parser
|
|
45 |
from cv2parser import cvitale
|
|
43 | 46 |
|
44 | 47 |
class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin): |
45 | 48 |
form_class = forms.NewPatientRecordForm |
... | ... | |
373 | 376 |
pass |
374 | 377 |
filename = get_last_file(cv_files_path, |
375 | 378 |
prefix=reader_identifier, suffix='.xml') |
376 |
ctx['carte_vitale'] = filename |
|
379 |
ctx['cv'] = None |
|
380 |
try: |
|
381 |
ctx['cv'] = cvitale.parse(filename) |
|
382 |
except Exception, e: |
|
383 |
logger.warning("%s" % str(e)) |
|
384 |
try: |
|
385 |
ctx['object'] = PatientRecord.objects.get(id=self.kwargs['patientrecord_id']) |
|
386 |
except: |
|
387 |
pass |
|
377 | 388 |
return ctx |
378 | 389 |
|
379 | 390 |
if settings.CV2PARSER: |
Formats disponibles : Unified diff
Display all infos about people recorded on the cv2.