Project

General

Profile

« Previous | Next » 

Revision 41dfa4b8

Added by Jérôme Schneider over 12 years ago

agenda: add act type and workers initial

View differences:

calebasse/agenda/appointments.py
10 10
class Appointment(object):
11 11

  
12 12
    def __init__(self, title=None, begin_time=None, type=None,
13
            length=None, description=None, room=None, convocation_sent=None,
14
            service_name=None, patient_record_id=None, event_id=None):
13
            length=None, description=None, room=None):
15 14
        """ """
16 15
        self.title = title
17 16
        self.type = type
......
23 22
        self.patient_record_id = None
24 23
        self.event_id = None
25 24
        self.service = None
25
        self.workers_initial = None
26
        self.act_type = None
26 27
        self.__set_time(begin_time)
27 28

  
28 29
    def __set_time(self, time):
......
52 53
        self.description = occurrence.event.description
53 54
        if occurrence.event.event_type.label == 'patient_appointment':
54 55
            event_act = occurrence.event.eventact
56
            workers = event_act.participants.all()
55 57
            self.convocation_sent = event_act.convocation_sent
56 58
            self.patient_record_id = event_act.patient.id
59
            self.workers_initial = ""
60
            for worker in workers:
61
                self.workers_initial += " " + worker.first_name.upper()[0]
62
                self.workers_initial += worker.last_name.upper()[0]
63
            self.act_type = event_act.act_type.name
57 64

  
58 65
    def init_free_time(self, length, begin_time):
59 66
        """ """

Also available in: Unified diff