models: improve models to manage validation ac
This commit is contained in:
parent
93e8b1b8a3
commit
47b11707c0
|
@ -47,6 +47,7 @@ class Act(models.Model):
|
|||
doctors = models.ManyToManyField('personnes.Worker',
|
||||
limit_choices_to={'type__intervene': True},
|
||||
verbose_name=u'Thérapeutes')
|
||||
histories = models.ManyToManyField('HistoryAct')
|
||||
|
||||
def is_absent(self):
|
||||
if self.get_state() in ('ABS_NON_EXC', 'ABS_EXC', 'ANNUL_NOUS',
|
||||
|
@ -86,6 +87,19 @@ class Act(models.Model):
|
|||
ordering = ['-date', 'patient']
|
||||
|
||||
|
||||
class HistoryAct(models.Model):
|
||||
EVENT_CHOICES = (
|
||||
('NR', u'Nouveau rendez-vous'),
|
||||
('AV', u'Acte validé'),
|
||||
('CF', u'En cours de facturation'),
|
||||
('AF', u'Acte facturé'),
|
||||
)
|
||||
date = models.DateTimeField()
|
||||
event_type = models.CharField(max_length=2,
|
||||
choices=EVENT_CHOICES)
|
||||
description = models.TextField(default='')
|
||||
|
||||
|
||||
class EventActManager(EventManager):
|
||||
|
||||
def create_patient_appointment(self, creator, title, patient, participants,
|
||||
|
|
|
@ -60,6 +60,8 @@ class PatientRecord(ServiceLinkedAbstractModel, People):
|
|||
editable=False)
|
||||
contacts = models.ManyToManyField('personnes.People',
|
||||
related_name='contact_of')
|
||||
birthdate = models.DateField()
|
||||
paper_id = models.CharField(max_length=12)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(PatientRecord, self).__init__(*args, **kwargs)
|
||||
|
|
Reference in New Issue