meta-edc 1.1.13__py3-none-any.whl → 1.1.15__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 (72) hide show
  1. meta_ae/action_items.py +15 -18
  2. meta_ae/templatetags/meta_ae_extras.py +2 -2
  3. meta_analytics/dataframes/get_last_imp_visits_df.py +2 -2
  4. meta_analytics/tables/enrolled/glucose.py +1 -2
  5. meta_consent/models/subject_consent_v1.py +0 -1
  6. meta_dashboard/view_utils/subject_screening_button.py +3 -3
  7. meta_edc/admin.py +1 -1
  8. meta_edc/celery.py +2 -1
  9. meta_edc/celery_live.py +2 -1
  10. meta_edc/celery_uat.py +2 -1
  11. meta_edc/meta_version.py +2 -2
  12. meta_edc/navbars.py +7 -5
  13. meta_edc/settings/defaults.py +3 -3
  14. meta_edc/urls.py +1 -1
  15. meta_edc/utils.py +3 -1
  16. {meta_edc-1.1.13.dist-info → meta_edc-1.1.15.dist-info}/METADATA +10 -11
  17. {meta_edc-1.1.13.dist-info → meta_edc-1.1.15.dist-info}/RECORD +72 -70
  18. meta_pharmacy/admin/substitutions_admin.py +1 -1
  19. meta_pharmacy/forms/rx_form.py +0 -1
  20. meta_pharmacy/management/commands/update_initial_pharmacy_data.py +4 -3
  21. meta_pharmacy/models/rx_label.py +0 -1
  22. meta_prn/action_items.py +23 -31
  23. meta_prn/admin/end_of_study_admin.py +2 -2
  24. meta_prn/admin/offschedule_dm_referral_admin.py +0 -1
  25. meta_prn/admin/offschedule_postnatal_admin.py +0 -1
  26. meta_prn/admin/offschedule_pregnancy_admin.py +0 -1
  27. meta_prn/choices.py +6 -6
  28. meta_prn/form_validators/end_of_study.py +9 -8
  29. meta_prn/forms/dm_referral_form.py +2 -8
  30. meta_prn/forms/end_of_study_form.py +1 -1
  31. meta_prn/forms/off_study_medication_form.py +2 -2
  32. meta_prn/forms/pregnancy_notification_form.py +14 -16
  33. meta_prn/list_data.py +2 -2
  34. meta_prn/migrations/0068_alter_dmreferral_referral_note_and_more.py +235 -0
  35. meta_prn/models/dm_referral.py +2 -2
  36. meta_prn/models/end_of_study.py +7 -7
  37. meta_prn/models/loss_to_followup.py +6 -6
  38. meta_prn/models/off_study_medication.py +3 -2
  39. meta_prn/models/pregnancy_notification.py +3 -3
  40. meta_prn/models/protocol_incident.py +4 -1
  41. meta_prn/models/signals.py +15 -13
  42. meta_prn/models/subject_transfer.py +0 -1
  43. meta_rando/randomizers.py +1 -1
  44. meta_reports/admin/dbviews/imp_substitutions_admin.py +1 -1
  45. meta_reports/admin/dbviews/on_study_missing_values_admin/unmanaged_model_admin.py +0 -1
  46. meta_reports/admin/endpoints_all_admin.py +0 -1
  47. meta_reports/admin/modeladmin_mixins.py +1 -1
  48. meta_reports/migrations/0060_auto_20250926_0242.py +366 -0
  49. meta_reports/models/dbviews/imp_substitutions/unmanaged_model.py +0 -1
  50. meta_reports/models/dbviews/on_study_missing_lab_values/unmanged_model.py +0 -1
  51. meta_reports/models/dbviews/on_study_missing_values/unmanged_model.py +0 -1
  52. meta_reports/models/dbviews/patient_history_missing_baseline_cd4/unmanaged_model.py +0 -1
  53. meta_reports/models/dbviews/unattended_three_in_row/unmanaged_model.py +0 -1
  54. meta_reports/models/dbviews/unattended_three_in_row2/unmanaged_model.py +0 -1
  55. meta_reports/models/dbviews/unattended_two_in_row/unmanaged_model.py +0 -1
  56. meta_screening/admin/fieldsets.py +0 -1
  57. meta_screening/admin/screening_part_one_admin.py +0 -1
  58. meta_screening/forms/field_lists.py +0 -1
  59. meta_subject/admin/birth_outcome_admin.py +4 -2
  60. meta_subject/admin/fields.py +5 -5
  61. meta_subject/admin/fieldsets.py +5 -5
  62. meta_subject/admin/glucose_admin.py +2 -4
  63. meta_subject/admin/glucose_fbg_admin.py +5 -7
  64. meta_subject/admin/list_filters.py +3 -3
  65. meta_subject/admin/next_appointment_admin.py +0 -1
  66. meta_subject/form_validators/glucose_form_validator.py +7 -5
  67. meta_subject/forms/blood_results/blood_results_hba1c_form.py +1 -1
  68. meta_subject/forms/subject_requisition_form.py +1 -1
  69. meta_subject/models/blood_results/__init__.py +0 -1
  70. meta_subject/models/next_appointment.py +0 -1
  71. {meta_edc-1.1.13.dist-info → meta_edc-1.1.15.dist-info}/WHEEL +0 -0
  72. {meta_edc-1.1.13.dist-info → meta_edc-1.1.15.dist-info}/licenses/LICENSE +0 -0
@@ -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"