Skip to content
Snippets Groups Projects
Commit 2536936e authored by Carlos Vega's avatar Carlos Vega
Browse files

considered new property 'excluded' from study subject

parent b13fe510
No related branches found
No related tags found
1 merge request!178Feature/import data pdp
Pipeline #7237 passed
...@@ -56,6 +56,7 @@ def create_empty_study_columns(): ...@@ -56,6 +56,7 @@ def create_empty_study_columns():
information_sent=False, information_sent=False,
pd_in_family=False, pd_in_family=False,
resigned=False, resigned=False,
excluded=False,
resign_reason=False, resign_reason=False,
) )
......
...@@ -185,7 +185,7 @@ def get_subjects_with_almost_expired_vouchers(user): ...@@ -185,7 +185,7 @@ def get_subjects_with_almost_expired_vouchers(user):
contact_attempt_min_date = get_today_midnight_date() - datetime.timedelta(days=7) contact_attempt_min_date = get_today_midnight_date() - datetime.timedelta(days=7)
result = StudySubject.objects.filter( result = StudySubject.objects.filter(
subject__dead=False, subject__dead=False,
resigned=False, resigned=False, excluded=False,
default_location__in=get_filter_locations(user), default_location__in=get_filter_locations(user),
).annotate(last_contact=Max(Case(When(contactattempt__success=True, then="contactattempt__datetime_when")))).filter( ).annotate(last_contact=Max(Case(When(contactattempt__success=True, then="contactattempt__datetime_when")))).filter(
Q(vouchers__status=VOUCHER_STATUS_NEW) & Q(vouchers__expiry_date__lte=notification_min_date)).filter( Q(vouchers__status=VOUCHER_STATUS_NEW) & Q(vouchers__expiry_date__lte=notification_min_date)).filter(
...@@ -198,7 +198,7 @@ def get_subjects_with_reminder(user): ...@@ -198,7 +198,7 @@ def get_subjects_with_reminder(user):
result = StudySubject.objects.filter( result = StudySubject.objects.filter(
subject__dead=False, subject__dead=False,
resigned=False, resigned=False, excluded=False,
default_location__in=get_filter_locations(user), default_location__in=get_filter_locations(user),
datetime_contact_reminder__lt=tomorrow, datetime_contact_reminder__lt=tomorrow,
) )
...@@ -222,6 +222,7 @@ def get_approaching_visits_without_appointments(user): ...@@ -222,6 +222,7 @@ def get_approaching_visits_without_appointments(user):
my_count=Count(Case(When(appointment__status=Appointment.APPOINTMENT_STATUS_SCHEDULED, then=1)))).filter( my_count=Count(Case(When(appointment__status=Appointment.APPOINTMENT_STATUS_SCHEDULED, then=1)))).filter(
subject__subject__dead=False, subject__subject__dead=False,
subject__resigned=False, subject__resigned=False,
subject__excluded=False,
datetime_begin__gt=today, datetime_begin__gt=today,
datetime_begin__lt=today_plus_two_months, datetime_begin__lt=today_plus_two_months,
is_finished=False, is_finished=False,
...@@ -237,6 +238,7 @@ def get_approaching_visits_for_mail_contact(user): ...@@ -237,6 +238,7 @@ def get_approaching_visits_for_mail_contact(user):
my_count=Count(Case(When(appointment__status=Appointment.APPOINTMENT_STATUS_SCHEDULED, then=1)))).filter( my_count=Count(Case(When(appointment__status=Appointment.APPOINTMENT_STATUS_SCHEDULED, then=1)))).filter(
subject__subject__dead=False, subject__subject__dead=False,
subject__resigned=False, subject__resigned=False,
subject__excluded=False,
datetime_begin__gt=today_plus_three_months, datetime_begin__gt=today_plus_three_months,
datetime_begin__lt=today_plus_six_months, datetime_begin__lt=today_plus_six_months,
is_finished=False, is_finished=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment