예제 #1
0
 def numerator(self, case):
     n_qualifying_visits = len(filter(lambda a: visit_is(a, self.visit_type), case.actions))
     # What's below is true to the original, but I think it should be
     # self.schedule[:n_qualifying_visits]
     # to be revisited
     if n_qualifying_visits != 0:
         for days in self.schedule[: n_qualifying_visits - 1]:
             yield case.add + datetime.timedelta(days=days) + GRACE_PERIOD
예제 #2
0
 def total(self, case):
     # if not has_visit(case, 'reg'):
     #     logging.error('Case has no reg action: %s' % case.get_id)
     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
예제 #3
0
 def total(self, case):
     # if not has_visit(case, 'reg'):
     #     logging.error('Case has no reg action: %s' % case.get_id)
     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 numerator(self, case):
     n_qualifying_visits = len(
         filter(lambda a: visit_is(a, self.visit_type), case.actions)
     )
     # What's below is true to the original, but I think it should be
     # self.schedule[:n_qualifying_visits]
     # to be revisited
     if n_qualifying_visits != 0:
         for days in self.schedule[:n_qualifying_visits - 1]:
             yield case.add + datetime.timedelta(days=days) + GRACE_PERIOD
예제 #5
0
 def total(self, case):
     n_visits = len(filter(lambda a: visit_is(a, 'bp'), case.actions))
     if n_visits >= self.n_visits:
         yield None
예제 #6
0
 def action_filter(self, action):
     return visit_is(action, 'bp')
예제 #7
0
 def total(self, case):
     n_visits = len(filter(lambda a: visit_is(a, "bp"), case.actions))
     if n_visits >= self.n_visits:
         yield None
예제 #8
0
 def action_filter(self, action):
     return visit_is(action, "bp")