Compare commits

...
This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.

12 Commits
master ... cv2

Author SHA1 Message Date
Mikaël Ates 179a9cc193 Replace field of ident and amo using dictionnary. 2015-01-15 15:51:54 +01:00
Mikaël Ates d9fa9f6b0d Add the API code dictionnary using a json file. 2015-01-15 15:49:50 +01:00
Mikaël Ates e913563b75 Display more information. 2015-01-15 15:48:26 +01:00
Mikaël Ates 0f4fd66992 Convert string dates to datetime and display with short format. 2015-01-15 13:11:14 +01:00
Mikaël Ates 3a796ed892 Display all infos about people recorded on the cv2. 2015-01-14 16:00:44 +01:00
Mikaël Ates 233fda5f43 Test if cv2parser module is present. 2015-01-13 16:40:09 +01:00
Mikaël Ates fce3e1e61d Display a dialog for the reading of a cv2. 2015-01-13 16:37:56 +01:00
Mikaël Ates 6f6221a2cd Add helper function to get the most recent file using the date in its name. 2015-01-13 16:37:56 +01:00
Mikaël Ates 6452a96921 Button only visible for validator role. 2015-01-13 16:37:56 +01:00
Mikaël Ates eb7374357d Add a cv2 reader name field to Worker model. 2015-01-13 16:37:56 +01:00
Mikaël Ates aff120dfb9 Add a button in PR address tab to read a CV2. 2015-01-13 16:37:55 +01:00
Mikaël Ates 1eb103dd72 Settings to activate CV2 readind and set xml files path. 2015-01-13 16:37:55 +01:00
14 changed files with 947 additions and 3 deletions

103
calebasse/cv2helper.py Normal file
View File

@ -0,0 +1,103 @@
from datetime import datetime
from django.conf import settings
def parse_date_ddmmyyyy(str_date):
fmt = '%d%m%Y'
return datetime.strptime(str_date, fmt)
def parse_date_yymmdd(str_date):
fmt = '%y%m%d'
return datetime.strptime(str_date, fmt)
def setter_date_ddmmyyyy(field):
try:
return parse_date_ddmmyyyy(str(field))
except:
pass
def setter_date_yymmdd(field):
try:
return parse_date_yymmdd(str(field))
except:
pass
def setter_periode(start, end):
try:
return parse_date_ddmmyyyy(str(start)), parse_date_ddmmyyyy(str(end))
except:
pass
if settings.CV2PARSER:
import codecs
import json
from cv2parser import cvitale
def parse(filename):
f = codecs.open("calebasse/tables.json", 'r',
encoding='ISO-8859-1')
tables = json.loads(f.read())
cv = cvitale.parse(filename)
if cv.tech.finValidite:
cv.tech.finValidite = setter_date_ddmmyyyy(cv.tech.finValidite)
for beneficiaire in cv.listeBenef.get_element():
"""
ident
"""
beneficiaire.ident.naissance.date = \
setter_date_ddmmyyyy(beneficiaire.ident.naissance.date)
beneficiaire.ident.naissance.dateEnCarte = \
setter_date_yymmdd(beneficiaire.ident.naissance.dateEnCarte)
beneficiaire.ident.dateCertification = \
setter_date_ddmmyyyy(beneficiaire.ident.dateCertification)
"""
amo
"""
if beneficiaire.amo.listePeriodesDroits and beneficiaire.amo.listePeriodesDroits.get_element():
for p in beneficiaire.amo.listePeriodesDroits.get_element():
if p.debut and p.fin:
p.debut, p.fin = setter_periode(p.debut, p.fin)
if beneficiaire.amo.service and \
beneficiaire.amo.service.periodeService:
p = beneficiaire.amo.service.periodeService
if p.debut and p.fin:
p.debut, p.fin = setter_periode(p.debut, p.fin)
beneficiaire.amo.qualBenef = \
tables['TABLE_QUALITE'][str(beneficiaire.amo.qualBenef)]
if beneficiaire.amo.infoCompl:
beneficiaire.amo.infoCompl = \
tables['TABLE_DIVERS'][str(beneficiaire.amo.infoCompl)]
if beneficiaire.amo.service and beneficiaire.amo.service.codeService:
beneficiaire.amo.service.codeService = \
tables['TABLE_SERVAMO'][str(beneficiaire.amo.service.codeService)]
"""
mutuelle
"""
if beneficiaire.mutuelle and beneficiaire.mutuelle.listePeriodes:
for p in beneficiaire.mutuelle.listePeriodes.get_element():
if p.debut and p.fin:
p.debut, p.fin = setter_periode(p.debut, p.fin)
if beneficiaire.mutuelle and beneficiaire.mutuelle.services \
and beneficiaire.mutuelle.services.typeService:
beneficiaire.mutuelle.services.typeService = \
tables['TABLE_SERVMUTAMC'][str(beneficiaire.mutuelle.services.typeService)]
"""
amc
"""
if beneficiaire.amc and beneficiaire.amc.validiteDonnees:
p = beneficiaire.amc.validiteDonnees
if p.debut and p.fin:
p.debut, p.fin = setter_periode(p.debut, p.fin)
"""
cmu
"""
if beneficiaire.cmu and beneficiaire.cmu.periode:
p = beneficiaire.cmu.periode
if p.debut and p.fin:
p.debut, p.fin = setter_periode(p.debut, p.fin)
f.close()
return cv

View File

@ -0,0 +1,105 @@
{% load widget_tweaks %}
{% if cv %}
<p>N° {{ cv.tech.numSerie }}{% if cv.tech.finValidite %} valide jusqu'au {{ cv.tech.finValidite|date:"SHORT_DATE_FORMAT" }}{% endif %}</p>
<p>{% for beneficiaire in cv.listeBenef.get_element %}
<div class="beneficiaire">
<label for="{{ beneficiaire.id }}">{{ beneficiaire.ident.nomUsuel }} {{ beneficiaire.ident.prenomUsuel }} - <strong>{{ beneficiaire.amo.qualBenef }}</strong></label>
<span class="js-expandable">
<label class="js-click-to-expand"></label>
<ul class="js-to-expand">
{% if beneficiaire.ident %}
<strong>Identification</strong>
<li><label>Nom usuel :</label> {{ beneficiaire.ident.nomUsuel }}</li>
{% if beneficiaire.ident.nomPatronymique %}<li><label>Nom patronymique :</label> {{ beneficiaire.ident.nomPatronymique }}</li>{% endif %}
<li><label>Prénom usuel :</label> {{ beneficiaire.ident.prenomUsuel }}</li>
<li><label>Date de naissance :</label> {% if beneficiaire.ident.naissance.dateEnCarte %}{{ beneficiaire.ident.naissance.dateEnCarte|date:"SHORT_DATE_FORMAT" }}{% else %}{{ beneficiaire.ident.naissance.date|date:"SHORT_DATE_FORMAT" }}{% endif %}</li>
<li><label>Numéro d'Identification au Répertoire (NIR) :</label> {{ beneficiaire.ident.nir }}</li>
{% if beneficiaire.ident.adresse %}<li><label>Adresse :</label><ul>
{% if beneficiaire.ident.adresse.ligne1 %}<li><label>Ligne 1 :</label> {{ beneficiaire.ident.adresse.ligne1 }}</li>{% endif %}
{% if beneficiaire.ident.adresse.ligne2 %}<li><label>Ligne 2 :</label> {{ beneficiaire.ident.adresse.ligne2 }}</li>{% endif %}
{% if beneficiaire.ident.adresse.ligne3 %}<li><label>Ligne 3 :</label> {{ beneficiaire.ident.adresse.ligne3 }}</li>{% endif %}
{% if beneficiaire.ident.adresse.ligne4 %}<li><label>Ligne 4 :</label> {{ beneficiaire.ident.adresse.ligne4 }}</li>{% endif %}
{% if beneficiaire.ident.adresse.ligne5 %}<li><label>Ligne 5 :</label> {{ beneficiaire.ident.adresse.ligne5 }}</li>{% endif %}
</ul></li>{% endif %}
<li><label>Rang de naissance :</label> {{ beneficiaire.ident.rangDeNaissance }}</li>
{% if beneficiaire.ident.nirCertifie %}<li><label>NIR certifié :</label> {{ beneficiaire.ident.nirCertifie }}</li>{% endif %}
{% if beneficiaire.ident.dateCertification %}<li><label>Date de certification :</label> {{ beneficiaire.ident.dateCertification|date:"SHORT_DATE_FORMAT" }}</li>{% endif %}
{% else %}
Problème de lecture du bloc identification.
{% endif %}
<br/>
{% if beneficiaire.amo %}
<strong>Assurance Maladie Obligatoire</strong>
<li><label>Qualité du bénéficiaire :</label> {{ beneficiaire.amo.qualBenef }}</li>
<li><label>Code du régime :</label> {{ beneficiaire.amo.codeRegime }}</li>
<li><label>Code de la caisse :</label> {{ beneficiaire.amo.caisse }}</li>
<li><label>Code du centre :</label> {{ beneficiaire.amo.centreGestion }}</li>
<li><label>Code de gestion :</label> {{ beneficiaire.amo.codeGestion }}</li>
{% if beneficiaire.amo.libelleExo %}<li><label>Exonération du ticket modérateur :</label> {{ beneficiaire.amo.libelleExo }}</li>{% endif %}
{% if beneficiaire.amo.infoCompl %}<li><label>Informations supplémentaires :</label> {{ beneficiaire.amo.infoCompl }}</li>{% endif %}
<li><label>Centre d'émission de la carte :</label> {{ beneficiaire.amo.centreCarte }}</li>
{% if beneficiaire.amo.listePeriodesDroits %}<li><label>Liste des périodes de droits :</label><ul>
{% for element in beneficiaire.amo.listePeriodesDroits.get_element %}<li>{{ element.debut|date:"SHORT_DATE_FORMAT" }} - {{ element.fin|date:"SHORT_DATE_FORMAT" }}</li>{% endfor %}
</ul></li>{% endif %}
<li><label>Medecin traitant :</label> {{ beneficiaire.amo.medecinTraitant }}</li>
{% if beneficiaire.amo.service %}<li><label>Service :</label> {{ beneficiaire.amo.codeService }} - {{ beneficiaire.amo.periodeService.debut|date:"SHORT_DATE_FORMAT" }} - {{ beneficiaire.amo.periodeService.fin|date:"SHORT_DATE_FORMAT" }}</li>{% endif %}
{% else %}
Problème de lecture du bloc amo.
{% endif %}
<br/>
{% if beneficiaire.mutuelle %}
<strong>Mutuelle</strong>
{% if beneficiaire.mutuelle.listeTypeContrat %}<li><label>Liste types de contrats :</label><ul>
{% for element in beneficiaire.mutuelle.listeTypeContrat.get_element %}<li>{{ element }}</li>{% endfor %}
</ul></li>{% endif %}
{% if beneficiaire.mutuelle.numIdent %}<li><label>Numéro d'identification :</label> {{ beneficiaire.mutuelle.numIdent }}</li>{% endif %}
{% if beneficiaire.mutuelle.services %}<li><label>Services :</label> {{ beneficiaire.mutuelle.services.typeService }} - {{ beneficiaire.mutuelle.services.servicesAssocies }}</li>{% endif %}
{% if beneficiaire.mutuelle.listePeriodes %}<li><label>Liste des périodes de droits :</label><ul>
{% for element in beneficiaire.mutuelle.listePeriodes.get_element %}<li>{{ element.debut|date:"SHORT_DATE_FORMAT" }} - {{ element.fin|date:"SHORT_DATE_FORMAT" }}</li>{% endfor %}
</ul></li>{% endif %}
{% if beneficiaire.mutuelle.indicTraitement %}<li><label>Indicateur de Traitement :</label> {{ beneficiaire.mutuelle.indicTraitement }}</li>{% endif %}
{% if beneficiaire.mutuelle.codeSTS %}<li><label>Code STS (STructure de Soin) :</label> {{ beneficiaire.mutuelle.codeSTS }}</li>{% endif %}
{% if beneficiaire.mutuelle.donneesCompl %}<li><label>Données supplémentaires :</label> {{ beneficiaire.mutuelle.donneesCompl }}</li>{% endif %}
<br/>
{% endif %}
{% if beneficiaire.amc %}
<strong>Assurance Maladie Complémentaire</strong>
{% if beneficiaire.amc.numComplB2 %}<li><label>NuméroB2 :</label> {{ beneficiaire.amc.numComplB2 }}</li>{% endif %}
{% if beneficiaire.amc.numComplEDI %}<li><label>Numéro EDI :</label> {{ beneficiaire.amc.numCompleEDI }}</li>{% endif %}
{% if beneficiaire.amc.numAdherent %}<li><label>Numéro d'adhérent :</label> {{ beneficiaire.amc.numAdherent }}</li>{% endif %}
{% if beneficiaire.amc.indicTraitement %}<li><label>Indicateur de Traitement :</label> {{ beneficiaire.amc.indicTraitement }}</li>{% endif %}
{% if beneficiaire.amc.validiteDonnees %}<li><label>Validité des données :</label> {{ beneficiaire.amc.validiteDonnees.debut|date:"SHORT_DATE_FORMAT" }} - {{ beneficiaire.amc.validiteDonnees.fin|date:"SHORT_DATE_FORMAT" }}</li>{% endif %}
{% if beneficiaire.amc.codeRoutageFlux %}<li><label>Code de routage des flux :</label> {{ beneficiaire.amc.codeRoutageFlux }}</li>{% endif %}
{% if beneficiaire.amc.identHote %}<li><label>Identification de l'hôte :</label> {{ beneficiaire.amc.identHote }}</li>{% endif %}
{% if beneficiaire.amc.nomDomaine %}<li><label>Nom de domaine :</label> {{ beneficiaire.amc.nomDomaine }}</li>{% endif %}
{% if beneficiaire.amc.codeSTS %}<li><label>Code STS (STructure de Soin) :</label> {{ beneficiaire.amc.codeSTS }}</li>{% endif %}
{% if beneficiaire.amc.services %}<li><label>Services :</label> {{ beneficiaire.amc.services.typeService }} - {{ beneficiaire.amc.services.servicesAssocies }}</li>{% endif %}
{% if beneficiaire.amc.donneesCompl %}<li><label>Données supplémentaires :</label> {{ beneficiaire.amc.donneesCompl }}</li>{% endif %}
<br/>
{% endif %}
{% if beneficiaire.cmu %}
<strong>Couverture Maladie Universelle</strong>
{% if beneficiaire.cmu.typeCMU %}<li><label>Type CMU :</label> {{ beneficiaire.cmu.typeCMU }}</li>{% endif %}
{% if beneficiaire.cmu.periode %}<li><label>Période :</label> {{ beneficiaire.cmu.periode.debut|date:"SHORT_DATE_FORMAT" }} - {{ beneficiaire.cmu.periode.fin|date:"SHORT_DATE_FORMAT" }}</li>{% endif %}
<br/>
{% endif %}
{% if beneficiaire.listeAt %}
<strong>Accident du travail</strong>
{% if beneficiaire.listeAt.at1 %}<li><label> Accident du travail:</label> {{ beneficiaire.listeAt.at1.orgGestion }} {{ beneficiaire.listeAt.at1.codeBudget }} {{ beneficiaire.listeAt.at1.identifiant }}</li>{% endif %}
{% if beneficiaire.listeAt.at2 %}<li><label> Accident du travail:</label> {{ beneficiaire.listeAt.at2.orgGestion }} {{ beneficiaire.listeAt.at2.codeBudget }} {{ beneficiaire.listeAt.at3.identifiant }}</li>{% endif %}
{% if beneficiaire.listeAt.at3 %}<li><label> Accident du travail:</label> {{ beneficiaire.listeAt.at3.orgGestion }} {{ beneficiaire.listeAt.at3.codeBudget }} {{ beneficiaire.listeAt.at3.identifiant }}</li>{% endif %}
<br/>
{% endif %}
</ul>
</span></div>
{% endfor %}</p>
{% else %}
<p>Aucune carte vitale lue.</p>
{% endif %}

View File

@ -23,6 +23,7 @@
<p>
<button type="button" id="new-address-btn" class="icon-home-space">Nouvelle adresse</button>
<button type="button" id="new-contact-btn" class="icon-user-space">Nouveau contact</button>
{% if cv2_reading %}<button type="button" id="read-cv2" class="icon-play">Lire la carte vitale</button>{% endif %}
</p>
<form method="post" action="tab3" class="autosubmit-form patientrecordform">{% csrf_token %}

View File

@ -1,4 +1,5 @@
from django.conf.urls import patterns, url
from django.conf import settings
urlpatterns = patterns('calebasse.dossiers.views',
url(r'^$', 'patientrecord_home'),
@ -49,4 +50,11 @@ urlpatterns = patterns('calebasse.dossiers.views',
url(r'^(?P<patientrecord_id>\d+)/prescription-transport$', 'prescription_transport'),
url(r'^(?P<patientrecord_id>\d+)/protection/new$', 'new_protection'),
url(r'^(?P<patientrecord_id>\d+)/protection/(?P<pk>\d+)/update$', 'update_protection'),
url(r'^(?P<patientrecord_id>\d+)/protection/(?P<pk>\d+)/del$', 'delete_protection'),)
url(r'^(?P<patientrecord_id>\d+)/protection/(?P<pk>\d+)/del$', 'delete_protection'),
)
if settings.CV2PARSER:
cv2_read_url = patterns('calebasse.dossiers.views',
url(r'^(?P<patientrecord_id>\d+)/read-cv2$', 'read_cv2'),
)
urlpatterns += cv2_read_url

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import os
import logging
from datetime import datetime, date
@ -36,6 +37,11 @@ from calebasse.facturation.invoice_header import render_to_pdf_file
from calebasse.decorators import validator_only
from calebasse import cv2helper
from ..utils import get_service_setting, is_validator, get_last_file
logger = logging.getLogger('calebasse.dossiers')
class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin):
form_class = forms.NewPatientRecordForm
@ -345,10 +351,44 @@ 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 settings.CV2PARSER and is_validator(self.request.user) and cv_files_path and os.path.isdir(cv_files_path):
ctx['cv2_reading'] = True
return ctx
tab3_addresses = PatientRecordAddrView.as_view()
class ReadCV2View(cbv.FormView):
template_name = 'dossiers/cv2.html'
form_class = Form
success_url = './view#tab=2'
def get_context_data(self, **kwargs):
ctx = super(ReadCV2View, self).get_context_data(**kwargs)
cv_files_path = get_service_setting('cv_files_path')
if not cv_files_path or not os.path.isdir(cv_files_path):
return ctx
reader_identifier = None
try:
reader_identifier = self.request.user.userworker.worker.cv2_reader_name
except:
pass
filename = get_last_file(cv_files_path,
prefix=reader_identifier, suffix='.xml')
ctx['cv'] = None
try:
ctx['cv'] = cv2helper.parse(filename)
except Exception, e:
logger.warning("%s" % str(e))
try:
ctx['object'] = PatientRecord.objects.get(id=self.kwargs['patientrecord_id'])
except:
pass
return ctx
if settings.CV2PARSER:
read_cv2 = validator_only(ReadCV2View.as_view())
class PatientRecordNotifsView(cbv.DetailView):
model = PatientRecord
template_name = 'dossiers/patientrecord_tab4_notifs.html'

View File

@ -0,0 +1,211 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Worker.cv2_reader_name'
db.add_column(u'personnes_worker', 'cv2_reader_name',
self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Worker.cv2_reader_name'
db.delete_column(u'personnes_worker', 'cv2_reader_name')
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'personnes.externaltherapist': {
'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'ExternalTherapist', '_ormbases': [u'personnes.People']},
'address': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
'address_complement': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'fax': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True', 'blank': 'True'}),
'old_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'old_service': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
u'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
'phone_work': ('calebasse.models.PhoneNumberField', [], {'default': 'None', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.related.ForeignKey', [], {'default': '18', 'to': u"orm['ressources.WorkerType']"}),
'zip_code': ('calebasse.models.ZipCodeField', [], {'default': 'None', 'max_length': '5', 'null': 'True', 'blank': 'True'})
},
u'personnes.externalworker': {
'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'ExternalWorker', '_ormbases': [u'personnes.People']},
'address': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
'address_complement': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'fax': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True', 'blank': 'True'}),
'old_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'old_service': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
u'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
'phone_work': ('calebasse.models.PhoneNumberField', [], {'default': 'None', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.related.ForeignKey', [], {'default': '18', 'to': u"orm['ressources.WorkerType']"}),
'zip_code': ('calebasse.models.ZipCodeField', [], {'default': 'None', 'max_length': '5', 'null': 'True', 'blank': 'True'})
},
u'personnes.holiday': {
'Meta': {'ordering': "('start_date', 'start_time')", 'object_name': 'Holiday'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'end_date': ('django.db.models.fields.DateField', [], {}),
'end_time': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
'holiday_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ressources.HolidayType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'services': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['ressources.Service']", 'symmetrical': 'False'}),
'start_date': ('django.db.models.fields.DateField', [], {}),
'start_time': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
'worker': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['personnes.Worker']", 'null': 'True', 'blank': 'True'})
},
u'personnes.people': {
'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'People'},
'display_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
'gender': ('django.db.models.fields.IntegerField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
'phone': ('calebasse.models.PhoneNumberField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'})
},
u'personnes.role': {
'Meta': {'ordering': "['name']", 'object_name': 'Role'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False', 'blank': 'True'})
},
u'personnes.schoolteacher': {
'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'SchoolTeacher', '_ormbases': [u'personnes.People']},
u'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
'role': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ressources.SchoolTeacherRole']"}),
'schools': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['ressources.School']", 'symmetrical': 'False'})
},
u'personnes.timetable': {
'Meta': {'object_name': 'TimeTable'},
'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'end_time': ('django.db.models.fields.TimeField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'periodicity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
'services': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['ressources.Service']", 'symmetrical': 'False'}),
'start_date': ('django.db.models.fields.DateField', [], {}),
'start_time': ('django.db.models.fields.TimeField', [], {}),
'week_offset': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'week_parity': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'week_period': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'week_rank': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'weekday': ('django.db.models.fields.PositiveIntegerField', [], {}),
'worker': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['personnes.Worker']"})
},
u'personnes.userworker': {
'Meta': {'object_name': 'UserWorker'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['auth.User']", 'unique': 'True'}),
'worker': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['personnes.Worker']"})
},
u'personnes.worker': {
'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'Worker', '_ormbases': [u'personnes.People']},
'cv2_reader_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'initials': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}),
'old_camsp_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'old_cmpp_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'old_sessad_dys_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'old_sessad_ted_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
u'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
'services': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['ressources.Service']", 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ressources.WorkerType']"})
},
u'ressources.holidaytype': {
'Meta': {'object_name': 'HolidayType'},
'for_group': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
u'ressources.school': {
'Meta': {'object_name': 'School'},
'address': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
'address_complement': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
'director_name': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '70', 'null': 'True', 'blank': 'True'}),
'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'null': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'default': 'None', 'max_length': '75', 'null': 'True', 'blank': 'True'}),
'fax': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'old_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'old_service': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'phone': ('calebasse.models.PhoneNumberField', [], {'default': 'None', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
'private': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'school_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ressources.SchoolType']"}),
'services': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['ressources.Service']", 'null': 'True', 'blank': 'True'}),
'zip_code': ('calebasse.models.ZipCodeField', [], {'default': 'None', 'max_length': '5', 'null': 'True', 'blank': 'True'})
},
u'ressources.schoolteacherrole': {
'Meta': {'object_name': 'SchoolTeacherRole'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
},
u'ressources.schooltype': {
'Meta': {'object_name': 'SchoolType'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'services': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['ressources.Service']", 'symmetrical': 'False'})
},
u'ressources.service': {
'Meta': {'object_name': 'Service'},
'description': ('django.db.models.fields.TextField', [], {}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'fax': ('calebasse.models.PhoneNumberField', [], {'max_length': '20'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'phone': ('calebasse.models.PhoneNumberField', [], {'max_length': '20'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
},
u'ressources.workertype': {
'Meta': {'object_name': 'WorkerType'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'intervene': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
}
}
complete_apps = ['personnes']

View File

@ -83,6 +83,8 @@ class Worker(People):
services = models.ManyToManyField('ressources.Service', blank=True, null=True)
enabled = models.BooleanField(verbose_name=u'Actif',
default=True)
cv2_reader_name = models.CharField(max_length=100,
verbose_name=u'Nom du lecteur', blank=True, null=True)
old_camsp_id = models.CharField(max_length=256,
verbose_name=u'Ancien ID au CAMSP', blank=True, null=True)
old_cmpp_id = models.CharField(max_length=256,

View File

@ -305,6 +305,15 @@ 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).
CV2PARSER = False
try:
import cv2parser
CV2PARSER = True
except:
pass
# Pdftk binary path (pdftk is used to complete CERFA)
PDFTK_PATH = '/usr/bin/pdftk'

View File

@ -25,6 +25,17 @@
border-width: 2px;
}
div.beneficiaire {
background: #eee;
border: 1px solid #FF7800;
margin: 2px;
padding: 2px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font-size: 70%;
}
#tabs-3 div.contact h4 {
margin: 0;
}
@ -90,7 +101,7 @@ div#tabs-4 div div.buttons {
clear: both;
}
#new-address-btn, #new-contact-btn {
#new-address-btn, #new-contact-btn, #read-cv2{
font-size: 1.1em;
}

View File

@ -1300,6 +1300,7 @@ div.pagination {
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
.icon-play:before { content: "\f04b "; }
/* defining spin animation */
@-moz-keyframes spin {

View File

@ -106,6 +106,11 @@ function generic_ajaxform_dialog(url, title, id, width, btn_submit_name, redirec
if (on_load_callback) {
on_load_callback($(this));
}
$('.js-click-to-expand').on('click', function (event) {
$(event.target).parents('.js-expandable').toggleClass('js-expanded');
$(event.target).next().toggle();
});
});
}

View File

@ -227,7 +227,10 @@ function load_tab3_addresses() {
generic_ajaxform_dialog('address/' + $(this).data('id') + '/del', 'Supprimer une addresse',
'#ajax-dlg', '500px', 'Supprimer');
});
$('#read-cv2').click(function() {
generic_ajaxform_dialog('read-cv2', 'Lecture de la Carte Vitale',
'#ajax-dlg', '600px', 'Ok');
});
$('.place_of_life').click(function() {
if ((this.checked) == true) {

405
calebasse/tables.json Normal file
View File

@ -0,0 +1,405 @@
{
"TABLE_QUALITE": {
"0": "Assuré",
"1": "Ascendant/Descendant/collatéraux ascendants",
"2": "Conjoint",
"3": "Conjoint Divorcé",
"4": "Concubin",
"5": "Conjoint Séparé",
"6": "Enfant",
"7": "Bénéficiaire Hors Article 313",
"8": "Conjoint Veuf",
"9": "Autre ayant-droit"
},
"TABLE_DIVERS": {
"0": "Les accidents de tout type ne sont pas garantis",
"1": "Agent en activité"
},
"TABLE_SERVAMO": {
},
"TABLE_SERVMUTAMC": {
"0": "Service associé de la complémentaire",
"1": "Numéro téléphonique",
"2": "Code minitel",
"3": "Adresse Transpac",
"4": "Adresse Internet",
"5": "Texte libre",
"6": "Information structurée à afficher",
"7": "Information structurée à traiter",
"8": "Service associé de la complémentaire",
"9": "Service associé de la complémentaire"
},
"TABLE_CMU": {
"00": "Le bénéficiaire n'a pas de service AMO spécifique",
"01": "Le bénéficiaire a une CMU complémentaire gérée par une AMO",
"02": "Le bénéficiaire a une CMU complémentaire gérée par une AMC en convention ou en délégation avec une AMO",
"03": "Le bénéficiaire a une CMU complémentaire gérée par une AMC",
"10": "Le bénéficiaire est sortant de CMU complémentaire",
"11": "Le bénéficiaire bénéficie du dispositif d'aide à l'acquisition d'une complémentaire"
},
"TABLE_GESTION": {
"04": "CPRPSNCF",
"10": "Régime général",
"11": "Régime général assurés retraités",
"12": "Régime général assurés non cotisants",
"13": "Invalides de guerre",
"18": "Adultes handicapés",
"20": "Régime général partiel",
"23": "Fonctionnaires ouvriers de l'état",
"24": "EDF-GDF",
"25": "Etudiants",
"29": "Collectivités locales",
"34": "Artistes auteurs",
"40": "Assurés volontaires",
"70": "Conventions internationales (CEE et conventions bilatérales)",
"71": "Conventions internationales (CEE et conventions bilatérales)",
"72": "Conventions internationales (CEE et conventions bilatérales)",
"73": "Conventions internationales (CEE et conventions bilatérales)",
"74": "Conventions internationales (CEE et conventions bilatérales)",
"75": "Conventions internationales (CEE et conventions bilatérales)",
"76": "Conventions internationales (CEE et conventions bilatérales)",
"77": "Conventions internationales (CEE et conventions bilatérales)",
"78": "Conventions internationales (CEE et conventions bilatérales)",
"79": "Conventions internationales (CEE et conventions bilatérales)",
"85": "Assurés personnels",
"86": "AVIP (Assuré Volontaire Inv. Parental)",
"87": "RMI (Revenu Minimum d'Insertion)",
"89": "Assurés bénéficiaires de la Couverture Maladie Universelle",
"90": "Praticiens sauf biologistes"
},
"TABLE_REGIME": {
"00": "CARTE DE TEST DU G.I.E. SESAM-VITALE",
"01": "ASSURE SOCIAL DU REGIME GENERAL",
"02": "ASSURE SOCIAL DU REGIME AGRICOLE",
"03": "ASSURE SOCIAL DU REGIME SOCIAL DES INDEPENDANTS",
"04": "AFFILIE A LA CAISSE DE PREVOYANCE ET DE RETRAITE DU PERSONNEL DE LA SNCF",
"05": "ASSURE DU REGIME SPECIAL RATP",
"06": "ASSURE SOCIAL DU REGIME DES MARINS DE LA MARINE MARCHANDE",
"07": "ASSURE DU REGIME SPECIAL DE SECURITE SOCIALE DANS LES MINES",
"08": "ASSURE SOCIAL DU REGIME MILITAIRE",
"09": "ASSURE SOCIAL DU REGIME DE LA BANQUE DE FRANCE",
"10": "ASSURE SOCIAL DU REGIME DES CLERCS ET EMPLOYES DE NOTAIRE",
"12": "ASSURE SOCIAL DU REGIME DE LA CHAMBRE DE COMMERCE ET D'INDUSTRIE DE PARIS",
"14": "ASSURE SOCIAL DU REGIME DE L'ASSEMBLEE NATIONALE",
"15": "ASSURE SOCIAL DU REGIME DU SENAT",
"16": "ASSURE SOCIAL DU REGIME DU PORT AUTONOME DE BORDEAUX",
"17": "ASSURE SOCIAL DU·REGIME DE LA CAISSE DES FRANCAIS A L'ETRANGER",
"80": "ASSURE SOCIAL DU·REGIME DU MINISTERE DES ANCIENS COMBATTANTS",
"90": "ASSURE SOCIAL DE LA CAISSE D'ASSURANCE VIEILLESSE, INVALIDITE ET MALADIE DES CULTES",
"91": "ASSURE SOCIAL DU REGIME GENERAL: MUTUELLE GENERALE DE L'EDUCATION NATIONALE",
"92": "ASSURE SOCIAL DU REGIME GENERAL: MUTUELLE GENERALE",
"93": "ASSURE SOCIAL DU REGIME GENERAL: MUTUELLE GENERALE DE LA POLICE",
"94": "ASSURE SOCIAL DU REGIME GENERAL: MUTUALITE DE LA FONCTION PUBLIQUE",
"95": "ASSURE SOCIAL DU REGIME GENERAL: MUTUELLE NATIONALE DES HOSPITALIERS",
"96": "ASSURE SOCIAL DU REGIME GENERAL: MUTUELLE NATIONALE AVIATION MARINE",
"99": "ASSURE SOCIAL DU REGIME GENERAL: SECTION LOCALE MUTUALISTE"
},
"TABLE_INDICMUT": {
"00": "Pas de tiers payant complémentaire autorisé.",
"01": "Tiers-payant complémentaire autorisé selon accord entre PS et AMC.",
"02": "Tiers-payant complémentaire autorisé selon réglementation.",
"03": "Indicateur de traitement inconnu.",
"04": "Indicateur de traitement inconnu.",
"05": "Indicateur de traitement inconnu.",
"06": "Indicateur de traitement inconnu.",
"07": "Indicateur de traitement inconnu.",
"08": "Indicateur de traitement inconnu.",
"09": "Indicateur de traitement inconnu.",
"10": "Indicateur de traitement inconnu.",
"11": "Indicateur de traitement inconnu.",
"12": "Indicateur de traitement inconnu.",
"13": "Indicateur de traitement inconnu.",
"14": "Indicateur de traitement inconnu.",
"15": "Indicateur de traitement inconnu.",
"16": "Indicateur de traitement inconnu.",
"17": "Indicateur de traitement inconnu.",
"18": "Indicateur de traitement inconnu.",
"19": "Indicateur de traitement inconnu.",
"20": "Indicateur de traitement inconnu.",
"21": "Indicateur de traitement inconnu.",
"22": "Indicateur de traitement inconnu.",
"23": "Indicateur de traitement inconnu.",
"24": "Indicateur de traitement inconnu.",
"25": "Indicateur de traitement inconnu.",
"26": "Indicateur de traitement inconnu.",
"27": "Indicateur de traitement inconnu.",
"28": "Indicateur de traitement inconnu.",
"29": "Indicateur de traitement inconnu.",
"30": "Indicateur de traitement inconnu.",
"31": "Indicateur de traitement inconnu.",
"32": "Indicateur de traitement inconnu.",
"33": "Indicateur de traitement inconnu.",
"34": "Indicateur de traitement inconnu.",
"35": "Indicateur de traitement inconnu.",
"36": "Indicateur de traitement inconnu.",
"37": "Indicateur de traitement inconnu.",
"38": "Indicateur de traitement inconnu.",
"39": "Indicateur de traitement inconnu.",
"40": "Indicateur de traitement inconnu.",
"41": "Indicateur de traitement inconnu.",
"42": "Indicateur de traitement inconnu.",
"43": "Indicateur de traitement inconnu.",
"44": "Indicateur de traitement inconnu.",
"45": "Indicateur de traitement inconnu.",
"46": "Indicateur de traitement inconnu.",
"47": "Indicateur de traitement inconnu.",
"48": "Indicateur de traitement inconnu.",
"49": "Indicateur de traitement inconnu.",
"50": "Indicateur de traitement inconnu.",
"51": "Indicateur de traitement inconnu.",
"52": "Indicateur de traitement inconnu.",
"53": "Indicateur de traitement inconnu.",
"54": "Indicateur de traitement inconnu.",
"55": "Indicateur de traitement inconnu.",
"56": "Indicateur de traitement inconnu.",
"57": "Indicateur de traitement inconnu.",
"58": "Indicateur de traitement inconnu.",
"59": "Indicateur de traitement inconnu.",
"60": "Indicateur de traitement inconnu.",
"61": "Indicateur de traitement inconnu.",
"62": "Bénéficiaire CMU complémentaire, tiers payant complémentaire, pas d'éclatement possible.",
"63": "Indicateur de traitement inconnu.",
"64": "Indicateur de traitement inconnu.",
"65": "Indicateur de traitement inconnu.",
"66": "Indicateur de traitement inconnu.",
"67": "Indicateur de traitement inconnu.",
"68": "Indicateur de traitement inconnu.",
"69": "Indicateur de traitement inconnu.",
"70": "Indicateur de traitement inconnu.",
"71": "Bénéficiaire sortant de CMU complémentaire. Pas d'éclatement possible.",
"72": "Indicateur de traitement inconnu.",
"73": "Indicateur de traitement inconnu.",
"74": "Indicateur de traitement inconnu.",
"75": "Indicateur de traitement inconnu.",
"76": "Indicateur de traitement inconnu.",
"77": "Indicateur de traitement inconnu.",
"78": "Indicateur de traitement inconnu.",
"79": "Indicateur de traitement inconnu.",
"80": "Indicateur de traitement inconnu.",
"81": "Indicateur de traitement inconnu.",
"82": "Indicateur de traitement inconnu.",
"83": "Indicateur de traitement inconnu.",
"84": "Indicateur de traitement inconnu.",
"85": "Indicateur de traitement inconnu.",
"86": "Indicateur de traitement inconnu.",
"87": "Indicateur de traitement inconnu.",
"88": "Indicateur de traitement inconnu.",
"89": "Indicateur de traitement inconnu.",
"90": "Indicateur de traitement inconnu.",
"91": "Indicateur de traitement inconnu.",
"92": "Indicateur de traitement inconnu.",
"93": "Indicateur de traitement inconnu.",
"94": "Indicateur de traitement inconnu.",
"95": "Indicateur de traitement inconnu.",
"96": "Indicateur de traitement inconnu.",
"97": "Indicateur de traitement inconnu.",
"98": "Indicateur de traitement inconnu.",
"99": "Indicateur de traitement inconnu."
},
"TABLE_INDICAMC": {
"00": "Pas de DRE possible, pas de flux de rectification possible entre AMO et AMC.",
"01": "Indicateur de traitement inconnu.",
"02": "Indicateur de traitement inconnu.",
"03": "Indicateur de traitement inconnu.",
"04": "Indicateur de traitement inconnu.",
"05": "Indicateur de traitement inconnu.",
"06": "Indicateur de traitement inconnu.",
"07": "Indicateur de traitement inconnu.",
"08": "Indicateur de traitement inconnu.",
"09": "Indicateur de traitement inconnu.",
"10": "Indicateur de traitement inconnu.",
"11": "Indicateur de traitement inconnu.",
"12": "DRE possible en HTP, pas de flux de rectification possible entre AMO et AMC.",
"13": "DRE possible en HTP, flux de rectification possible entre AMO et AMC.",
"14": "Indicateur de traitement inconnu.",
"15": "Indicateur de traitement inconnu.",
"16": "Indicateur de traitement inconnu.",
"17": "Indicateur de traitement inconnu.",
"18": "Indicateur de traitement inconnu.",
"19": "Indicateur de traitement inconnu.",
"20": "Indicateur de traitement inconnu.",
"21": "Indicateur de traitement inconnu.",
"22": "DRE possible en TP, pas de flux de rectification possible entre AMO et AMC.",
"23": "DRE possible en TP, flux de rectification possible entre AMO et AMC.",
"24": "Indicateur de traitement inconnu.",
"25": "Indicateur de traitement inconnu.",
"26": "Indicateur de traitement inconnu.",
"27": "Indicateur de traitement inconnu.",
"28": "Indicateur de traitement inconnu.",
"29": "Indicateur de traitement inconnu.",
"30": "Indicateur de traitement inconnu.",
"31": "Indicateur de traitement inconnu.",
"32": "DRE possible en TP et HTP, pas de flux de rectification possible entre AMO et AMC.",
"33": "DRE possible en TP et HTP, flux de rectification possible entre AMO et AMC.",
"34": "Indicateur de traitement inconnu.",
"35": "Indicateur de traitement inconnu.",
"36": "Indicateur de traitement inconnu.",
"37": "Indicateur de traitement inconnu.",
"38": "Indicateur de traitement inconnu.",
"39": "Indicateur de traitement inconnu.",
"40": "Indicateur de traitement inconnu.",
"41": "Indicateur de traitement inconnu.",
"42": "Indicateur de traitement inconnu.",
"43": "Indicateur de traitement inconnu.",
"44": "Indicateur de traitement inconnu.",
"45": "Indicateur de traitement inconnu.",
"46": "Indicateur de traitement inconnu.",
"47": "Indicateur de traitement inconnu.",
"48": "Indicateur de traitement inconnu.",
"49": "Indicateur de traitement inconnu.",
"50": "Indicateur de traitement inconnu.",
"51": "Indicateur de traitement inconnu.",
"52": "Indicateur de traitement inconnu.",
"53": "Indicateur de traitement inconnu.",
"54": "Indicateur de traitement inconnu.",
"55": "Indicateur de traitement inconnu.",
"56": "Indicateur de traitement inconnu.",
"57": "Indicateur de traitement inconnu.",
"58": "Indicateur de traitement inconnu.",
"59": "Indicateur de traitement inconnu.",
"60": "Bénéficiaire CMU complémentaire, pas de DRE possible, pas de flux de rectification possible entre AMO et AMC.",
"61": "Indicateur de traitement inconnu.",
"62": "Bénéficiaire CMU complémentaire, DRE possible, pas de flux de rectification possible entre AMO et AMC.",
"63": "Bénéficiaire CMU complémentaire, DRE possible, flux de rectification possible entre AMO et AMC.",
"64": "Indicateur de traitement inconnu.",
"65": "Indicateur de traitement inconnu.",
"66": "Indicateur de traitement inconnu.",
"67": "Indicateur de traitement inconnu.",
"68": "Indicateur de traitement inconnu.",
"69": "Indicateur de traitement inconnu.",
"70": "Indicateur de traitement inconnu.",
"71": "Indicateur de traitement inconnu.",
"72": "Bénéficiaire sortant de CMU complémentaire, DRE possible, pas de flux de rectification possible entre AMO et AMC.",
"73": "Bénéficiaire sortant de CMU complémentaire, DRE possible, flux de rectification possible entre AMO et AMC.",
"74": "Indicateur de traitement inconnu.",
"75": "Indicateur de traitement inconnu.",
"76": "Indicateur de traitement inconnu.",
"77": "Indicateur de traitement inconnu.",
"78": "Indicateur de traitement inconnu.",
"79": "Indicateur de traitement inconnu.",
"80": "Indicateur de traitement inconnu.",
"81": "Indicateur de traitement inconnu.",
"82": "Indicateur de traitement inconnu.",
"83": "Indicateur de traitement inconnu.",
"84": "Indicateur de traitement inconnu.",
"85": "Indicateur de traitement inconnu.",
"86": "Indicateur de traitement inconnu.",
"87": "Indicateur de traitement inconnu.",
"88": "Indicateur de traitement inconnu.",
"89": "Indicateur de traitement inconnu.",
"90": "Indicateur de traitement inconnu.",
"91": "Indicateur de traitement inconnu.",
"92": "Indicateur de traitement inconnu.",
"93": "Indicateur de traitement inconnu.",
"94": "Indicateur de traitement inconnu.",
"95": "Indicateur de traitement inconnu.",
"96": "Indicateur de traitement inconnu.",
"97": "Indicateur de traitement inconnu.",
"98": "Indicateur de traitement inconnu.",
"99": "Indicateur de traitement inconnu."
},
"TABLE_CODEROUT": {
"00": "Routage inconnu",
"01": "Routage inconnu",
"02": "Routage inconnu",
"03": "Routage inconnu",
"04": "Routage inconnu",
"05": "Routage inconnu",
"06": "Routage inconnu",
"07": "Routage inconnu",
"08": "Routage inconnu",
"09": "Routage inconnu",
"10": "Routage inconnu",
"11": "Routage inconnu",
"12": "Routage inconnu",
"13": "Routage inconnu",
"14": "Routage inconnu",
"15": "Routage inconnu",
"16": "Routage inconnu",
"17": "Routage inconnu",
"18": "Routage inconnu",
"19": "Routage inconnu",
"20": "Routage inconnu",
"21": "Routage inconnu",
"22": "Routage inconnu",
"23": "Routage inconnu",
"24": "Routage inconnu",
"25": "Routage inconnu",
"26": "Routage inconnu",
"27": "Routage inconnu",
"28": "Routage inconnu",
"29": "Routage inconnu",
"30": "Routage inconnu",
"31": "Routage inconnu",
"32": "Routage inconnu",
"33": "Routage inconnu",
"34": "Routage inconnu",
"35": "Routage inconnu",
"36": "Routage inconnu",
"37": "Routage inconnu",
"38": "Routage inconnu",
"39": "Routage inconnu",
"40": "Routage inconnu",
"41": "Routage inconnu",
"42": "Routage inconnu",
"43": "Routage inconnu",
"44": "Routage inconnu",
"45": "Routage inconnu",
"46": "Routage inconnu",
"47": "Routage inconnu",
"48": "Routage inconnu",
"49": "Routage inconnu",
"50": "Routage inconnu",
"51": "Routage inconnu",
"52": "Routage inconnu",
"53": "Routage inconnu",
"54": "Routage inconnu",
"55": "Routage inconnu",
"56": "Routage inconnu",
"57": "Routage inconnu",
"58": "Routage inconnu",
"59": "Routage inconnu",
"60": "Routage inconnu",
"61": "Routage inconnu",
"62": "Routage inconnu",
"63": "Routage inconnu",
"64": "Routage inconnu",
"65": "Routage inconnu",
"66": "Routage inconnu",
"67": "Routage inconnu",
"68": "Routage inconnu",
"69": "Routage inconnu",
"70": "Routage inconnu",
"71": "Routage inconnu",
"72": "Routage inconnu",
"73": "Routage inconnu",
"74": "Routage inconnu",
"75": "Routage inconnu",
"76": "Routage inconnu",
"77": "Routage inconnu",
"78": "Routage inconnu",
"79": "Routage inconnu",
"80": "Routage inconnu",
"81": "Routage inconnu",
"82": "Routage inconnu",
"83": "Routage inconnu",
"84": "Routage inconnu",
"85": "Routage inconnu",
"86": "Routage inconnu",
"87": "Routage inconnu",
"88": "Routage inconnu",
"89": "Routage inconnu",
"90": "Routage inconnu",
"91": "Routage inconnu",
"92": "Routage inconnu",
"93": "Routage inconnu",
"94": "Routage inconnu",
"95": "Routage inconnu",
"96": "Routage inconnu",
"97": "Routage inconnu",
"98": "Routage inconnu",
"99": "Routage inconnu"
},
"TABLE_CAISSE": {
}
}

View File

@ -1,3 +1,5 @@
import os
from django.contrib.auth.models import Group
from django.conf import settings
@ -90,3 +92,41 @@ def get_service_setting(setting_name, default_value=None):
if not hasattr(settings, 'SERVICE_SETTINGS'):
return None
return settings.SERVICE_SETTINGS.get(service, {}).get(setting_name) or default_value
def get_last_file(path, prefix=None, suffix=None):
'''
A filename is of format year-mont-day-hour-min-sec.xml or
prefix_year-mont-day-hour-min-secsuffix
If suffix is None, only file *_year-mont-day-hour-min-sec are treated.
If prefix is None, all files *_year-mont-day-hour-min-secsuffix are
treated.
'''
if not path or not os.path.isdir(path):
return None
cv_files = [(f, f) for f in os.listdir(path) \
if os.path.isfile(os.path.join(path, f)) ]
if prefix:
cv_files = [(f1, f2[len(prefix) + 1:])
for f1, f2 in cv_files if f2.startswith(prefix)]
else:
cv_files = [(f1, f2.rsplit('_', 1)[-1])
for f1, f2 in cv_files]
if suffix:
cv_files = [(f1, f2[:-len(suffix)])
for f1, f2 in cv_files if f2.endswith(suffix)]
fmt = '%Y-%d-%m-%H-%M-%S'
cv_files_and_dates = list()
for f1, f2 in cv_files:
try:
d = datetime.strptime(f2, fmt)
except:
pass
else:
cv_files_and_dates.append((f1, d))
if len(cv_files_and_dates):
cv_files_and_dates = sorted(cv_files_and_dates,
key=lambda x:x[1], reverse=True)
return os.path.join(path, cv_files_and_dates[0][0])
else:
return None