示例#1
0
 def total(self, case):
     for action in case.actions:
         if visit_is(action, 'reg'):
             if not action.date:
                 logging.error('Reg action has no date! Case %s' % case.get_id)
             else:
                 yield action.date
示例#2
0
 def _filter(a):
     return (visit_is(a, self.visit_type)  # right type
             and date_in_range(a.date.date(), date)  # within window
             and a.date > getters.date_modified(
                 form, force_to_date=False,
                 force_to_datetime=True)  # came after "due" visit
             and a.xform_id not in self._visits_used
             )  # not already counted
示例#3
0
 def total(self, case):
     for action in case.actions:
         if visit_is(action, 'reg'):
             if not action.date:
                 logging.error('Reg action has no date! Case %s' %
                               case.get_id)
             else:
                 yield action.date
示例#4
0
 def _total_action_filter(self, a):
     return any(visit_is(a, visit_type)
                for visit_type in self.form_types)
示例#5
0
 def _filter(a):
     return (visit_is(a, self.visit_type)  # right type
             and date_in_range(a.date.date(), date)  # within window
             and a.date > getters.date_modified(form, force_to_date=False, force_to_datetime=True)  # came after "due" visit
             and a.xform_id not in self._visits_used)  # not already counted
示例#6
0
 def action_filter(self, action):
     return visit_is(action, 'bp')
示例#7
0
 def _total_action_filter(self, a):
     return any(visit_is(a, visit_type) for visit_type in self.form_types)
示例#8
0
 def action_filter(self, action):
     return visit_is(action, 'bp')