def dvr_due_followups():
 r = S3Request('dvr', 'case_activity', args=[], get_vars={})
 r.customise_resource()
 resource = r.resource
 query = ((((FS('followup') == True) & (FS('followup_date') <= datetime.datetime.utcnow().date())) & (FS('completed') != True)) & (FS('person_id$dvr_case.archived') == False))
 resource.add_filter(query)
 return resource.count()

def dvr_due_followups ( ) : r = S3Request ( 'dvr' , 'case_activity' , args = [ ] , get_vars = { } ) r . customise_resource ( ) resource = r . resource query = ( ( ( ( FS ( 'followup' ) == True ) & ( FS ( 'followup_date' ) <= datetime . datetime . utcnow ( ) . date ( ) ) ) & ( FS ( 'completed' ) != True ) ) & ( FS ( 'person_id$dvr_case.archived' ) == False ) ) resource . add_filter ( query ) return resource . count ( )
number of due follow-ups .