Beispiel #1
0
    def from_couch(cls, form):
        assert form.xmlns == VISIT_TYPES['bp']

        return cls(
            _id=form._id,
            date_modified=getters.date_modified(form),
            date_next_bp=getters.date_next_bp(form),
            days_visit_overdue=getters.days_visit_overdue(form),
        )
Beispiel #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