meta-edc 1.2.6__py3-none-any.whl → 1.2.8__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 (40) hide show
  1. meta_analytics/dataframes/constants.py +3 -1
  2. meta_analytics/dataframes/get_glucose_df.py +13 -3
  3. meta_analytics/dataframes/glucose_endpoints/endpoint_by_date.py +27 -5
  4. meta_analytics/dataframes/glucose_endpoints/glucose_endpoints_by_date.py +61 -8
  5. meta_analytics/dataframes/screening/get_screening_df.py +1 -5
  6. meta_consent/migrations/0035_alter_historicalsubjectconsent_consent_definition_name_and_more.py +43 -0
  7. meta_dashboard/navbars.py +2 -6
  8. meta_dashboard/urls.py +5 -5
  9. meta_dashboard/views/screening/listboard_view.py +2 -3
  10. meta_dashboard/views/subject/dashboard/dashboard_view.py +4 -5
  11. meta_dashboard/views/subject/listboard/listboard_view.py +2 -3
  12. meta_edc/settings/debug.py +2 -2
  13. {meta_edc-1.2.6.dist-info → meta_edc-1.2.8.dist-info}/METADATA +5 -5
  14. {meta_edc-1.2.6.dist-info → meta_edc-1.2.8.dist-info}/RECORD +40 -28
  15. {meta_edc-1.2.6.dist-info → meta_edc-1.2.8.dist-info}/WHEEL +1 -1
  16. meta_prn/forms/offschedule_form.py +25 -0
  17. meta_screening/admin/subject_screening_admin.py +4 -3
  18. meta_subject/admin/__init__.py +2 -0
  19. meta_subject/admin/glucose_fbg_admin.py +12 -1
  20. meta_subject/admin/hiv_exit_review_admin.py +55 -0
  21. meta_subject/form_validators/__init__.py +4 -0
  22. meta_subject/form_validators/glucose_fbg_form_validator.py +77 -0
  23. meta_subject/form_validators/glucose_form_validator.py +10 -82
  24. meta_subject/form_validators/hiv_exit_review_form_validator.py +18 -0
  25. meta_subject/form_validators/mixins.py +95 -0
  26. meta_subject/forms/__init__.py +2 -0
  27. meta_subject/forms/glucose_fbg_form.py +1 -46
  28. meta_subject/forms/hiv_exit_review_form.py +13 -0
  29. meta_subject/migrations/0235_glucosefbg_endpoint_today_and_more.py +606 -0
  30. meta_subject/migrations/0236_alter_historicalhivexitreview_other_current_arv_regimen_and_more.py +58 -0
  31. meta_subject/migrations/0237_historicalhivexitreview_singleton_field_and_more.py +68 -0
  32. meta_subject/migrations/0238_historicalhivexitreview_available_and_more.py +88 -0
  33. meta_subject/model_mixins/__init__.py +2 -0
  34. meta_subject/model_mixins/arv_history_model_mixin.py +3 -44
  35. meta_subject/model_mixins/arv_review_model_mixin.py +53 -0
  36. meta_subject/models/__init__.py +2 -0
  37. meta_subject/models/glucose_fbg.py +15 -1
  38. meta_subject/models/hiv_exit_review.py +44 -0
  39. meta_visit_schedule/visit_schedules/phase_three/crfs.py +14 -0
  40. {meta_edc-1.2.6.dist-info → meta_edc-1.2.8.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,606 @@
1
+ # Generated by Django 5.2.7 on 2025-10-09 21:31
2
+
3
+ import _socket
4
+ import django.core.validators
5
+ import django.db.models.deletion
6
+ import django.utils.timezone
7
+ import django_audit_fields.fields.hostname_modification_field
8
+ import django_audit_fields.fields.userfield
9
+ import django_audit_fields.fields.uuid_auto_field
10
+ import django_revision.revision_field
11
+ import edc_crf.model_mixins.crf_status_model_mixin
12
+ import edc_model.models.fields.other_charfield
13
+ import edc_model.validators.date
14
+ import edc_protocol.validators
15
+ import edc_visit_tracking.managers
16
+ import simple_history.models
17
+ import uuid
18
+ from django.conf import settings
19
+ from django.db import migrations, models
20
+
21
+
22
+ class Migration(migrations.Migration):
23
+
24
+ dependencies = [
25
+ (
26
+ "meta_lists",
27
+ "0020_alter_abnormalfootappearanceobservations_extra_value_and_more",
28
+ ),
29
+ ("meta_subject", "0234_remove_spfq_site_remove_spfq_subject_visit_and_more"),
30
+ ("sites", "0002_alter_domain_unique"),
31
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
32
+ ]
33
+
34
+ operations = [
35
+ migrations.AddField(
36
+ model_name="glucosefbg",
37
+ name="endpoint_today",
38
+ field=models.CharField(
39
+ choices=[
40
+ ("Yes", "Yes"),
41
+ ("PENDING", "No. A repeat FBG will be scheduled"),
42
+ ("No", "No"),
43
+ ("N/A", "Not applicable"),
44
+ ],
45
+ default="N/A",
46
+ help_text="Response is applicable if reporting after 24/11/2023 and both the FBG and OGTT were performed",
47
+ max_length=25,
48
+ verbose_name="Has the participant reached a study endpoint today?",
49
+ ),
50
+ ),
51
+ migrations.AddField(
52
+ model_name="historicalglucosefbg",
53
+ name="endpoint_today",
54
+ field=models.CharField(
55
+ choices=[
56
+ ("Yes", "Yes"),
57
+ ("PENDING", "No. A repeat FBG will be scheduled"),
58
+ ("No", "No"),
59
+ ("N/A", "Not applicable"),
60
+ ],
61
+ default="N/A",
62
+ help_text="Response is applicable if reporting after 24/11/2023 and both the FBG and OGTT were performed",
63
+ max_length=25,
64
+ verbose_name="Has the participant reached a study endpoint today?",
65
+ ),
66
+ ),
67
+ migrations.CreateModel(
68
+ name="HistoricalHivExitReview",
69
+ fields=[
70
+ (
71
+ "revision",
72
+ django_revision.revision_field.RevisionField(
73
+ blank=True,
74
+ default="",
75
+ editable=False,
76
+ help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
77
+ max_length=75,
78
+ verbose_name="Revision",
79
+ ),
80
+ ),
81
+ (
82
+ "created",
83
+ models.DateTimeField(blank=True, default=django.utils.timezone.now),
84
+ ),
85
+ (
86
+ "modified",
87
+ models.DateTimeField(blank=True, default=django.utils.timezone.now),
88
+ ),
89
+ (
90
+ "user_created",
91
+ django_audit_fields.fields.userfield.UserField(
92
+ blank=True,
93
+ default="",
94
+ help_text="Updated by admin.save_model",
95
+ max_length=50,
96
+ verbose_name="user created",
97
+ ),
98
+ ),
99
+ (
100
+ "user_modified",
101
+ django_audit_fields.fields.userfield.UserField(
102
+ blank=True,
103
+ default="",
104
+ help_text="Updated by admin.save_model",
105
+ max_length=50,
106
+ verbose_name="user modified",
107
+ ),
108
+ ),
109
+ (
110
+ "hostname_created",
111
+ models.CharField(
112
+ blank=True,
113
+ default=_socket.gethostname,
114
+ help_text="System field. (modified on create only)",
115
+ max_length=60,
116
+ verbose_name="Hostname created",
117
+ ),
118
+ ),
119
+ (
120
+ "hostname_modified",
121
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
122
+ blank=True,
123
+ default="",
124
+ help_text="System field. (modified on every save)",
125
+ max_length=50,
126
+ verbose_name="Hostname modified",
127
+ ),
128
+ ),
129
+ (
130
+ "device_created",
131
+ models.CharField(
132
+ blank=True,
133
+ default="",
134
+ max_length=10,
135
+ verbose_name="Device created",
136
+ ),
137
+ ),
138
+ (
139
+ "device_modified",
140
+ models.CharField(
141
+ blank=True,
142
+ default="",
143
+ max_length=10,
144
+ verbose_name="Device modified",
145
+ ),
146
+ ),
147
+ (
148
+ "locale_created",
149
+ models.CharField(
150
+ blank=True,
151
+ default="",
152
+ help_text="Auto-updated by Modeladmin",
153
+ max_length=10,
154
+ verbose_name="Locale created",
155
+ ),
156
+ ),
157
+ (
158
+ "locale_modified",
159
+ models.CharField(
160
+ blank=True,
161
+ default="",
162
+ help_text="Auto-updated by Modeladmin",
163
+ max_length=10,
164
+ verbose_name="Locale modified",
165
+ ),
166
+ ),
167
+ (
168
+ "id",
169
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
170
+ blank=True,
171
+ db_index=True,
172
+ editable=False,
173
+ help_text="System auto field. UUID primary key.",
174
+ ),
175
+ ),
176
+ (
177
+ "consent_model",
178
+ models.CharField(blank=True, default="", max_length=50),
179
+ ),
180
+ (
181
+ "consent_version",
182
+ models.CharField(blank=True, default="", max_length=10),
183
+ ),
184
+ (
185
+ "report_datetime",
186
+ models.DateTimeField(
187
+ default=django.utils.timezone.now,
188
+ help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
189
+ validators=[
190
+ edc_protocol.validators.datetime_not_before_study_start,
191
+ edc_model.validators.date.datetime_not_future,
192
+ ],
193
+ verbose_name="Report Date",
194
+ ),
195
+ ),
196
+ (
197
+ "crf_status",
198
+ models.CharField(
199
+ choices=[
200
+ ("INCOMPLETE", "Incomplete (some data pending)"),
201
+ ("COMPLETE", "Complete"),
202
+ ],
203
+ default=edc_crf.model_mixins.crf_status_model_mixin.get_crf_status_default,
204
+ help_text="If some data is still pending, flag this CRF as incomplete",
205
+ max_length=25,
206
+ verbose_name="CRF status",
207
+ ),
208
+ ),
209
+ (
210
+ "crf_status_comments",
211
+ models.TextField(
212
+ blank=True,
213
+ default="",
214
+ help_text="for example, why some data is still pending",
215
+ verbose_name="Any comments related to status of this CRF",
216
+ ),
217
+ ),
218
+ (
219
+ "viral_load",
220
+ models.IntegerField(
221
+ blank=True,
222
+ help_text="copies/mL",
223
+ null=True,
224
+ validators=[
225
+ django.core.validators.MinValueValidator(0),
226
+ django.core.validators.MaxValueValidator(999999),
227
+ ],
228
+ verbose_name="Last viral load",
229
+ ),
230
+ ),
231
+ (
232
+ "viral_load_date",
233
+ models.DateField(
234
+ blank=True, null=True, verbose_name="Date of last viral load"
235
+ ),
236
+ ),
237
+ (
238
+ "cd4",
239
+ models.IntegerField(
240
+ blank=True,
241
+ help_text="cells/mm<sup>3</sup>",
242
+ null=True,
243
+ validators=[
244
+ django.core.validators.MinValueValidator(0),
245
+ django.core.validators.MaxValueValidator(3000),
246
+ ],
247
+ verbose_name="Last CD4",
248
+ ),
249
+ ),
250
+ (
251
+ "cd4_date",
252
+ models.DateField(
253
+ blank=True, null=True, verbose_name="Date of last CD4"
254
+ ),
255
+ ),
256
+ (
257
+ "other_current_arv_regimen",
258
+ edc_model.models.fields.other_charfield.OtherCharField(
259
+ blank=True,
260
+ max_length=35,
261
+ null=True,
262
+ verbose_name="If other, please specify ...",
263
+ ),
264
+ ),
265
+ (
266
+ "current_arv_regimen_start_date",
267
+ models.DateField(
268
+ blank=True,
269
+ null=True,
270
+ verbose_name="When did the patient start this current antiretroviral therapy regimen?",
271
+ ),
272
+ ),
273
+ (
274
+ "history_id",
275
+ models.UUIDField(
276
+ default=uuid.uuid4,
277
+ editable=False,
278
+ primary_key=True,
279
+ serialize=False,
280
+ ),
281
+ ),
282
+ ("history_date", models.DateTimeField(db_index=True)),
283
+ ("history_change_reason", models.CharField(max_length=100, null=True)),
284
+ (
285
+ "history_type",
286
+ models.CharField(
287
+ choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
288
+ max_length=1,
289
+ ),
290
+ ),
291
+ (
292
+ "current_arv_regimen",
293
+ models.ForeignKey(
294
+ blank=True,
295
+ db_constraint=False,
296
+ null=True,
297
+ on_delete=django.db.models.deletion.DO_NOTHING,
298
+ related_name="+",
299
+ to="meta_lists.arvregimens",
300
+ verbose_name="Which antiretroviral therapy regimen is the patient currently on?",
301
+ ),
302
+ ),
303
+ (
304
+ "history_user",
305
+ models.ForeignKey(
306
+ null=True,
307
+ on_delete=django.db.models.deletion.SET_NULL,
308
+ related_name="+",
309
+ to=settings.AUTH_USER_MODEL,
310
+ ),
311
+ ),
312
+ (
313
+ "site",
314
+ models.ForeignKey(
315
+ blank=True,
316
+ db_constraint=False,
317
+ null=True,
318
+ on_delete=django.db.models.deletion.DO_NOTHING,
319
+ related_name="+",
320
+ to="sites.site",
321
+ ),
322
+ ),
323
+ (
324
+ "subject_visit",
325
+ models.ForeignKey(
326
+ blank=True,
327
+ db_constraint=False,
328
+ null=True,
329
+ on_delete=django.db.models.deletion.DO_NOTHING,
330
+ related_name="+",
331
+ to="meta_subject.subjectvisit",
332
+ ),
333
+ ),
334
+ ],
335
+ options={
336
+ "verbose_name": "historical HIV Exit Review",
337
+ "verbose_name_plural": "historical HIV Exit Review",
338
+ "ordering": ("-history_date", "-history_id"),
339
+ "get_latest_by": ("history_date", "history_id"),
340
+ },
341
+ bases=(simple_history.models.HistoricalChanges, models.Model),
342
+ ),
343
+ migrations.CreateModel(
344
+ name="HivExitReview",
345
+ fields=[
346
+ (
347
+ "revision",
348
+ django_revision.revision_field.RevisionField(
349
+ blank=True,
350
+ default="",
351
+ editable=False,
352
+ help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
353
+ max_length=75,
354
+ verbose_name="Revision",
355
+ ),
356
+ ),
357
+ (
358
+ "created",
359
+ models.DateTimeField(blank=True, default=django.utils.timezone.now),
360
+ ),
361
+ (
362
+ "modified",
363
+ models.DateTimeField(blank=True, default=django.utils.timezone.now),
364
+ ),
365
+ (
366
+ "user_created",
367
+ django_audit_fields.fields.userfield.UserField(
368
+ blank=True,
369
+ default="",
370
+ help_text="Updated by admin.save_model",
371
+ max_length=50,
372
+ verbose_name="user created",
373
+ ),
374
+ ),
375
+ (
376
+ "user_modified",
377
+ django_audit_fields.fields.userfield.UserField(
378
+ blank=True,
379
+ default="",
380
+ help_text="Updated by admin.save_model",
381
+ max_length=50,
382
+ verbose_name="user modified",
383
+ ),
384
+ ),
385
+ (
386
+ "hostname_created",
387
+ models.CharField(
388
+ blank=True,
389
+ default=_socket.gethostname,
390
+ help_text="System field. (modified on create only)",
391
+ max_length=60,
392
+ verbose_name="Hostname created",
393
+ ),
394
+ ),
395
+ (
396
+ "hostname_modified",
397
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
398
+ blank=True,
399
+ default="",
400
+ help_text="System field. (modified on every save)",
401
+ max_length=50,
402
+ verbose_name="Hostname modified",
403
+ ),
404
+ ),
405
+ (
406
+ "device_created",
407
+ models.CharField(
408
+ blank=True,
409
+ default="",
410
+ max_length=10,
411
+ verbose_name="Device created",
412
+ ),
413
+ ),
414
+ (
415
+ "device_modified",
416
+ models.CharField(
417
+ blank=True,
418
+ default="",
419
+ max_length=10,
420
+ verbose_name="Device modified",
421
+ ),
422
+ ),
423
+ (
424
+ "locale_created",
425
+ models.CharField(
426
+ blank=True,
427
+ default="",
428
+ help_text="Auto-updated by Modeladmin",
429
+ max_length=10,
430
+ verbose_name="Locale created",
431
+ ),
432
+ ),
433
+ (
434
+ "locale_modified",
435
+ models.CharField(
436
+ blank=True,
437
+ default="",
438
+ help_text="Auto-updated by Modeladmin",
439
+ max_length=10,
440
+ verbose_name="Locale modified",
441
+ ),
442
+ ),
443
+ (
444
+ "id",
445
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
446
+ blank=True,
447
+ editable=False,
448
+ help_text="System auto field. UUID primary key.",
449
+ primary_key=True,
450
+ serialize=False,
451
+ ),
452
+ ),
453
+ (
454
+ "consent_model",
455
+ models.CharField(blank=True, default="", max_length=50),
456
+ ),
457
+ (
458
+ "consent_version",
459
+ models.CharField(blank=True, default="", max_length=10),
460
+ ),
461
+ (
462
+ "report_datetime",
463
+ models.DateTimeField(
464
+ default=django.utils.timezone.now,
465
+ help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
466
+ validators=[
467
+ edc_protocol.validators.datetime_not_before_study_start,
468
+ edc_model.validators.date.datetime_not_future,
469
+ ],
470
+ verbose_name="Report Date",
471
+ ),
472
+ ),
473
+ (
474
+ "crf_status",
475
+ models.CharField(
476
+ choices=[
477
+ ("INCOMPLETE", "Incomplete (some data pending)"),
478
+ ("COMPLETE", "Complete"),
479
+ ],
480
+ default=edc_crf.model_mixins.crf_status_model_mixin.get_crf_status_default,
481
+ help_text="If some data is still pending, flag this CRF as incomplete",
482
+ max_length=25,
483
+ verbose_name="CRF status",
484
+ ),
485
+ ),
486
+ (
487
+ "crf_status_comments",
488
+ models.TextField(
489
+ blank=True,
490
+ default="",
491
+ help_text="for example, why some data is still pending",
492
+ verbose_name="Any comments related to status of this CRF",
493
+ ),
494
+ ),
495
+ (
496
+ "viral_load",
497
+ models.IntegerField(
498
+ blank=True,
499
+ help_text="copies/mL",
500
+ null=True,
501
+ validators=[
502
+ django.core.validators.MinValueValidator(0),
503
+ django.core.validators.MaxValueValidator(999999),
504
+ ],
505
+ verbose_name="Last viral load",
506
+ ),
507
+ ),
508
+ (
509
+ "viral_load_date",
510
+ models.DateField(
511
+ blank=True, null=True, verbose_name="Date of last viral load"
512
+ ),
513
+ ),
514
+ (
515
+ "cd4",
516
+ models.IntegerField(
517
+ blank=True,
518
+ help_text="cells/mm<sup>3</sup>",
519
+ null=True,
520
+ validators=[
521
+ django.core.validators.MinValueValidator(0),
522
+ django.core.validators.MaxValueValidator(3000),
523
+ ],
524
+ verbose_name="Last CD4",
525
+ ),
526
+ ),
527
+ (
528
+ "cd4_date",
529
+ models.DateField(
530
+ blank=True, null=True, verbose_name="Date of last CD4"
531
+ ),
532
+ ),
533
+ (
534
+ "other_current_arv_regimen",
535
+ edc_model.models.fields.other_charfield.OtherCharField(
536
+ blank=True,
537
+ max_length=35,
538
+ null=True,
539
+ verbose_name="If other, please specify ...",
540
+ ),
541
+ ),
542
+ (
543
+ "current_arv_regimen_start_date",
544
+ models.DateField(
545
+ blank=True,
546
+ null=True,
547
+ verbose_name="When did the patient start this current antiretroviral therapy regimen?",
548
+ ),
549
+ ),
550
+ (
551
+ "current_arv_regimen",
552
+ models.ForeignKey(
553
+ null=True,
554
+ on_delete=django.db.models.deletion.PROTECT,
555
+ related_name="last_arv_regimen",
556
+ to="meta_lists.arvregimens",
557
+ verbose_name="Which antiretroviral therapy regimen is the patient currently on?",
558
+ ),
559
+ ),
560
+ (
561
+ "site",
562
+ models.ForeignKey(
563
+ null=True,
564
+ on_delete=django.db.models.deletion.PROTECT,
565
+ related_name="+",
566
+ to="sites.site",
567
+ ),
568
+ ),
569
+ (
570
+ "subject_visit",
571
+ models.OneToOneField(
572
+ on_delete=django.db.models.deletion.PROTECT,
573
+ to="meta_subject.subjectvisit",
574
+ ),
575
+ ),
576
+ ],
577
+ options={
578
+ "verbose_name": "HIV Exit Review",
579
+ "verbose_name_plural": "HIV Exit Review",
580
+ "abstract": False,
581
+ "default_permissions": (
582
+ "add",
583
+ "change",
584
+ "delete",
585
+ "view",
586
+ "export",
587
+ "import",
588
+ ),
589
+ "default_manager_name": "objects",
590
+ "indexes": [
591
+ models.Index(
592
+ fields=["subject_visit", "site"],
593
+ name="meta_subjec_subject_d9ce05_idx",
594
+ ),
595
+ models.Index(
596
+ fields=["subject_visit", "report_datetime"],
597
+ name="meta_subjec_subject_ae7af9_idx",
598
+ ),
599
+ ],
600
+ },
601
+ managers=[
602
+ ("objects", edc_visit_tracking.managers.CrfModelManager()),
603
+ ("on_site", edc_visit_tracking.managers.CrfCurrentSiteManager()),
604
+ ],
605
+ ),
606
+ ]
@@ -0,0 +1,58 @@
1
+ # Generated by Django 5.2.7 on 2025-10-14 00:10
2
+
3
+ import edc_model.models.fields.other_charfield
4
+ from django.db import migrations
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [
10
+ ("meta_subject", "0235_glucosefbg_endpoint_today_and_more"),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.AlterField(
15
+ model_name="historicalhivexitreview",
16
+ name="other_current_arv_regimen",
17
+ field=edc_model.models.fields.other_charfield.OtherCharField(
18
+ blank=True,
19
+ default="",
20
+ max_length=35,
21
+ null=True,
22
+ verbose_name="If other, please specify ...",
23
+ ),
24
+ ),
25
+ migrations.AlterField(
26
+ model_name="historicalpatienthistory",
27
+ name="other_current_arv_regimen",
28
+ field=edc_model.models.fields.other_charfield.OtherCharField(
29
+ blank=True,
30
+ default="",
31
+ max_length=35,
32
+ null=True,
33
+ verbose_name="If other, please specify ...",
34
+ ),
35
+ ),
36
+ migrations.AlterField(
37
+ model_name="hivexitreview",
38
+ name="other_current_arv_regimen",
39
+ field=edc_model.models.fields.other_charfield.OtherCharField(
40
+ blank=True,
41
+ default="",
42
+ max_length=35,
43
+ null=True,
44
+ verbose_name="If other, please specify ...",
45
+ ),
46
+ ),
47
+ migrations.AlterField(
48
+ model_name="patienthistory",
49
+ name="other_current_arv_regimen",
50
+ field=edc_model.models.fields.other_charfield.OtherCharField(
51
+ blank=True,
52
+ default="",
53
+ max_length=35,
54
+ null=True,
55
+ verbose_name="If other, please specify ...",
56
+ ),
57
+ ),
58
+ ]