diff --git a/calebasse/dossiers/views.py b/calebasse/dossiers/views.py index 6d1722b6..59cfb4de 100644 --- a/calebasse/dossiers/views.py +++ b/calebasse/dossiers/views.py @@ -36,6 +36,7 @@ from calebasse.facturation.invoice_header import render_to_pdf_file from calebasse.decorators import validator_only +from ..utils import get_service_setting class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin): form_class = forms.NewPatientRecordForm @@ -345,6 +346,9 @@ class PatientRecordAddrView(cbv.ServiceViewMixin, cbv.NotificationDisplayView, c ctx = super(PatientRecordAddrView, self).get_context_data(**kwargs) ctx['nb_place_of_lifes'] = ctx['object'].addresses.filter(place_of_life=True).count() ctx['addresses'] = ctx['object'].addresses.order_by('-place_of_life', 'id') + cv_files_path = get_service_setting('cv_files_path') + if cv_files_path and os.path.isdir(cv_files_path): + ctx['cv2_reading'] = True return ctx tab3_addresses = PatientRecordAddrView.as_view() diff --git a/calebasse/settings.py b/calebasse/settings.py index 8b5ab259..4f87565d 100644 --- a/calebasse/settings.py +++ b/calebasse/settings.py @@ -305,6 +305,8 @@ SERVICE_SETTINGS = {} # - show_overlapping_appointments: boolean (default: False) # - age_format: string, string (default: None, alternative behaviour to have # age always displayed in months: "months_only") +# - cv_files_path : Set a path where xml files of CV2 cards are read +# (activate CV2 reading btw). # Pdftk binary path (pdftk is used to complete CERFA) PDFTK_PATH = '/usr/bin/pdftk'