meta-edc 1.1.0__py3-none-any.whl → 1.1.2__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.
Files changed (30) hide show
  1. meta_analytics/README.rst +1 -2
  2. meta_analytics/dataframes/glucose_endpoints/glucose_endpoints_by_date.py +8 -0
  3. meta_analytics/notebooks/endpoints/meta_endpoints_by_date.ipynb +38 -46
  4. meta_analytics/notebooks/monitoring_report.ipynb +329 -246
  5. meta_analytics/notebooks/qa.ipynb +265 -0
  6. meta_consent/admin/actions/create_missing_prescriptions.py +1 -1
  7. meta_consent/admin/modeladmin_mixins.py +1 -1
  8. meta_consent/management/commands/create_missing_prescriptions.py +1 -1
  9. meta_consent/models/signals.py +1 -1
  10. meta_edc/settings/debug.py +2 -2
  11. {meta_edc-1.1.0.dist-info → meta_edc-1.1.2.dist-info}/METADATA +4 -4
  12. {meta_edc-1.1.0.dist-info → meta_edc-1.1.2.dist-info}/RECORD +30 -29
  13. meta_labs/tests/test_reportables.py +1 -1
  14. meta_prn/admin/offschedule_pregnancy_admin.py +3 -3
  15. meta_prn/admin/onschedule_dm_referral_admin.py +5 -5
  16. meta_prn/form_validators/end_of_study.py +2 -2
  17. meta_reports/admin/last_imp_refill_admin.py +3 -2
  18. meta_reports/models/endpoints.py +3 -0
  19. meta_reports/tasks.py +3 -2
  20. meta_subject/action_items.py +1 -1
  21. meta_subject/form_validators/delivery_form_validator.py +1 -0
  22. meta_subject/forms/delivery_form.py +2 -0
  23. meta_subject/management/commands/create_missing_rx.py +1 -1
  24. meta_subject/migrations/0107_auto_20220415_0043.py +1 -1
  25. meta_subject/models/signals.py +1 -1
  26. meta_subject/tests/tests/test_study_medication.py +1 -2
  27. {meta_edc-1.1.0.dist-info → meta_edc-1.1.2.dist-info}/WHEEL +0 -0
  28. {meta_edc-1.1.0.dist-info → meta_edc-1.1.2.dist-info}/licenses/AUTHORS.rst +0 -0
  29. {meta_edc-1.1.0.dist-info → meta_edc-1.1.2.dist-info}/licenses/LICENSE +0 -0
  30. {meta_edc-1.1.0.dist-info → meta_edc-1.1.2.dist-info}/top_level.txt +0 -0
@@ -25,6 +25,9 @@ class Endpoints(QaReportModelMixin, models.Model):
25
25
 
26
26
  offstudy_reason = models.CharField(max_length=250, null=True)
27
27
 
28
+ def __str__(self):
29
+ return f"{self.subject_identifier} {self.visit_code} {self.endpoint_label}"
30
+
28
31
  class Meta(QaReportModelMixin.Meta):
29
32
  verbose_name = "Endpoints (DM)"
30
33
  verbose_name_plural = "Endpoints (DM)"
meta_reports/tasks.py CHANGED
@@ -6,7 +6,8 @@ def update_endpoints_table(subject_identifiers: list[str] | None = None):
6
6
  from meta_analytics.dataframes import GlucoseEndpointsByDate
7
7
 
8
8
  if len(subject_identifiers) > 5:
9
- subject_identifiers = []
10
- cls = GlucoseEndpointsByDate(subject_identifiers=subject_identifiers)
9
+ cls = GlucoseEndpointsByDate()
10
+ else:
11
+ cls = GlucoseEndpointsByDate(subject_identifiers=subject_identifiers)
11
12
  cls.run()
12
13
  return cls.to_model()
@@ -135,7 +135,7 @@ class DeliveryAction(ActionWithNotification):
135
135
  parent_action_names = [PREGNANCY_NOTIFICATION_ACTION]
136
136
  reference_model = "meta_subject.delivery"
137
137
  show_link_to_changelist = True
138
- show_link_to_add = True
138
+ show_link_to_add = False
139
139
  admin_site_name = "meta_subject_admin"
140
140
  priority = HIGH_PRIORITY
141
141
 
@@ -10,6 +10,7 @@ from meta_prn.models import PregnancyNotification
10
10
 
11
11
 
12
12
  class DeliveryFormValidator(CrfFormValidator):
13
+
13
14
  def clean(self):
14
15
  try:
15
16
  pregnancy_notification = PregnancyNotification.objects.get(
@@ -7,6 +7,8 @@ from ..models import Delivery
7
7
 
8
8
 
9
9
  class DeliveryForm(CrfModelFormMixin, ActionItemCrfFormMixin, forms.ModelForm):
10
+ report_datetime_allowance = 364
11
+
10
12
  form_validator_cls = DeliveryFormValidator
11
13
 
12
14
  class Meta(ActionItemCrfFormMixin.Meta):
@@ -27,7 +27,7 @@ def create_missing_rx():
27
27
  subject_identifier=subject_consent.subject_identifier,
28
28
  report_datetime=subject_consent.consent_datetime,
29
29
  randomizer_name=get_meta_version(),
30
- medications=[METFORMIN],
30
+ medication_names=[METFORMIN],
31
31
  site=subject_consent.site,
32
32
  )
33
33
  except PrescriptionAlreadyExists:
@@ -32,7 +32,7 @@ def func(apps, schema_editor):
32
32
  subject_identifier=subject_consent.subject_identifier,
33
33
  report_datetime=subject_consent.consent_datetime,
34
34
  randomizer_name=get_meta_version(),
35
- medications=[METFORMIN],
35
+ medication_names=[METFORMIN],
36
36
  site_id=site.id,
37
37
  )
38
38
  for obj in apps.get_model("edc_pharmacy.rx")._default_manager.all():
@@ -40,7 +40,7 @@ def study_medication_on_pre_save(sender, instance, raw, **kwargs):
40
40
  subject_identifier=subject_consent.subject_identifier,
41
41
  report_datetime=subject_consent.consent_datetime,
42
42
  randomizer_name=get_meta_version(),
43
- medications=[METFORMIN],
43
+ medication_names=[METFORMIN],
44
44
  site=subject_consent.site,
45
45
  )
46
46
  except PrescriptionAlreadyExists:
@@ -21,13 +21,12 @@ class TestStudyMedication(MetaTestCaseMixin, TestCase):
21
21
  )
22
22
 
23
23
  def test_rx_exists(self):
24
- medication = Medication.objects.get(name=METFORMIN)
25
24
  self.assertRaises(
26
25
  PrescriptionAlreadyExists,
27
26
  create_prescription,
28
27
  subject_identifier=self.registered_subject.subject_identifier,
29
28
  report_datetime=self.registered_subject.registration_datetime,
30
- medications=[medication],
29
+ medication_names=[METFORMIN],
31
30
  site=self.registered_subject.site,
32
31
  )
33
32