meta-edc 1.1.14__py3-none-any.whl → 1.1.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of meta-edc might be problematic. Click here for more details.

Files changed (68) hide show
  1. meta_ae/templatetags/meta_ae_extras.py +2 -2
  2. meta_analytics/dataframes/get_last_imp_visits_df.py +2 -2
  3. meta_analytics/tables/enrolled/glucose.py +1 -2
  4. meta_consent/models/subject_consent_v1.py +0 -1
  5. meta_edc/admin.py +1 -1
  6. meta_edc/celery.py +2 -1
  7. meta_edc/celery_live.py +2 -1
  8. meta_edc/celery_uat.py +2 -1
  9. meta_edc/meta_version.py +2 -2
  10. meta_edc/navbars.py +7 -5
  11. meta_edc/settings/defaults.py +3 -3
  12. meta_edc/urls.py +1 -1
  13. meta_edc/utils.py +3 -1
  14. {meta_edc-1.1.14.dist-info → meta_edc-1.1.17.dist-info}/METADATA +10 -11
  15. {meta_edc-1.1.14.dist-info → meta_edc-1.1.17.dist-info}/RECORD +68 -67
  16. meta_pharmacy/admin/substitutions_admin.py +1 -1
  17. meta_pharmacy/forms/rx_form.py +0 -1
  18. meta_pharmacy/management/commands/update_initial_pharmacy_data.py +4 -3
  19. meta_pharmacy/models/rx_label.py +0 -1
  20. meta_prn/action_items.py +23 -31
  21. meta_prn/admin/end_of_study_admin.py +2 -2
  22. meta_prn/admin/offschedule_dm_referral_admin.py +0 -1
  23. meta_prn/admin/offschedule_postnatal_admin.py +0 -1
  24. meta_prn/admin/offschedule_pregnancy_admin.py +0 -1
  25. meta_prn/choices.py +6 -6
  26. meta_prn/form_validators/end_of_study.py +9 -8
  27. meta_prn/forms/dm_referral_form.py +2 -8
  28. meta_prn/forms/end_of_study_form.py +1 -1
  29. meta_prn/forms/off_study_medication_form.py +2 -2
  30. meta_prn/forms/pregnancy_notification_form.py +14 -16
  31. meta_prn/list_data.py +2 -2
  32. meta_prn/migrations/0068_alter_dmreferral_referral_note_and_more.py +235 -0
  33. meta_prn/models/dm_referral.py +2 -2
  34. meta_prn/models/end_of_study.py +7 -7
  35. meta_prn/models/loss_to_followup.py +6 -6
  36. meta_prn/models/off_study_medication.py +3 -2
  37. meta_prn/models/pregnancy_notification.py +3 -3
  38. meta_prn/models/protocol_incident.py +4 -1
  39. meta_prn/models/signals.py +15 -13
  40. meta_prn/models/subject_transfer.py +0 -1
  41. meta_reports/admin/dbviews/imp_substitutions_admin.py +1 -1
  42. meta_reports/admin/dbviews/on_study_missing_values_admin/unmanaged_model_admin.py +0 -1
  43. meta_reports/admin/endpoints_all_admin.py +0 -1
  44. meta_reports/admin/modeladmin_mixins.py +1 -1
  45. meta_reports/models/dbviews/imp_substitutions/unmanaged_model.py +0 -1
  46. meta_reports/models/dbviews/on_study_missing_lab_values/unmanged_model.py +0 -1
  47. meta_reports/models/dbviews/on_study_missing_values/unmanged_model.py +0 -1
  48. meta_reports/models/dbviews/patient_history_missing_baseline_cd4/unmanaged_model.py +0 -1
  49. meta_reports/models/dbviews/unattended_three_in_row/unmanaged_model.py +0 -1
  50. meta_reports/models/dbviews/unattended_three_in_row2/unmanaged_model.py +0 -1
  51. meta_reports/models/dbviews/unattended_two_in_row/unmanaged_model.py +0 -1
  52. meta_screening/admin/fieldsets.py +0 -1
  53. meta_screening/admin/screening_part_one_admin.py +0 -1
  54. meta_screening/forms/field_lists.py +0 -1
  55. meta_subject/admin/birth_outcome_admin.py +4 -2
  56. meta_subject/admin/fields.py +5 -5
  57. meta_subject/admin/fieldsets.py +5 -5
  58. meta_subject/admin/glucose_admin.py +2 -4
  59. meta_subject/admin/glucose_fbg_admin.py +5 -7
  60. meta_subject/admin/list_filters.py +3 -3
  61. meta_subject/admin/next_appointment_admin.py +0 -1
  62. meta_subject/form_validators/glucose_form_validator.py +7 -5
  63. meta_subject/forms/blood_results/blood_results_hba1c_form.py +1 -1
  64. meta_subject/forms/subject_requisition_form.py +1 -1
  65. meta_subject/models/blood_results/__init__.py +0 -1
  66. meta_subject/models/next_appointment.py +0 -1
  67. {meta_edc-1.1.14.dist-info → meta_edc-1.1.17.dist-info}/WHEEL +0 -0
  68. {meta_edc-1.1.14.dist-info → meta_edc-1.1.17.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,6 @@
1
1
  from django.db import models
2
2
  from edc_action_item.models import ActionModelMixin
3
+ from edc_constants.constants import NULL_STRING
3
4
  from edc_identifier.model_mixins import UniqueSubjectIdentifierFieldMixin
4
5
  from edc_model.models import BaseUuidModel
5
6
  from edc_sites.model_mixins import SiteModelMixin
@@ -14,7 +15,6 @@ class DmReferral(
14
15
  UniqueSubjectIdentifierFieldMixin,
15
16
  BaseUuidModel,
16
17
  ):
17
-
18
18
  action_name = DM_REFFERAL_ACTION
19
19
 
20
20
  report_datetime = models.DateTimeField(
@@ -30,7 +30,7 @@ class DmReferral(
30
30
  "Please provide a brief history of the "
31
31
  "diabetes diagnosis that lead to this referral"
32
32
  ),
33
- null=True,
33
+ default=NULL_STRING,
34
34
  blank=False,
35
35
  )
36
36
 
@@ -6,6 +6,7 @@ from edc_constants.constants import (
6
6
  DELIVERY,
7
7
  DIABETES,
8
8
  NOT_APPLICABLE,
9
+ NULL_STRING,
9
10
  OTHER,
10
11
  PREGNANCY,
11
12
  TOXICITY,
@@ -73,7 +74,7 @@ class EndOfStudy(ActionModelMixin, SiteModelMixin, OffstudyModelMixin, BaseUuidM
73
74
  verbose_name="If OTHER, please specify",
74
75
  max_length=500,
75
76
  blank=True,
76
- null=True,
77
+ default=NULL_STRING,
77
78
  )
78
79
 
79
80
  # TODO: 6m off drug and duration ?? See SOP
@@ -118,8 +119,7 @@ class EndOfStudy(ActionModelMixin, SiteModelMixin, OffstudyModelMixin, BaseUuidM
118
119
 
119
120
  clinical_withdrawal_reason = models.CharField(
120
121
  verbose_name=(
121
- "If the patient was withdrawn on CLINICAL grounds, "
122
- "please specify PRIMARY reason"
122
+ "If the patient was withdrawn on CLINICAL grounds, please specify PRIMARY reason"
123
123
  ),
124
124
  max_length=25,
125
125
  choices=CLINICAL_WITHDRAWAL_REASONS,
@@ -130,14 +130,14 @@ class EndOfStudy(ActionModelMixin, SiteModelMixin, OffstudyModelMixin, BaseUuidM
130
130
  verbose_name="If withdrawn for 'other' condition, please explain",
131
131
  max_length=500,
132
132
  blank=True,
133
- null=True,
133
+ default=NULL_STRING,
134
134
  )
135
135
 
136
136
  clinical_withdrawal_investigator_decision = models.TextField(
137
137
  verbose_name="If withdrawl was an 'investigator decision', please explain ...",
138
138
  max_length=500,
139
139
  blank=True,
140
- null=True,
140
+ default=NULL_STRING,
141
141
  )
142
142
 
143
143
  toxicity_withdrawal_reason = models.CharField(
@@ -151,7 +151,7 @@ class EndOfStudy(ActionModelMixin, SiteModelMixin, OffstudyModelMixin, BaseUuidM
151
151
  verbose_name="If 'other toxicity', please specify ...",
152
152
  max_length=500,
153
153
  blank=True,
154
- null=True,
154
+ default=NULL_STRING,
155
155
  )
156
156
 
157
157
  transfer_date = models.DateField(
@@ -173,7 +173,7 @@ class EndOfStudy(ActionModelMixin, SiteModelMixin, OffstudyModelMixin, BaseUuidM
173
173
  verbose_name="Please provide further details if possible",
174
174
  max_length=500,
175
175
  blank=True,
176
- null=True,
176
+ default=NULL_STRING,
177
177
  )
178
178
 
179
179
  class Meta(OffstudyModelMixin.Meta):
@@ -1,7 +1,7 @@
1
1
  from django.db import models
2
2
  from edc_action_item.models.action_model_mixin import ActionModelMixin
3
3
  from edc_constants.choices import YES_NO
4
- from edc_constants.constants import OTHER
4
+ from edc_constants.constants import NULL_STRING, OTHER
5
5
  from edc_identifier.model_mixins import UniqueSubjectIdentifierFieldMixin
6
6
  from edc_ltfu.constants import LTFU_ACTION
7
7
  from edc_model.models import BaseUuidModel, OtherCharField
@@ -48,7 +48,7 @@ class LossToFollowup(
48
48
 
49
49
  home_visit_detail = models.TextField(
50
50
  verbose_name="If YES, provide any further details of the home visit",
51
- null=True,
51
+ default=NULL_STRING,
52
52
  blank=False,
53
53
  )
54
54
 
@@ -64,13 +64,13 @@ class LossToFollowup(
64
64
  verbose_name=(
65
65
  "Please give details of the circumstances that have led to this decision."
66
66
  ),
67
- null=True,
67
+ default=NULL_STRING,
68
68
  blank=False,
69
69
  )
70
70
 
71
71
  class Meta(BaseUuidModel.Meta):
72
72
  verbose_name = "Loss to Follow Up"
73
73
  verbose_name_plural = "Loss to Follow Up"
74
- indexes = [
75
- models.Index(fields=["subject_identifier", "action_identifier", "site", "id"])
76
- ]
74
+ indexes = (
75
+ models.Index(fields=("subject_identifier", "action_identifier", "site", "id")),
76
+ )
@@ -1,5 +1,6 @@
1
1
  from django.db import models
2
2
  from edc_action_item.models import ActionModelMixin
3
+ from edc_constants.constants import NULL_STRING
3
4
  from edc_identifier.model_mixins import UniqueSubjectIdentifierFieldMixin
4
5
  from edc_model.models import BaseUuidModel
5
6
  from edc_pharmacy.models import Medication
@@ -46,13 +47,13 @@ class OffStudyMedication(
46
47
 
47
48
  reason_other = models.TextField(
48
49
  verbose_name="If other, please specify ...",
49
- null=True,
50
+ default=NULL_STRING,
50
51
  blank=True,
51
52
  )
52
53
 
53
54
  comment = models.TextField(
54
55
  verbose_name="Any additional comments",
55
- null=True,
56
+ default=NULL_STRING,
56
57
  blank=True,
57
58
  )
58
59
 
@@ -1,7 +1,7 @@
1
1
  from django.db import models
2
2
  from edc_action_item.models import ActionModelMixin
3
3
  from edc_constants.choices import YES_NO, YES_NO_UNSURE
4
- from edc_constants.constants import YES
4
+ from edc_constants.constants import NULL_STRING, YES
5
5
  from edc_identifier.model_mixins import NonUniqueSubjectIdentifierFieldMixin
6
6
  from edc_model.models import BaseUuidModel
7
7
  from edc_sites.model_mixins import SiteModelMixin
@@ -44,7 +44,7 @@ class PregnancyNotification(
44
44
 
45
45
  unconfirmed_details = models.TextField(
46
46
  verbose_name="If no, please provide details",
47
- null=True,
47
+ default=NULL_STRING,
48
48
  blank=True,
49
49
  )
50
50
 
@@ -97,4 +97,4 @@ class PregnancyNotification(
97
97
  class Meta(BaseUuidModel.Meta):
98
98
  verbose_name = "Pregnancy Notification"
99
99
  verbose_name_plural = "Pregnancy Notifications"
100
- unique_together = ["subject_identifier", "edd"]
100
+ unique_together = ("subject_identifier", "edd")
@@ -1,5 +1,6 @@
1
1
  from django.db import models
2
2
  from edc_action_item.models import ActionItem, ActionModelMixin
3
+ from edc_constants.constants import NULL_STRING
3
4
  from edc_identifier.model_mixins import NonUniqueSubjectIdentifierFieldMixin
4
5
  from edc_model.models import BaseUuidModel
5
6
  from edc_protocol_incident.constants import PROTOCOL_INCIDENT_ACTION
@@ -26,7 +27,9 @@ class ProtocolIncident(
26
27
  related_name="meta_prn_action_item",
27
28
  )
28
29
 
29
- action_required_old = models.CharField(max_length=45, choices=ACTION_REQUIRED, null=True)
30
+ action_required_old = models.CharField(
31
+ max_length=45, choices=ACTION_REQUIRED, default=NULL_STRING
32
+ )
30
33
 
31
34
  def natural_key(self):
32
35
  return (self.action_identifier,)
@@ -24,7 +24,7 @@ from .pregnancy_notification import PregnancyNotification
24
24
  sender=PregnancyNotification,
25
25
  dispatch_uid="update_schedule_on_pregnancy_notification_post_save",
26
26
  )
27
- def update_schedule_on_pregnancy_notification_post_save(sender, instance, raw, **kwargs):
27
+ def update_schedule_on_pregnancy_notification_post_save(sender, instance, raw, **kwargs): # noqa: ARG001
28
28
  if not raw:
29
29
  try:
30
30
  OffSchedule.objects.get(subject_identifier=instance.subject_identifier)
@@ -58,18 +58,20 @@ def update_schedule_on_pregnancy_notification_post_save(sender, instance, raw, *
58
58
  dispatch_uid="update_urine_pregnancy_on_pregnancy_notification_on_post_save",
59
59
  )
60
60
  def update_urine_pregnancy_on_pregnancy_notification_on_post_save(
61
- sender, instance, raw, **kwargs
61
+ sender, # noqa: ARG001
62
+ instance,
63
+ raw,
64
+ **kwargs, # noqa: ARG001
62
65
  ):
63
- if not raw:
64
- if instance.bhcg_confirmed == YES:
65
- UrinePregnancy.objects.filter(
66
- subject_visit__subject_identifier=instance.subject_identifier,
67
- notified=False,
68
- assay_date__lte=instance.report_datetime.date(),
69
- ).update(
70
- notified_datetime=instance.report_datetime,
71
- notified=True,
72
- )
66
+ if not raw and instance.bhcg_confirmed == YES:
67
+ UrinePregnancy.objects.filter(
68
+ subject_visit__subject_identifier=instance.subject_identifier,
69
+ notified=False,
70
+ assay_date__lte=instance.report_datetime.date(),
71
+ ).update(
72
+ notified_datetime=instance.report_datetime,
73
+ notified=True,
74
+ )
73
75
 
74
76
 
75
77
  @receiver(
@@ -78,7 +80,7 @@ def update_urine_pregnancy_on_pregnancy_notification_on_post_save(
78
80
  sender=DmReferral,
79
81
  dispatch_uid="update_schedule_on_dm_referral_post_save",
80
82
  )
81
- def update_schedule_on_dm_referral_post_save(sender, instance, raw, **kwargs):
83
+ def update_schedule_on_dm_referral_post_save(sender, instance, raw, **kwargs): # noqa: ARG001
82
84
  if not raw:
83
85
  try:
84
86
  OffScheduleDmReferral.objects.get(subject_identifier=instance.subject_identifier)
@@ -8,7 +8,6 @@ class SubjectTransfer(
8
8
  SubjectTransferModelMixin,
9
9
  BaseUuidModel,
10
10
  ):
11
-
12
11
  transfer_reason = models.ManyToManyField(
13
12
  f"{settings.LIST_MODEL_APP_LABEL}.transferreasons",
14
13
  verbose_name="Reason for transfer",
@@ -49,7 +49,7 @@ class ImpSubstitutionsAdmin(
49
49
  "allocated_datetime",
50
50
  )
51
51
 
52
- search_fields = ["subject_identifier", "sid", "dispensed_sid"]
52
+ search_fields = ("subject_identifier", "sid", "dispensed_sid")
53
53
 
54
54
  def dashboard(self, obj=None, label=None) -> str:
55
55
  kwargs = self.get_subject_dashboard_url_kwargs(obj)
@@ -7,7 +7,6 @@ from ....models import OnStudyMissingValues
7
7
 
8
8
  @admin.register(OnStudyMissingValues, site=meta_reports_admin)
9
9
  class OnStudyMissingValuesAdmin(OnStudyMissingValuesModelAdminMixin, admin.ModelAdmin):
10
-
11
10
  include_note_column: bool = True
12
11
  project_reports_admin: str = "meta_reports_admin"
13
12
  project_subject_admin: str = "meta_subject_admin"
@@ -8,6 +8,5 @@ from .modeladmin_mixins import EndpointsModelAdminMixin
8
8
 
9
9
  @admin.register(EndpointsProxy, site=meta_reports_admin)
10
10
  class EndpointsAllAdmin(EndpointsModelAdminMixin, admin.ModelAdmin):
11
-
12
11
  def rendered_change_list_note(self):
13
12
  return render_to_string("meta_reports/endpoints_all_change_list_note.html")
@@ -14,7 +14,7 @@ from edc_visit_schedule.admin import ScheduleStatusListFilter
14
14
  from ..tasks import update_endpoints_table
15
15
 
16
16
 
17
- def update_endpoints_table_action(modeladmin, request, queryset):
17
+ def update_endpoints_table_action(modeladmin, request, queryset): # noqa: ARG001
18
18
  subject_identifiers = []
19
19
  if queryset.count() != modeladmin.model.objects.count():
20
20
  subject_identifiers = [o.subject_identifier for o in queryset]
@@ -8,7 +8,6 @@ from .view_definition import get_view_definition
8
8
 
9
9
 
10
10
  class ImpSubstitutions(QaReportModelMixin, DBView):
11
-
12
11
  original_id = models.UUIDField(null=True)
13
12
 
14
13
  sid = models.IntegerField(verbose_name="Original SID", null=True)
@@ -9,7 +9,6 @@ from .view_definition import get_view_definition
9
9
 
10
10
 
11
11
  class OnStudyMissingLabValues(OnStudyMissingValuesModelMixin, QaReportModelMixin, DBView):
12
-
13
12
  view_definition = get_view_definition()
14
13
 
15
14
  class Meta:
@@ -9,7 +9,6 @@ from .view_definition import get_view_definition
9
9
 
10
10
 
11
11
  class OnStudyMissingValues(OnStudyMissingValuesModelMixin, QaReportModelMixin, DBView):
12
-
13
12
  view_definition = get_view_definition()
14
13
 
15
14
  class Meta:
@@ -6,7 +6,6 @@ from .view_definition import get_view_definition
6
6
 
7
7
 
8
8
  class PatientHistoryMissingBaselineCd4(QaReportModelMixin, DBView):
9
-
10
9
  visit_code = models.CharField(max_length=25)
11
10
 
12
11
  visit_code_sequence = models.IntegerField()
@@ -6,7 +6,6 @@ from .view_definition import get_view_definition
6
6
 
7
7
 
8
8
  class UnattendedThreeInRow(QaReportModelMixin, DBView):
9
-
10
9
  appt_datetime = models.DateTimeField()
11
10
 
12
11
  first_value = models.CharField(verbose_name="First", max_length=25)
@@ -6,7 +6,6 @@ from .view_definition import get_view_definition
6
6
 
7
7
 
8
8
  class UnattendedThreeInRow2(QaReportModelMixin, DBView):
9
-
10
9
  first_value = models.CharField(verbose_name="First", max_length=25)
11
10
 
12
11
  second_value = models.CharField(verbose_name="Second", max_length=25)
@@ -6,7 +6,6 @@ from .view_definition import get_view_definition
6
6
 
7
7
 
8
8
  class UnattendedTwoInRow(QaReportModelMixin, DBView):
9
-
10
9
  appt_datetime = models.DateTimeField()
11
10
 
12
11
  first_value = models.CharField(verbose_name="First", max_length=25)
@@ -1,4 +1,3 @@
1
-
2
1
  from django.utils.safestring import mark_safe
3
2
 
4
3
  from ..forms import (
@@ -1,4 +1,3 @@
1
-
2
1
  from django.contrib import admin
3
2
  from django_audit_fields.admin import audit_fieldset_tuple
4
3
  from edc_sites.admin import SiteModelAdminMixin
@@ -1,4 +1,3 @@
1
-
2
1
  part_one_fields: tuple[str, ...] = (
3
2
  "report_datetime",
4
3
  "screening_consent",
@@ -66,7 +66,7 @@ class BirthOutcomesAdmin(
66
66
  return tuple(set(fields + custom_fields))
67
67
 
68
68
  @admin.display
69
- def delivery_report(self, obj=None, label=None):
69
+ def delivery_report(self, obj=None, label=None): # noqa: ARG002
70
70
  url = reverse("meta_subject_admin:meta_subject_delivery_changelist")
71
71
  url = f"{url}?q={obj.subject_identifier}"
72
72
  context = dict(title="Delivery", url=url, label="Delivery")
@@ -90,5 +90,7 @@ class BirthOutcomesAdmin(
90
90
  if callable(super().view_on_site):
91
91
  url = super().view_on_site(obj)
92
92
  else:
93
- raise NoReverseMatch(f"{e}. See subject_dashboard_url_name for {self!r}.")
93
+ raise NoReverseMatch(
94
+ f"{e}. See subject_dashboard_url_name for {self!r}."
95
+ ) from e
94
96
  return url
@@ -1,12 +1,12 @@
1
- def get_blood_pressure_fields():
2
- return [
1
+ def get_blood_pressure_fields() -> tuple[str, ...]:
2
+ return (
3
3
  "sys_blood_pressure_one",
4
4
  "dia_blood_pressure_one",
5
5
  "sys_blood_pressure_two",
6
6
  "dia_blood_pressure_two",
7
7
  "severe_htn",
8
- ]
8
+ )
9
9
 
10
10
 
11
- def get_respiratory_o2_fields():
12
- return ["respiratory_rate"]
11
+ def get_respiratory_o2_fields() -> tuple[str, ...]:
12
+ return ("respiratory_rate",)
@@ -1,5 +1,5 @@
1
1
  def get_htn_fieldset(part=None):
2
- fields = [
2
+ fields = (
3
3
  "htn_diagnosis",
4
4
  "on_htn_treatment",
5
5
  "htn_treatment",
@@ -9,11 +9,11 @@ def get_htn_fieldset(part=None):
9
9
  "dyslipidaemia_rx",
10
10
  "concomitant_conditions",
11
11
  "concomitant_medications",
12
- ]
12
+ )
13
13
 
14
14
  return (
15
15
  f"Part {part}: Hypertension",
16
- {"fields": tuple(fields)},
16
+ {"fields": fields},
17
17
  )
18
18
 
19
19
 
@@ -22,7 +22,7 @@ def get_hiv_fieldset(part=None):
22
22
  if part:
23
23
  title = f"Part {part}: {title}"
24
24
  # TODO: previous_arv_regimen_start_date is PHASE 3 only
25
- fields = [
25
+ fields = (
26
26
  "hiv_diagnosis_date",
27
27
  "arv_initiation_date",
28
28
  "viral_load",
@@ -39,7 +39,7 @@ def get_hiv_fieldset(part=None):
39
39
  "on_oi_prophylaxis",
40
40
  "oi_prophylaxis",
41
41
  "other_oi_prophylaxis",
42
- ]
42
+ )
43
43
  return (
44
44
  title,
45
45
  {"fields": fields},
@@ -84,13 +84,11 @@ class GlucoseAdmin(CrfModelAdminMixin, SimpleHistoryAdmin):
84
84
  list_display = list(list_display)
85
85
  list_display.insert(3, "ogtt_value")
86
86
  list_display.insert(3, "fbg_value")
87
- list_display = tuple(list_display)
88
- return list_display
87
+ return tuple(list_display)
89
88
 
90
89
  def get_list_filter(self, request) -> tuple[str | type[SimpleListFilter], ...]:
91
90
  list_filter = super().get_list_filter(request)
92
91
  list_filter = list(list_filter)
93
92
  list_filter.insert(2, OgttListFilter)
94
93
  list_filter.insert(2, FbgListFilter)
95
- list_filter = tuple(list_filter)
96
- return list_filter
94
+ return tuple(list_filter)
@@ -17,7 +17,7 @@ from .modeladmin import CrfModelAdminMixin
17
17
  class GlucoseFbgAdmin(CrfModelAdminMixin, SimpleHistoryAdmin):
18
18
  form = GlucoseFbgForm
19
19
 
20
- fieldsets = [
20
+ fieldsets = (
21
21
  (None, {"fields": ("subject_visit", "report_datetime")}),
22
22
  (
23
23
  "Fasting",
@@ -52,9 +52,9 @@ class GlucoseFbgAdmin(CrfModelAdminMixin, SimpleHistoryAdmin):
52
52
  ),
53
53
  crf_status_fieldset,
54
54
  audit_fieldset_tuple,
55
- ]
55
+ )
56
56
 
57
- radio_fields = {
57
+ radio_fields = { # noqa: RUF012
58
58
  "fasting": admin.VERTICAL,
59
59
  "fbg_units": admin.VERTICAL,
60
60
  "fbg_performed": admin.VERTICAL,
@@ -69,12 +69,10 @@ class GlucoseFbgAdmin(CrfModelAdminMixin, SimpleHistoryAdmin):
69
69
  list_display = list(list_display)
70
70
  # list_display.insert(3, "ogtt")
71
71
  list_display.insert(3, "fbg")
72
- list_display = tuple(list_display)
73
- return list_display
72
+ return tuple(list_display)
74
73
 
75
74
  def get_list_filter(self, request) -> tuple[str | type[SimpleListFilter], ...]:
76
75
  list_filter = super().get_list_filter(request)
77
76
  list_filter = list(list_filter)
78
77
  list_filter.insert(2, GlucoseListFilter)
79
- list_filter = tuple(list_filter)
80
- return list_filter
78
+ return tuple(list_filter)
@@ -13,14 +13,14 @@ class GlucoseListFilter(SimpleListFilter):
13
13
  parameter_name = "glucose_value"
14
14
  model_cls = GlucoseFbg
15
15
 
16
- def lookups(self, request, model_admin):
16
+ def lookups(self, request, model_admin): # noqa: ARG002
17
17
  return (
18
18
  (NORMAL, "Normal"),
19
19
  (HIGH, "High"),
20
20
  (VERY_HIGH, "Very high"),
21
21
  )
22
22
 
23
- def queryset(self, request, queryset):
23
+ def queryset(self, request, queryset): # noqa: ARG002
24
24
  qs = None
25
25
  if self.value():
26
26
  if self.value() == NORMAL:
@@ -52,7 +52,7 @@ class OgttListFilter(SimpleListFilter):
52
52
  (HIGH, "High"),
53
53
  )
54
54
 
55
- def queryset(self, request, queryset):
55
+ def queryset(self, request, queryset): # noqa: ARG002
56
56
  qs = None
57
57
  if self.value():
58
58
  if self.value() == NORMAL:
@@ -16,5 +16,4 @@ __all__ = ["NextAppointmentAdmin"]
16
16
  class NextAppointmentAdmin(
17
17
  CrfModelAdminMixin, NextAppointmentCrfModelAdminMixin, SimpleHistoryAdmin
18
18
  ):
19
-
20
19
  form = NextAppointmentForm
@@ -70,11 +70,13 @@ class GlucoseFormValidator(FbgOgttFormValidatorMixin, CrfFormValidator):
70
70
 
71
71
  def is_endpoint(self):
72
72
  value = NO
73
- if (self.cleaned_data.get("fbg_value") >= Decimal("7.0") and self.cleaned_data.get(
74
- "ogtt_value"
75
- ) >= Decimal("11.1")) or (self.cleaned_data.get("fbg_value") < Decimal("7.0") and self.cleaned_data.get(
76
- "ogtt_value"
77
- ) >= Decimal("11.1")):
73
+ if (
74
+ self.cleaned_data.get("fbg_value") >= Decimal("7.0")
75
+ and self.cleaned_data.get("ogtt_value") >= Decimal("11.1")
76
+ ) or (
77
+ self.cleaned_data.get("fbg_value") < Decimal("7.0")
78
+ and self.cleaned_data.get("ogtt_value") >= Decimal("11.1")
79
+ ):
78
80
  value = YES
79
81
  elif self.cleaned_data.get("fbg_value") >= Decimal("7.0") and self.cleaned_data.get(
80
82
  "ogtt_value"
@@ -9,7 +9,7 @@ from ...models import BloodResultsHba1c
9
9
 
10
10
 
11
11
  class BloodResultsHba1cFormValidator(BloodResultsFormValidatorMixin, CrfFormValidator):
12
- panels = [hba1c_poc_panel, hba1c_panel]
12
+ panels = (hba1c_poc_panel, hba1c_panel)
13
13
 
14
14
 
15
15
  class BloodResultsHba1cForm(ActionItemCrfFormMixin, CrfModelFormMixin, forms.ModelForm):
@@ -20,7 +20,7 @@ class SubjectRequisitionForm(RequisitionModelFormMixin, forms.ModelForm):
20
20
  cleaned_data = super().clean()
21
21
  if cleaned_data.get("reason_not_drawn") == NOT_REQUIRED:
22
22
  raise forms.ValidationError(
23
- {"reason_not_drawn": "Invalid choice. Not expected " "for this panel"}
23
+ {"reason_not_drawn": "Invalid choice. Not expected for this panel"}
24
24
  )
25
25
  return cleaned_data
26
26
 
@@ -15,4 +15,3 @@ __all__ = [
15
15
  "BloodResultsLipids",
16
16
  "BloodResultsRft",
17
17
  ]
18
-
@@ -9,7 +9,6 @@ __all__ = ["NextAppointment"]
9
9
 
10
10
 
11
11
  class NextAppointment(NextAppointmentCrfModelMixin, CrfModelMixin, BaseUuidModel):
12
-
13
12
  class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta):
14
13
  verbose_name = "Next Appointment"
15
14
  verbose_name_plural = "Next Appointments"