Esempio n. 1
0
 def _no_prep(case):
     for form in get_forms(case, action_filter=lambda a: visit_is(a, 'bp')):
         if form.xpath('form/bp2/wrapping') == 'no' and \
                 form.xpath('form/bp2/skin_To_skin') == 'no' and \
                 form.xpath('form/bp2/immediate_breastfeeding') == 'no' and \
                 form.xpath('form/bp2/cord_care') == 'no':
             return True
     return False
Esempio n. 2
0
 def _denominator(self, case):
     return 1 if len(filter(lambda a: visit_is(a, 'bp'), case.actions)) >= 3 else 0
Esempio n. 3
0
def _visits_done(case, schedule, type):
    due = _visits_due(case, schedule)
    count = len(filter(lambda a: visit_is(a, type), case.actions))
    return len([v for v in due if count > v])
Esempio n. 4
0
 def _no_counseling(case):
     for form in get_forms(case, action_filter=lambda a: visit_is(a, 'bp')):
         if form.xpath('form/bp2/counsel_accessible') == 'no':
             return True
     return False
Esempio n. 5
0
 def _no_prep(case):
     for form in get_forms(case, action_filter=lambda a: visit_is(a, 'bp')):
         if form.xpath('form/bp2/maternal_danger_signs') == 'no' and \
                 form.xpath('form/bp2/danger_institution') == 'no':
             return True
     return False
Esempio n. 6
0
 def filter_action(action):
     if visit_is(action, "del"):
         now = datetime.now()
         return now - timedelta(days=30) <= action.date
     return False