From e1afc1f4e7d0760b88f9591b8f08aa6ae2df1f89 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 7 Jul 2021 16:32:43 +0200 Subject: [PATCH] rm exclusion_criteria_checked This field was meant to covere two aspects: 1. Remind users to check exclusion criteria. 2. Document that exclusion criteria have already been checked in an earlier call/mail. (1) is not really that relevant because recruiters usually know the criteria by heart after a few calls. It is nice to have the text available, but it is usually not necessary for each participant. (2) also has limited utility. For phone recruitment, everything is usually checked in a single call. For mail recruitment there are usually more than one mail, but those have a relatively clear structure. --- castellum/recruitment/forms.py | 1 - ...articipation_exclusion_criteria_checked.py | 17 ++++++++++++++++ .../recruitment/models/participations.py | 1 - castellum/recruitment/static/js/contact.js | 20 ------------------- .../templates/recruitment/contact.html | 9 --------- .../templates/subjects/subject_export.html | 3 --- 6 files changed, 17 insertions(+), 34 deletions(-) create mode 100644 castellum/recruitment/migrations/0038_remove_participation_exclusion_criteria_checked.py diff --git a/castellum/recruitment/forms.py b/castellum/recruitment/forms.py index 798af519c..21207bbd7 100644 --- a/castellum/recruitment/forms.py +++ b/castellum/recruitment/forms.py @@ -177,7 +177,6 @@ class ContactForm(forms.ModelForm): 'status', 'followup_date', 'followup_time', - 'exclusion_criteria_checked', 'assigned_recruiter', ] diff --git a/castellum/recruitment/migrations/0038_remove_participation_exclusion_criteria_checked.py b/castellum/recruitment/migrations/0038_remove_participation_exclusion_criteria_checked.py new file mode 100644 index 000000000..77264474a --- /dev/null +++ b/castellum/recruitment/migrations/0038_remove_participation_exclusion_criteria_checked.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.5 on 2021-07-07 14:32 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('recruitment', '0037_participation_excluded_by_cleanup'), + ] + + operations = [ + migrations.RemoveField( + model_name='participation', + name='exclusion_criteria_checked', + ), + ] diff --git a/castellum/recruitment/models/participations.py b/castellum/recruitment/models/participations.py index c3a830e5c..824af7aff 100644 --- a/castellum/recruitment/models/participations.py +++ b/castellum/recruitment/models/participations.py @@ -140,7 +140,6 @@ class Participation(models.Model): status = models.IntegerField( _('Status of participation'), choices=STATUS_OPTIONS, default=NOT_CONTACTED ) - exclusion_criteria_checked = models.BooleanField(_('Subject may be suitable'), default=False) dropped_out = models.BooleanField(_('Dropped out'), default=False) excluded_by_cleanup = models.BooleanField(_('Excluded by cleanup'), default=False) diff --git a/castellum/recruitment/static/js/contact.js b/castellum/recruitment/static/js/contact.js index 5872e14ab..04c733512 100644 --- a/castellum/recruitment/static/js/contact.js +++ b/castellum/recruitment/static/js/contact.js @@ -16,24 +16,4 @@ $$.on(document, 'change', '[name="status"]', setVisibility); setVisibility(); - - var invited = document.querySelector('[name="status"] [value="3"]'); - var initialDisabled = invited.disabled; - var alert = document.querySelector('[data-js="blocking_invitation_alert"]'); - - var setInvitedDisabled = function() { - var checked = document.querySelector('[name="exclusion_criteria_checked"]'); - var needsCheck = checked && !checked.checked; - invited.disabled = initialDisabled || needsCheck; - if (alert) { - alert.hidden = !needsCheck; - } - }; - - $$.on(document, 'change', '[name="exclusion_criteria_checked"]', setInvitedDisabled); - setInvitedDisabled(); - - $$.on(document, 'change', '[name="exclusion_criteria_checked"]', function() { - document.querySelector('#criteria-tab .fa-exclamation-triangle').hidden = this.checked; - }); })(); diff --git a/castellum/recruitment/templates/recruitment/contact.html b/castellum/recruitment/templates/recruitment/contact.html index 1b34736b7..518ac6650 100644 --- a/castellum/recruitment/templates/recruitment/contact.html +++ b/castellum/recruitment/templates/recruitment/contact.html @@ -55,7 +55,6 @@ {% if study.has_exclusion_criteria %} @@ -150,8 +149,6 @@ {{ study_type.exclusion_criteria|urlize|linebreaks }} {% endif %} {% endfor %} - - {% bootstrap_field form.exclusion_criteria_checked %} {% endif %} @@ -197,12 +194,6 @@ {% include 'utils/form_errors.html' with form=form %} - {% if study.has_exclusion_criteria %} - - {% endif %} {% csrf_token %} {% bootstrap_field form.status %} diff --git a/castellum/subjects/templates/subjects/subject_export.html b/castellum/subjects/templates/subjects/subject_export.html index 681640ee2..49a5b08c4 100644 --- a/castellum/subjects/templates/subjects/subject_export.html +++ b/castellum/subjects/templates/subjects/subject_export.html @@ -215,9 +215,6 @@
{% translate 'Participation last updated at' %}
{{ participation|display:'updated_at' }}
-
{% translate 'Exclusion criteria checked' %}
-
{{ participation|display:'exclusion_criteria_checked' }}
-
{% translate 'Contact attempts' %}
{{ participation|display:'attempts' }}
-- GitLab