meta-edc 0.3.7__py3-none-any.whl → 0.3.15__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. meta_auth/auth_objects.py +10 -3
  2. meta_consent/baker_recipes.py +4 -4
  3. meta_consent/consents.py +1 -1
  4. meta_consent/migrations/0025_alter_historicalsubjectconsent_first_name_and_more.py +151 -0
  5. meta_consent/models/signals.py +16 -13
  6. meta_consent/models/subject_consent_v1.py +1 -3
  7. meta_consent/tests/tests/test_form_validators.py +1 -1
  8. meta_dashboard/templates/meta_dashboard/bootstrap3/screening/listboard.html +4 -4
  9. meta_dashboard/templates/meta_dashboard/bootstrap3/subject/listboard.html +1 -2
  10. meta_edc/settings/debug.py +9 -9
  11. meta_edc/settings/defaults.py +25 -18
  12. meta_edc/settings/live.py +1 -9
  13. meta_edc/settings/uat.py +1 -14
  14. meta_edc/templates/meta_edc/bootstrap3/home.html +8 -5
  15. meta_edc/tests/test_settings.py +176 -0
  16. meta_edc/tests/tests/test_endpoints.py +20 -19
  17. meta_edc/urls.py +1 -1
  18. {meta_edc-0.3.7.dist-info → meta_edc-0.3.15.dist-info}/METADATA +5 -4
  19. {meta_edc-0.3.7.dist-info → meta_edc-0.3.15.dist-info}/RECORD +128 -74
  20. meta_prn/action_items.py +44 -2
  21. meta_prn/admin/__init__.py +3 -0
  22. meta_prn/admin/dm_referral_admin.py +49 -0
  23. meta_prn/admin/offschedule_dm_referral_admin.py +47 -0
  24. meta_prn/admin/onschedule_dm_referral_admin.py +39 -0
  25. meta_prn/baker_recipes.py +8 -1
  26. meta_prn/choices.py +2 -1
  27. meta_prn/constants.py +4 -1
  28. meta_prn/forms/__init__.py +2 -0
  29. meta_prn/forms/dm_referral_form.py +40 -0
  30. meta_prn/forms/offschedule_dm_referral_form.py +35 -0
  31. meta_prn/forms/offschedule_form.py +6 -0
  32. meta_prn/migrations/0057_historicalonscheduledmreferral_and_more.py +1156 -0
  33. meta_prn/migrations/0058_dmreferral_referral_note_and_more.py +29 -0
  34. meta_prn/migrations/0059_alter_historicaloffstudymedication_reason_and_more.py +53 -0
  35. meta_prn/models/__init__.py +13 -2
  36. meta_prn/models/dm_referral.py +39 -0
  37. meta_prn/models/offschedule.py +15 -1
  38. meta_prn/models/onschedule.py +6 -0
  39. meta_prn/models/signals.py +41 -1
  40. meta_prn/tests/tests/test_dm_referral.py +206 -0
  41. meta_screening/form_validators/screening_part_two.py +1 -1
  42. meta_screening/migrations/0062_remove_icpreferral_site_and_more.py +27 -0
  43. meta_screening/migrations/0063_alter_historicalscreeningpartone_fasting_duration_str_and_more.py +184 -0
  44. meta_screening/migrations/0064_remove_historicalscreeningpartone_fasting_duration_minutes_and_more.py +126 -0
  45. meta_screening/migrations/0065_auto_20240516_0352.py +31 -0
  46. meta_screening/migrations/0066_alter_historicalscreeningpartone_fasting_duration_delta_and_more.py +103 -0
  47. meta_screening/models/__init__.py +1 -1
  48. meta_screening/tests/meta_test_case_mixin.py +2 -2
  49. meta_screening/tests/options.py +3 -3
  50. meta_sites/__init__.py +0 -1
  51. meta_sites/sites.py +8 -7
  52. meta_subject/action_items.py +23 -0
  53. meta_subject/admin/__init__.py +1 -1
  54. meta_subject/admin/birth_outcome_admin.py +2 -3
  55. meta_subject/admin/delivery_admin.py +0 -1
  56. meta_subject/admin/diabetes/__init__.py +2 -0
  57. meta_subject/admin/diabetes/dm_diagnosis_admin.py +89 -0
  58. meta_subject/admin/{dm_referral_followup_admin.py → diabetes/dm_followup_admin.py} +15 -8
  59. meta_subject/admin/glucose_admin.py +1 -1
  60. meta_subject/admin/glucose_fbg_admin.py +34 -8
  61. meta_subject/admin/subject_visit_admin.py +4 -1
  62. meta_subject/baker_recipes.py +6 -0
  63. meta_subject/choices.py +8 -0
  64. meta_subject/constants.py +2 -1
  65. meta_subject/form_validators/__init__.py +2 -1
  66. meta_subject/form_validators/dm_diagnosis_form_validator.py +38 -0
  67. meta_subject/form_validators/dm_dx_result_form_validator.py +7 -0
  68. meta_subject/form_validators/{dm_referral_followup_form_validator.py → dm_followup_form_validator.py} +41 -2
  69. meta_subject/forms/__init__.py +1 -0
  70. meta_subject/forms/diabetes/__init__.py +3 -0
  71. meta_subject/forms/diabetes/dm_diagnosis_form.py +13 -0
  72. meta_subject/forms/diabetes/dm_dx_result_form.py +11 -0
  73. meta_subject/forms/diabetes/dm_followup_form.py +25 -0
  74. meta_subject/forms/glucose_fbg_form.py +38 -16
  75. meta_subject/forms/subject_visit_form.py +16 -0
  76. meta_subject/metadata_rules/metadata_rules.py +14 -0
  77. meta_subject/metadata_rules/predicates.py +22 -0
  78. meta_subject/migrations/0181_dmreferralfollowup_action_identifier_and_more.py +143 -0
  79. meta_subject/migrations/0182_rename_dmreferralfollowup_dmfollowup_and_more.py +54 -0
  80. meta_subject/migrations/0183_alter_dmfollowup_on_dm_medications_and_more.py +31 -0
  81. meta_subject/migrations/0184_alter_glucose_options_and_more.py +31 -0
  82. meta_subject/migrations/0185_alter_bloodresultsins_fasting_duration_str_and_more.py +82 -0
  83. meta_subject/migrations/0186_healtheconomicsupdate_singleton_field_and_more.py +55 -0
  84. meta_subject/migrations/0187_dmdiagnosis_historicaldmdiagnosis_dmdxresult_and_more.py +451 -0
  85. meta_subject/migrations/0188_historicaldmdxresult_dmdxresult.py +403 -0
  86. meta_subject/migrations/0189_alter_dmdxresult_options_and_more.py +116 -0
  87. meta_subject/migrations/0190_dmdiagnosis_dx_no_tmg_reason_and_more.py +65 -0
  88. meta_subject/migrations/0191_alter_dmdiagnosis_dx_no_tmg_reason_and_more.py +70 -0
  89. meta_subject/migrations/0192_rename_glucose_quantifier_glucosefbg_fbg_quantifier_and_more.py +44 -0
  90. meta_subject/migrations/0193_alter_glucosefbg_fbg_value_and_more.py +44 -0
  91. meta_subject/migrations/0194_remove_glucosefbg_assay_datetime_and_more.py +166 -0
  92. meta_subject/migrations/0195_alter_glucosefbg_fbg_datetime_and_more.py +27 -0
  93. meta_subject/migrations/0196_glucosefbg_fbg_not_performed_reason_and_more.py +49 -0
  94. meta_subject/migrations/0197_glucosefbg_fasting_duration_estimated_and_more.py +33 -0
  95. meta_subject/migrations/0198_alter_glucosefbg_fasting_duration_estimated_and_more.py +33 -0
  96. meta_subject/migrations/0199_auto_20240516_0247.py +18 -0
  97. meta_subject/migrations/0200_rename_fasting_duration_minutes_bloodresultsins_fasting_duration_delta_and_more.py +43 -0
  98. meta_subject/migrations/0201_alter_bloodresultsins_fasting_duration_delta_and_more.py +58 -0
  99. meta_subject/migrations/0202_auto_20240516_0315.py +32 -0
  100. meta_subject/migrations/0203_alter_bloodresultsins_fasting_duration_delta_and_more.py +67 -0
  101. meta_subject/migrations/0204_glucosefbg_repeat_fbg_date_and_more.py +27 -0
  102. meta_subject/migrations/0205_historicalsubjectrequisition_crf_status_and_more.py +80 -0
  103. meta_subject/migrations/0206_bloodresultsfbc_crf_status_and_more.py +62 -0
  104. meta_subject/models/__init__.py +1 -1
  105. meta_subject/models/blood_results/blood_results_fbc.py +3 -2
  106. meta_subject/models/blood_results/blood_results_hba1c.py +2 -0
  107. meta_subject/models/blood_results/blood_results_ins.py +2 -0
  108. meta_subject/models/blood_results/blood_results_lft.py +2 -0
  109. meta_subject/models/blood_results/blood_results_lipid.py +2 -0
  110. meta_subject/models/blood_results/blood_results_rft.py +2 -0
  111. meta_subject/models/diabetes/__init__.py +3 -0
  112. meta_subject/models/diabetes/dm_diagnosis.py +50 -0
  113. meta_subject/models/diabetes/dm_dx_result.py +70 -0
  114. meta_subject/models/{dm_referral_followup.py → diabetes/dm_followup.py} +18 -6
  115. meta_subject/models/glucose.py +5 -15
  116. meta_subject/models/glucose_fbg.py +40 -51
  117. meta_subject/models/health_economics/health_economics_update.py +2 -0
  118. meta_subject/models/subject_requisition.py +3 -4
  119. meta_subject/tests/tests/test_egfr.py +6 -5
  120. meta_subject/tests/tests/test_metadata_rules.py +32 -2
  121. meta_visit_schedule/constants.py +3 -1
  122. meta_visit_schedule/visit_schedules/phase_three/crfs.py +12 -1
  123. meta_visit_schedule/visit_schedules/phase_three/schedule_dm_referral.py +60 -0
  124. meta_visit_schedule/visit_schedules/phase_three/visit_schedule.py +2 -0
  125. meta_subject/forms/dm_referral_followup.py +0 -18
  126. {meta_edc-0.3.7.dist-info → meta_edc-0.3.15.dist-info}/AUTHORS +0 -0
  127. {meta_edc-0.3.7.dist-info → meta_edc-0.3.15.dist-info}/LICENSE +0 -0
  128. {meta_edc-0.3.7.dist-info → meta_edc-0.3.15.dist-info}/WHEEL +0 -0
  129. {meta_edc-0.3.7.dist-info → meta_edc-0.3.15.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  from dateutil.relativedelta import relativedelta
2
- from django.test import TestCase
2
+ from django.test import TestCase, tag
3
3
  from edc_appointment.models import Appointment
4
4
  from edc_constants.constants import FEMALE, MALE, YES
5
5
  from edc_utils import get_utcnow
@@ -10,7 +10,7 @@ from meta_consent.models import SubjectConsent
10
10
  from meta_screening.models import SubjectScreening
11
11
  from meta_screening.tests.meta_test_case_mixin import MetaTestCaseMixin
12
12
  from meta_subject.forms import FollowupExaminationForm
13
- from meta_visit_schedule.constants import DELIVERY, SCHEDULE_PREGNANCY
13
+ from meta_visit_schedule.constants import DELIVERY, MONTH3, SCHEDULE_PREGNANCY
14
14
 
15
15
 
16
16
  class TestMetadataRules(MetaTestCaseMixin, TestCase):
@@ -103,3 +103,33 @@ class TestMetadataRules(MetaTestCaseMixin, TestCase):
103
103
  ["meta_subject.delivery"],
104
104
  [obj.model for obj in self.get_crf_metadata(subject_visit)],
105
105
  )
106
+
107
+ @tag("4")
108
+ def test_health_economics_update_required(self):
109
+ """Assert healtheconomicsupdate is required starting w/1030"""
110
+ self.subject_visit = self.get_subject_visit(gender=FEMALE)
111
+ subject_visit = self.get_next_subject_visit(self.subject_visit)
112
+ subject_visit = self.get_next_subject_visit(subject_visit)
113
+ subject_visit = self.get_next_subject_visit(subject_visit)
114
+ self.assertEqual(subject_visit.visit_code, MONTH3)
115
+ self.assertIn(
116
+ "meta_subject.healtheconomicsupdate",
117
+ [obj.model for obj in self.get_crf_metadata(subject_visit)],
118
+ )
119
+
120
+ subject_visit = self.get_next_subject_visit(subject_visit)
121
+ self.assertIn(
122
+ "meta_subject.healtheconomicsupdate",
123
+ [obj.model for obj in self.get_crf_metadata(subject_visit)],
124
+ )
125
+ make_recipe(
126
+ "meta_subject.healtheconomicsupdate",
127
+ subject_visit=subject_visit,
128
+ report_datetime=subject_visit.report_datetime,
129
+ )
130
+
131
+ subject_visit = self.get_next_subject_visit(subject_visit)
132
+ self.assertNotIn(
133
+ "meta_subject.healtheconomicsupdate",
134
+ [obj.model for obj in self.get_crf_metadata(subject_visit)],
135
+ )
@@ -1,5 +1,7 @@
1
1
  DAY1 = "1000"
2
2
  DELIVERY = "2000"
3
+ DM_BASELINE = "3000"
4
+ DM_FOLLOWUP = "3060"
3
5
  MONTH1 = "1010"
4
6
  MONTH12 = "1120"
5
7
  MONTH15 = "1150"
@@ -13,8 +15,8 @@ MONTH33 = "1330"
13
15
  MONTH36 = "1360"
14
16
  MONTH6 = "1060"
15
17
  MONTH9 = "1090"
16
- POSTNATAL = "3000"
17
18
  SCHEDULE = "schedule"
19
+ SCHEDULE_DM_REFERRAL = "schedule_dm_referral"
18
20
  SCHEDULE_POSTNATAL = "schedule_postnatal"
19
21
  SCHEDULE_PREGNANCY = "schedule_pregnancy"
20
22
  VISIT_SCHEDULE = "visit_schedule"
@@ -15,7 +15,6 @@ crfs_prn = CrfCollection(
15
15
  Crf(show_order=385, model="meta_subject.urinepregnancy"),
16
16
  Crf(show_order=505, model="meta_subject.pregnancyupdate"),
17
17
  Crf(show_order=515, model="meta_subject.egfrdropnotification"),
18
- Crf(show_order=615, model="meta_subject.dmreferralfollowup"),
19
18
  name="prn",
20
19
  )
21
20
 
@@ -87,6 +86,7 @@ crfs_3m = CrfCollection(
87
86
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
88
87
  Crf(show_order=465, model="meta_subject.sf12", required=False),
89
88
  Crf(show_order=470, model="meta_subject.mnsi", required=False),
89
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate"),
90
90
  name="3m",
91
91
  )
92
92
 
@@ -103,6 +103,7 @@ crfs_6m = CrfCollection(
103
103
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
104
104
  Crf(show_order=465, model="meta_subject.sf12", required=False),
105
105
  Crf(show_order=470, model="meta_subject.mnsi", required=False),
106
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
106
107
  name="6m",
107
108
  )
108
109
 
@@ -115,6 +116,7 @@ crfs_9m = CrfCollection(
115
116
  Crf(show_order=310, model="meta_subject.medicationadherence"),
116
117
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
117
118
  Crf(show_order=465, model="meta_subject.sf12", required=False),
119
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
118
120
  name="9m",
119
121
  )
120
122
 
@@ -131,6 +133,7 @@ crfs_12m = CrfCollection(
131
133
  Crf(show_order=310, model="meta_subject.medicationadherence"),
132
134
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
133
135
  Crf(show_order=465, model="meta_subject.sf12", required=False),
136
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
134
137
  name="12m",
135
138
  )
136
139
 
@@ -143,6 +146,7 @@ crfs_15m = CrfCollection(
143
146
  Crf(show_order=310, model="meta_subject.medicationadherence"),
144
147
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
145
148
  Crf(show_order=465, model="meta_subject.sf12", required=False),
149
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
146
150
  name="15m",
147
151
  )
148
152
 
@@ -156,6 +160,7 @@ crfs_18m = CrfCollection(
156
160
  Crf(show_order=310, model="meta_subject.medicationadherence"),
157
161
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
158
162
  Crf(show_order=465, model="meta_subject.sf12", required=False),
163
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
159
164
  name="18m",
160
165
  )
161
166
 
@@ -168,6 +173,7 @@ crfs_21m = CrfCollection(
168
173
  Crf(show_order=310, model="meta_subject.medicationadherence"),
169
174
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
170
175
  Crf(show_order=465, model="meta_subject.sf12", required=False),
176
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
171
177
  name="21m",
172
178
  )
173
179
 
@@ -184,6 +190,7 @@ crfs_24m = CrfCollection(
184
190
  Crf(show_order=310, model="meta_subject.medicationadherence"),
185
191
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
186
192
  Crf(show_order=465, model="meta_subject.sf12", required=False),
193
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
187
194
  name="24m",
188
195
  )
189
196
 
@@ -196,6 +203,7 @@ crfs_27m = CrfCollection(
196
203
  Crf(show_order=310, model="meta_subject.medicationadherence"),
197
204
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
198
205
  Crf(show_order=465, model="meta_subject.sf12", required=False),
206
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
199
207
  name="27m",
200
208
  )
201
209
 
@@ -211,6 +219,7 @@ crfs_30m = CrfCollection(
211
219
  Crf(show_order=310, model="meta_subject.medicationadherence"),
212
220
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
213
221
  Crf(show_order=465, model="meta_subject.sf12", required=False),
222
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
214
223
  name="30m",
215
224
  )
216
225
 
@@ -223,6 +232,7 @@ crfs_33m = CrfCollection(
223
232
  Crf(show_order=310, model="meta_subject.medicationadherence"),
224
233
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
225
234
  Crf(show_order=465, model="meta_subject.sf12", required=False),
235
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
226
236
  name="33m",
227
237
  )
228
238
 
@@ -239,5 +249,6 @@ crfs_36m = CrfCollection(
239
249
  Crf(show_order=310, model="meta_subject.medicationadherence"),
240
250
  Crf(show_order=460, model="meta_subject.eq5d3l", required=False),
241
251
  Crf(show_order=465, model="meta_subject.sf12", required=False),
252
+ Crf(show_order=500, model="meta_subject.healtheconomicsupdate", required=False),
242
253
  name="36m",
243
254
  )
@@ -0,0 +1,60 @@
1
+ from dateutil.relativedelta import relativedelta
2
+ from edc_facility.constants import FIVE_DAY_CLINIC
3
+ from edc_visit_schedule.schedule import Schedule
4
+ from edc_visit_schedule.visit import Crf, CrfCollection, Visit
5
+
6
+ from meta_consent.consents import consent_v1
7
+
8
+ from ...constants import DM_BASELINE, DM_FOLLOWUP, SCHEDULE_DM_REFERRAL
9
+ from .crfs import crfs_missed
10
+ from .crfs import crfs_prn
11
+ from .crfs import crfs_prn as default_crfs_prn
12
+
13
+ crfs_baseline = CrfCollection(
14
+ Crf(show_order=100, model="meta_subject.dmdiagnosis"),
15
+ name="dmbaseline",
16
+ )
17
+ crfs_6m = CrfCollection(
18
+ Crf(show_order=100, model="meta_subject.dmfollowup"),
19
+ name="dmfollowup",
20
+ )
21
+
22
+ schedule = Schedule(
23
+ name=SCHEDULE_DM_REFERRAL,
24
+ verbose_name="Diabetes Referral and Follow-up",
25
+ onschedule_model="meta_prn.onscheduledmreferral",
26
+ offschedule_model="meta_prn.offscheduledmreferral",
27
+ consent_definitions=[consent_v1],
28
+ appointment_model="edc_appointment.appointment",
29
+ base_timepoint=300,
30
+ )
31
+
32
+
33
+ visit_3000 = Visit(
34
+ code=DM_BASELINE,
35
+ title="Diabetes post-referral baseline",
36
+ timepoint=300,
37
+ rbase=relativedelta(days=0),
38
+ rlower=relativedelta(days=0),
39
+ rupper=relativedelta(months=0),
40
+ crfs=crfs_baseline,
41
+ crfs_prn=crfs_prn or default_crfs_prn,
42
+ crfs_missed=crfs_missed,
43
+ facility_name=FIVE_DAY_CLINIC,
44
+ )
45
+ visit_3060 = Visit(
46
+ code=DM_FOLLOWUP,
47
+ title="Diabetes post-referral follow-up",
48
+ timepoint=360,
49
+ rbase=relativedelta(months=6),
50
+ rlower=relativedelta(months=3),
51
+ rupper=relativedelta(months=12),
52
+ crfs=crfs_6m,
53
+ crfs_prn=crfs_prn or default_crfs_prn,
54
+ crfs_missed=crfs_missed,
55
+ facility_name=FIVE_DAY_CLINIC,
56
+ )
57
+
58
+
59
+ schedule.add_visit(visit=visit_3000)
60
+ schedule.add_visit(visit=visit_3060)
@@ -2,6 +2,7 @@ from edc_visit_schedule.visit_schedule import VisitSchedule
2
2
 
3
3
  from ...constants import VISIT_SCHEDULE
4
4
  from .schedule import schedule
5
+ from .schedule_dm_referral import schedule as schedule_dm_referral
5
6
  from .schedule_pregnancy import schedule as schedule_pregnancy
6
7
 
7
8
  visit_schedule = VisitSchedule(
@@ -15,3 +16,4 @@ visit_schedule = VisitSchedule(
15
16
 
16
17
  visit_schedule.add_schedule(schedule)
17
18
  visit_schedule.add_schedule(schedule_pregnancy)
19
+ visit_schedule.add_schedule(schedule_dm_referral)
@@ -1,18 +0,0 @@
1
- from django import forms
2
- from edc_crf.modelform_mixins import CrfModelFormMixin
3
- from edc_model_fields.widgets import SliderWidget
4
-
5
- from ..form_validators import DmReferralFollowupFormValidator
6
- from ..models import DmReferralFollowup
7
-
8
-
9
- class DmReferralFollowupForm(CrfModelFormMixin, forms.ModelForm):
10
- form_validator_cls = DmReferralFollowupFormValidator
11
-
12
- visual_score_slider = forms.CharField(
13
- label="Visual Score", widget=SliderWidget(attrs={"min": 0, "max": 100})
14
- )
15
-
16
- class Meta:
17
- model = DmReferralFollowup
18
- fields = "__all__"