Revision ef86b6e5
Added by Mikaël Ates over 12 years ago
calebasse/actes/models.py | ||
---|---|---|
28 | 28 |
auto = models.BooleanField(default=False, |
29 | 29 |
verbose_name=u'Vérouillage') |
30 | 30 |
|
31 |
def __unicode__(self): |
|
32 |
return self.state_name + ' ' + str(self.created) |
|
33 |
|
|
31 | 34 |
|
32 | 35 |
class Act(models.Model): |
33 | 36 |
patient = models.ForeignKey('dossiers.PatientRecord') |
... | ... | |
73 | 76 |
ActValidationState(act=self, state_name=state_name, |
74 | 77 |
author=author, previous_state=current_state).save() |
75 | 78 |
|
79 |
# START Specific to sessad healthcare |
|
80 |
def was_covered_by_notification(self): |
|
81 |
notifications = \ |
|
82 |
SessadHealthCareNotification.objects.filter(patient=self.patient, |
|
83 |
start_date__lte=self.date, end_date__gte=self.date) |
|
84 |
if notifications: |
|
85 |
return True |
|
86 |
# END Specific to sessad healthcare |
|
87 |
|
|
76 | 88 |
def __unicode__(self): |
77 | 89 |
return '{0} le {1} pour {2} avec {3}'.format( |
78 | 90 |
self.act_type, self.date, self.patient, |
... | ... | |
143 | 155 |
ActValidationState(act=act_event, state_name='NON_VALIDE', |
144 | 156 |
author=creator, previous_state=None).save() |
145 | 157 |
|
146 |
|
|
147 | 158 |
return self._set_event(act_event, participants, description, |
148 | 159 |
services=[service], start_datetime=start_datetime, |
149 | 160 |
end_datetime=end_datetime, |
Also available in: Unified diff
actes: add function to Act for Sessad notification.