meta-edc 1.0.3__py3-none-any.whl → 1.0.5__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 (33) hide show
  1. meta_analytics/dataframes/get_eos_df.py +1 -1
  2. meta_analytics/dataframes/get_last_imp_visits_df.py +5 -2
  3. meta_analytics/dataframes/screening/get_screening_df.py +2 -1
  4. meta_edc/settings/debug.py +2 -2
  5. meta_edc/settings/defaults.py +1 -0
  6. {meta_edc-1.0.3.dist-info → meta_edc-1.0.5.dist-info}/METADATA +3 -3
  7. {meta_edc-1.0.3.dist-info → meta_edc-1.0.5.dist-info}/RECORD +33 -22
  8. {meta_edc-1.0.3.dist-info → meta_edc-1.0.5.dist-info}/WHEEL +1 -1
  9. meta_lists/list_data.py +4 -0
  10. meta_lists/migrations/0019_auto_20250128_0143.py +48 -0
  11. meta_pharmacy/admin/rx_admin.py +1 -0
  12. meta_subject/action_items.py +8 -1
  13. meta_subject/admin/__init__.py +1 -0
  14. meta_subject/admin/next_appointment_admin.py +20 -0
  15. meta_subject/forms/__init__.py +1 -0
  16. meta_subject/forms/next_appointment_form.py +37 -0
  17. meta_subject/metadata_rules/metadata_rules.py +14 -0
  18. meta_subject/metadata_rules/predicates.py +29 -3
  19. meta_subject/migrations/0216_historicalnextappointment_nextappointment.py +554 -0
  20. meta_subject/migrations/0217_alter_historicalnextappointment_appt_datetime_and_more.py +42 -0
  21. meta_subject/migrations/0218_alter_historicalnextappointment_appt_date_and_more.py +53 -0
  22. meta_subject/migrations/0219_remove_historicalnextappointment_allow_create_interim_and_more.py +92 -0
  23. meta_subject/migrations/0220_historicalbloodresultsgludummy_bloodresultsgludummy.py +834 -0
  24. meta_subject/models/__init__.py +2 -0
  25. meta_subject/models/blood_results/__init__.py +1 -0
  26. meta_subject/models/blood_results/blood_results_glu.py +29 -0
  27. meta_subject/models/next_appointment.py +16 -0
  28. meta_subject/tests/tests/test_next_appointment.py +231 -0
  29. meta_visit_schedule/visit_schedules/phase_three/crfs.py +20 -1
  30. meta_visit_schedule/visit_schedules/phase_three/schedule_pregnancy.py +1 -1
  31. {meta_edc-1.0.3.dist-info → meta_edc-1.0.5.dist-info}/AUTHORS +0 -0
  32. {meta_edc-1.0.3.dist-info → meta_edc-1.0.5.dist-info}/LICENSE +0 -0
  33. {meta_edc-1.0.3.dist-info → meta_edc-1.0.5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,834 @@
1
+ # Generated by Django 6.0 on 2025-02-27 06:56
2
+
3
+ import _socket
4
+ import django.core.validators
5
+ import django.db.models.deletion
6
+ import django_audit_fields.fields.hostname_modification_field
7
+ import django_audit_fields.fields.userfield
8
+ import django_audit_fields.fields.uuid_auto_field
9
+ import django_audit_fields.models.audit_model_mixin
10
+ import django_revision.revision_field
11
+ import edc_crf.model_mixins.crf_status_model_mixin
12
+ import edc_model.validators.date
13
+ import edc_protocol.validators
14
+ import edc_utils.date
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
+ ("edc_action_item", "0037_remove_actionitem_reference_model_and_more"),
26
+ (
27
+ "meta_subject",
28
+ "0219_remove_historicalnextappointment_allow_create_interim_and_more",
29
+ ),
30
+ ("sites", "0002_alter_domain_unique"),
31
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
32
+ ]
33
+
34
+ operations = [
35
+ migrations.CreateModel(
36
+ name="HistoricalBloodResultsGluDummy",
37
+ fields=[
38
+ (
39
+ "revision",
40
+ django_revision.revision_field.RevisionField(
41
+ blank=True,
42
+ editable=False,
43
+ help_text="System field. Git repository tag:branch:commit.",
44
+ max_length=75,
45
+ null=True,
46
+ verbose_name="Revision",
47
+ ),
48
+ ),
49
+ (
50
+ "created",
51
+ models.DateTimeField(
52
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
53
+ ),
54
+ ),
55
+ (
56
+ "modified",
57
+ models.DateTimeField(
58
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
59
+ ),
60
+ ),
61
+ (
62
+ "user_created",
63
+ django_audit_fields.fields.userfield.UserField(
64
+ blank=True,
65
+ help_text="Updated by admin.save_model",
66
+ max_length=50,
67
+ verbose_name="user created",
68
+ ),
69
+ ),
70
+ (
71
+ "user_modified",
72
+ django_audit_fields.fields.userfield.UserField(
73
+ blank=True,
74
+ help_text="Updated by admin.save_model",
75
+ max_length=50,
76
+ verbose_name="user modified",
77
+ ),
78
+ ),
79
+ (
80
+ "hostname_created",
81
+ models.CharField(
82
+ blank=True,
83
+ default=_socket.gethostname,
84
+ help_text="System field. (modified on create only)",
85
+ max_length=60,
86
+ verbose_name="Hostname created",
87
+ ),
88
+ ),
89
+ (
90
+ "hostname_modified",
91
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
92
+ blank=True,
93
+ help_text="System field. (modified on every save)",
94
+ max_length=50,
95
+ verbose_name="Hostname modified",
96
+ ),
97
+ ),
98
+ (
99
+ "device_created",
100
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
101
+ ),
102
+ (
103
+ "device_modified",
104
+ models.CharField(
105
+ blank=True, max_length=10, verbose_name="Device modified"
106
+ ),
107
+ ),
108
+ (
109
+ "locale_created",
110
+ models.CharField(
111
+ blank=True,
112
+ help_text="Auto-updated by Modeladmin",
113
+ max_length=10,
114
+ null=True,
115
+ verbose_name="Locale created",
116
+ ),
117
+ ),
118
+ (
119
+ "locale_modified",
120
+ models.CharField(
121
+ blank=True,
122
+ help_text="Auto-updated by Modeladmin",
123
+ max_length=10,
124
+ null=True,
125
+ verbose_name="Locale modified",
126
+ ),
127
+ ),
128
+ (
129
+ "id",
130
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
131
+ blank=True,
132
+ db_index=True,
133
+ editable=False,
134
+ help_text="System auto field. UUID primary key.",
135
+ ),
136
+ ),
137
+ (
138
+ "action_identifier",
139
+ models.CharField(blank=True, db_index=True, max_length=50, null=True),
140
+ ),
141
+ (
142
+ "parent_action_identifier",
143
+ models.CharField(
144
+ blank=True,
145
+ help_text="action identifier that links to parent reference model instance.",
146
+ max_length=30,
147
+ null=True,
148
+ ),
149
+ ),
150
+ (
151
+ "related_action_identifier",
152
+ models.CharField(
153
+ blank=True,
154
+ help_text="action identifier that links to related reference model instance.",
155
+ max_length=30,
156
+ null=True,
157
+ ),
158
+ ),
159
+ ("action_item_reason", models.TextField(editable=False, null=True)),
160
+ ("consent_model", models.CharField(blank=True, max_length=50, null=True)),
161
+ ("consent_version", models.CharField(blank=True, max_length=10, null=True)),
162
+ (
163
+ "report_datetime",
164
+ models.DateTimeField(
165
+ default=edc_utils.date.get_utcnow,
166
+ help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
167
+ validators=[
168
+ edc_protocol.validators.datetime_not_before_study_start,
169
+ edc_model.validators.date.datetime_not_future,
170
+ ],
171
+ verbose_name="Report Date",
172
+ ),
173
+ ),
174
+ (
175
+ "assay_datetime",
176
+ models.DateTimeField(
177
+ blank=True,
178
+ null=True,
179
+ validators=[edc_model.validators.date.datetime_not_future],
180
+ verbose_name="Result assay date and time",
181
+ ),
182
+ ),
183
+ (
184
+ "crf_status",
185
+ models.CharField(
186
+ choices=[
187
+ ("INCOMPLETE", "Incomplete (some data pending)"),
188
+ ("COMPLETE", "Complete"),
189
+ ],
190
+ default=edc_crf.model_mixins.crf_status_model_mixin.get_crf_status_default,
191
+ help_text="If some data is still pending, flag this CRF as incomplete",
192
+ max_length=25,
193
+ verbose_name="CRF status",
194
+ ),
195
+ ),
196
+ (
197
+ "crf_status_comments",
198
+ models.TextField(
199
+ blank=True,
200
+ help_text="for example, why some data is still pending",
201
+ null=True,
202
+ verbose_name="Any comments related to status of this CRF",
203
+ ),
204
+ ),
205
+ (
206
+ "results_abnormal",
207
+ models.CharField(
208
+ choices=[("Yes", "Yes"), ("No", "No")],
209
+ help_text="Abnormal results present at baseline or continuing from baseline not included.",
210
+ max_length=25,
211
+ verbose_name="Are any of the above results abnormal?",
212
+ ),
213
+ ),
214
+ (
215
+ "results_reportable",
216
+ models.CharField(
217
+ choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
218
+ help_text="If YES, this value will open Adverse Event Form. Grade 3 and 4 results present at baseline or continuing from baseline not included",
219
+ max_length=25,
220
+ verbose_name="If any results are abnormal, are results within grade 3 or above?",
221
+ ),
222
+ ),
223
+ ("summary", models.TextField(blank=True, null=True)),
224
+ (
225
+ "missing_count",
226
+ models.IntegerField(
227
+ default=0, editable=False, help_text="A count of fields left blank"
228
+ ),
229
+ ),
230
+ (
231
+ "missing",
232
+ models.TextField(
233
+ editable=False,
234
+ help_text="calculated string of field names that have been left blank",
235
+ null=True,
236
+ ),
237
+ ),
238
+ (
239
+ "glucose_value",
240
+ models.DecimalField(
241
+ blank=True,
242
+ decimal_places=2,
243
+ max_digits=8,
244
+ null=True,
245
+ validators=[
246
+ django.core.validators.MinValueValidator(1.0),
247
+ django.core.validators.MaxValueValidator(9999.99),
248
+ ],
249
+ verbose_name="Blood Glucose",
250
+ ),
251
+ ),
252
+ (
253
+ "glucose_units",
254
+ models.CharField(
255
+ blank=True,
256
+ choices=[("mg/dL", "mg/dL"), ("mmol/L", "mmol/L (millimoles/L)")],
257
+ max_length=15,
258
+ null=True,
259
+ verbose_name="units",
260
+ ),
261
+ ),
262
+ (
263
+ "glucose_abnormal",
264
+ models.CharField(
265
+ blank=True,
266
+ choices=[("Yes", "Yes"), ("No", "No")],
267
+ max_length=25,
268
+ null=True,
269
+ verbose_name="abnormal",
270
+ ),
271
+ ),
272
+ (
273
+ "glucose_reportable",
274
+ models.CharField(
275
+ blank=True,
276
+ choices=[
277
+ ("N/A", "Not applicable"),
278
+ ("3", "Yes, grade 3"),
279
+ ("4", "Yes, grade 4"),
280
+ ("No", "Not reportable"),
281
+ ("Already reported", "Already reported"),
282
+ ("present_at_baseline", "Present at baseline"),
283
+ ],
284
+ max_length=25,
285
+ null=True,
286
+ verbose_name="reportable",
287
+ ),
288
+ ),
289
+ (
290
+ "glucose_grade",
291
+ models.IntegerField(
292
+ blank=True,
293
+ choices=[
294
+ (0, "Not graded"),
295
+ (1, "Grade 1"),
296
+ (2, "Grade 2"),
297
+ (3, "Grade 3"),
298
+ (4, "Grade 4"),
299
+ (5, "Grade 5"),
300
+ ],
301
+ null=True,
302
+ verbose_name="Grade",
303
+ ),
304
+ ),
305
+ (
306
+ "glucose_grade_description",
307
+ models.CharField(
308
+ blank=True, max_length=250, null=True, verbose_name="Grade description"
309
+ ),
310
+ ),
311
+ (
312
+ "is_poc",
313
+ models.CharField(
314
+ choices=[("Yes", "Yes"), ("No", "No")],
315
+ max_length=15,
316
+ null=True,
317
+ verbose_name="Was a point-of-care test used?",
318
+ ),
319
+ ),
320
+ (
321
+ "fasting",
322
+ models.CharField(
323
+ choices=[("fasting", "Fasting"), ("non_fasting", "Non-fasting")],
324
+ max_length=25,
325
+ null=True,
326
+ verbose_name="Was this fasting or non-fasting?",
327
+ ),
328
+ ),
329
+ (
330
+ "glucose_quantifier",
331
+ models.CharField(
332
+ choices=[
333
+ ("=", "="),
334
+ (">", ">"),
335
+ (">=", ">="),
336
+ ("<", "<"),
337
+ ("<=", "<="),
338
+ ],
339
+ default="=",
340
+ max_length=10,
341
+ ),
342
+ ),
343
+ (
344
+ "history_id",
345
+ models.UUIDField(
346
+ default=uuid.uuid4, editable=False, primary_key=True, serialize=False
347
+ ),
348
+ ),
349
+ ("history_date", models.DateTimeField(db_index=True)),
350
+ ("history_change_reason", models.CharField(max_length=100, null=True)),
351
+ (
352
+ "history_type",
353
+ models.CharField(
354
+ choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
355
+ max_length=1,
356
+ ),
357
+ ),
358
+ (
359
+ "action_item",
360
+ models.ForeignKey(
361
+ blank=True,
362
+ db_constraint=False,
363
+ null=True,
364
+ on_delete=django.db.models.deletion.DO_NOTHING,
365
+ related_name="+",
366
+ to="edc_action_item.actionitem",
367
+ ),
368
+ ),
369
+ (
370
+ "history_user",
371
+ models.ForeignKey(
372
+ null=True,
373
+ on_delete=django.db.models.deletion.SET_NULL,
374
+ related_name="+",
375
+ to=settings.AUTH_USER_MODEL,
376
+ ),
377
+ ),
378
+ (
379
+ "parent_action_item",
380
+ models.ForeignKey(
381
+ blank=True,
382
+ db_constraint=False,
383
+ null=True,
384
+ on_delete=django.db.models.deletion.DO_NOTHING,
385
+ related_name="+",
386
+ to="edc_action_item.actionitem",
387
+ ),
388
+ ),
389
+ (
390
+ "related_action_item",
391
+ models.ForeignKey(
392
+ blank=True,
393
+ db_constraint=False,
394
+ null=True,
395
+ on_delete=django.db.models.deletion.DO_NOTHING,
396
+ related_name="+",
397
+ to="edc_action_item.actionitem",
398
+ ),
399
+ ),
400
+ (
401
+ "requisition",
402
+ models.ForeignKey(
403
+ blank=True,
404
+ db_constraint=False,
405
+ help_text="Start typing the requisition identifier or select one from this visit",
406
+ limit_choices_to={"panel__name": "blood_glucose"},
407
+ null=True,
408
+ on_delete=django.db.models.deletion.DO_NOTHING,
409
+ related_name="+",
410
+ to="meta_subject.subjectrequisition",
411
+ verbose_name="Requisition",
412
+ ),
413
+ ),
414
+ (
415
+ "site",
416
+ models.ForeignKey(
417
+ blank=True,
418
+ db_constraint=False,
419
+ null=True,
420
+ on_delete=django.db.models.deletion.DO_NOTHING,
421
+ related_name="+",
422
+ to="sites.site",
423
+ ),
424
+ ),
425
+ (
426
+ "subject_visit",
427
+ models.ForeignKey(
428
+ blank=True,
429
+ db_constraint=False,
430
+ null=True,
431
+ on_delete=django.db.models.deletion.DO_NOTHING,
432
+ related_name="+",
433
+ to="meta_subject.subjectvisit",
434
+ ),
435
+ ),
436
+ ],
437
+ options={
438
+ "verbose_name": "historical Blood Result: Glucose (DUMMY)",
439
+ "verbose_name_plural": "historical Blood Results: Glucose (DUMMY)",
440
+ "ordering": ("-history_date", "-history_id"),
441
+ "get_latest_by": ("history_date", "history_id"),
442
+ },
443
+ bases=(simple_history.models.HistoricalChanges, models.Model),
444
+ ),
445
+ migrations.CreateModel(
446
+ name="BloodResultsGluDummy",
447
+ fields=[
448
+ (
449
+ "revision",
450
+ django_revision.revision_field.RevisionField(
451
+ blank=True,
452
+ editable=False,
453
+ help_text="System field. Git repository tag:branch:commit.",
454
+ max_length=75,
455
+ null=True,
456
+ verbose_name="Revision",
457
+ ),
458
+ ),
459
+ (
460
+ "created",
461
+ models.DateTimeField(
462
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
463
+ ),
464
+ ),
465
+ (
466
+ "modified",
467
+ models.DateTimeField(
468
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
469
+ ),
470
+ ),
471
+ (
472
+ "user_created",
473
+ django_audit_fields.fields.userfield.UserField(
474
+ blank=True,
475
+ help_text="Updated by admin.save_model",
476
+ max_length=50,
477
+ verbose_name="user created",
478
+ ),
479
+ ),
480
+ (
481
+ "user_modified",
482
+ django_audit_fields.fields.userfield.UserField(
483
+ blank=True,
484
+ help_text="Updated by admin.save_model",
485
+ max_length=50,
486
+ verbose_name="user modified",
487
+ ),
488
+ ),
489
+ (
490
+ "hostname_created",
491
+ models.CharField(
492
+ blank=True,
493
+ default=_socket.gethostname,
494
+ help_text="System field. (modified on create only)",
495
+ max_length=60,
496
+ verbose_name="Hostname created",
497
+ ),
498
+ ),
499
+ (
500
+ "hostname_modified",
501
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
502
+ blank=True,
503
+ help_text="System field. (modified on every save)",
504
+ max_length=50,
505
+ verbose_name="Hostname modified",
506
+ ),
507
+ ),
508
+ (
509
+ "device_created",
510
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
511
+ ),
512
+ (
513
+ "device_modified",
514
+ models.CharField(
515
+ blank=True, max_length=10, verbose_name="Device modified"
516
+ ),
517
+ ),
518
+ (
519
+ "locale_created",
520
+ models.CharField(
521
+ blank=True,
522
+ help_text="Auto-updated by Modeladmin",
523
+ max_length=10,
524
+ null=True,
525
+ verbose_name="Locale created",
526
+ ),
527
+ ),
528
+ (
529
+ "locale_modified",
530
+ models.CharField(
531
+ blank=True,
532
+ help_text="Auto-updated by Modeladmin",
533
+ max_length=10,
534
+ null=True,
535
+ verbose_name="Locale modified",
536
+ ),
537
+ ),
538
+ (
539
+ "id",
540
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
541
+ blank=True,
542
+ editable=False,
543
+ help_text="System auto field. UUID primary key.",
544
+ primary_key=True,
545
+ serialize=False,
546
+ ),
547
+ ),
548
+ (
549
+ "action_identifier",
550
+ models.CharField(blank=True, max_length=50, null=True, unique=True),
551
+ ),
552
+ (
553
+ "parent_action_identifier",
554
+ models.CharField(
555
+ blank=True,
556
+ help_text="action identifier that links to parent reference model instance.",
557
+ max_length=30,
558
+ null=True,
559
+ ),
560
+ ),
561
+ (
562
+ "related_action_identifier",
563
+ models.CharField(
564
+ blank=True,
565
+ help_text="action identifier that links to related reference model instance.",
566
+ max_length=30,
567
+ null=True,
568
+ ),
569
+ ),
570
+ ("action_item_reason", models.TextField(editable=False, null=True)),
571
+ ("consent_model", models.CharField(blank=True, max_length=50, null=True)),
572
+ ("consent_version", models.CharField(blank=True, max_length=10, null=True)),
573
+ (
574
+ "report_datetime",
575
+ models.DateTimeField(
576
+ default=edc_utils.date.get_utcnow,
577
+ help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
578
+ validators=[
579
+ edc_protocol.validators.datetime_not_before_study_start,
580
+ edc_model.validators.date.datetime_not_future,
581
+ ],
582
+ verbose_name="Report Date",
583
+ ),
584
+ ),
585
+ (
586
+ "assay_datetime",
587
+ models.DateTimeField(
588
+ blank=True,
589
+ null=True,
590
+ validators=[edc_model.validators.date.datetime_not_future],
591
+ verbose_name="Result assay date and time",
592
+ ),
593
+ ),
594
+ (
595
+ "crf_status",
596
+ models.CharField(
597
+ choices=[
598
+ ("INCOMPLETE", "Incomplete (some data pending)"),
599
+ ("COMPLETE", "Complete"),
600
+ ],
601
+ default=edc_crf.model_mixins.crf_status_model_mixin.get_crf_status_default,
602
+ help_text="If some data is still pending, flag this CRF as incomplete",
603
+ max_length=25,
604
+ verbose_name="CRF status",
605
+ ),
606
+ ),
607
+ (
608
+ "crf_status_comments",
609
+ models.TextField(
610
+ blank=True,
611
+ help_text="for example, why some data is still pending",
612
+ null=True,
613
+ verbose_name="Any comments related to status of this CRF",
614
+ ),
615
+ ),
616
+ (
617
+ "results_abnormal",
618
+ models.CharField(
619
+ choices=[("Yes", "Yes"), ("No", "No")],
620
+ help_text="Abnormal results present at baseline or continuing from baseline not included.",
621
+ max_length=25,
622
+ verbose_name="Are any of the above results abnormal?",
623
+ ),
624
+ ),
625
+ (
626
+ "results_reportable",
627
+ models.CharField(
628
+ choices=[("Yes", "Yes"), ("No", "No"), ("N/A", "Not applicable")],
629
+ help_text="If YES, this value will open Adverse Event Form. Grade 3 and 4 results present at baseline or continuing from baseline not included",
630
+ max_length=25,
631
+ verbose_name="If any results are abnormal, are results within grade 3 or above?",
632
+ ),
633
+ ),
634
+ ("summary", models.TextField(blank=True, null=True)),
635
+ (
636
+ "missing_count",
637
+ models.IntegerField(
638
+ default=0, editable=False, help_text="A count of fields left blank"
639
+ ),
640
+ ),
641
+ (
642
+ "missing",
643
+ models.TextField(
644
+ editable=False,
645
+ help_text="calculated string of field names that have been left blank",
646
+ null=True,
647
+ ),
648
+ ),
649
+ (
650
+ "glucose_value",
651
+ models.DecimalField(
652
+ blank=True,
653
+ decimal_places=2,
654
+ max_digits=8,
655
+ null=True,
656
+ validators=[
657
+ django.core.validators.MinValueValidator(1.0),
658
+ django.core.validators.MaxValueValidator(9999.99),
659
+ ],
660
+ verbose_name="Blood Glucose",
661
+ ),
662
+ ),
663
+ (
664
+ "glucose_units",
665
+ models.CharField(
666
+ blank=True,
667
+ choices=[("mg/dL", "mg/dL"), ("mmol/L", "mmol/L (millimoles/L)")],
668
+ max_length=15,
669
+ null=True,
670
+ verbose_name="units",
671
+ ),
672
+ ),
673
+ (
674
+ "glucose_abnormal",
675
+ models.CharField(
676
+ blank=True,
677
+ choices=[("Yes", "Yes"), ("No", "No")],
678
+ max_length=25,
679
+ null=True,
680
+ verbose_name="abnormal",
681
+ ),
682
+ ),
683
+ (
684
+ "glucose_reportable",
685
+ models.CharField(
686
+ blank=True,
687
+ choices=[
688
+ ("N/A", "Not applicable"),
689
+ ("3", "Yes, grade 3"),
690
+ ("4", "Yes, grade 4"),
691
+ ("No", "Not reportable"),
692
+ ("Already reported", "Already reported"),
693
+ ("present_at_baseline", "Present at baseline"),
694
+ ],
695
+ max_length=25,
696
+ null=True,
697
+ verbose_name="reportable",
698
+ ),
699
+ ),
700
+ (
701
+ "glucose_grade",
702
+ models.IntegerField(
703
+ blank=True,
704
+ choices=[
705
+ (0, "Not graded"),
706
+ (1, "Grade 1"),
707
+ (2, "Grade 2"),
708
+ (3, "Grade 3"),
709
+ (4, "Grade 4"),
710
+ (5, "Grade 5"),
711
+ ],
712
+ null=True,
713
+ verbose_name="Grade",
714
+ ),
715
+ ),
716
+ (
717
+ "glucose_grade_description",
718
+ models.CharField(
719
+ blank=True, max_length=250, null=True, verbose_name="Grade description"
720
+ ),
721
+ ),
722
+ (
723
+ "is_poc",
724
+ models.CharField(
725
+ choices=[("Yes", "Yes"), ("No", "No")],
726
+ max_length=15,
727
+ null=True,
728
+ verbose_name="Was a point-of-care test used?",
729
+ ),
730
+ ),
731
+ (
732
+ "fasting",
733
+ models.CharField(
734
+ choices=[("fasting", "Fasting"), ("non_fasting", "Non-fasting")],
735
+ max_length=25,
736
+ null=True,
737
+ verbose_name="Was this fasting or non-fasting?",
738
+ ),
739
+ ),
740
+ (
741
+ "glucose_quantifier",
742
+ models.CharField(
743
+ choices=[
744
+ ("=", "="),
745
+ (">", ">"),
746
+ (">=", ">="),
747
+ ("<", "<"),
748
+ ("<=", "<="),
749
+ ],
750
+ default="=",
751
+ max_length=10,
752
+ ),
753
+ ),
754
+ (
755
+ "action_item",
756
+ models.ForeignKey(
757
+ blank=True,
758
+ null=True,
759
+ on_delete=django.db.models.deletion.PROTECT,
760
+ to="edc_action_item.actionitem",
761
+ ),
762
+ ),
763
+ (
764
+ "parent_action_item",
765
+ models.ForeignKey(
766
+ blank=True,
767
+ null=True,
768
+ on_delete=django.db.models.deletion.PROTECT,
769
+ related_name="+",
770
+ to="edc_action_item.actionitem",
771
+ ),
772
+ ),
773
+ (
774
+ "related_action_item",
775
+ models.ForeignKey(
776
+ blank=True,
777
+ null=True,
778
+ on_delete=django.db.models.deletion.PROTECT,
779
+ related_name="+",
780
+ to="edc_action_item.actionitem",
781
+ ),
782
+ ),
783
+ (
784
+ "requisition",
785
+ models.ForeignKey(
786
+ blank=True,
787
+ help_text="Start typing the requisition identifier or select one from this visit",
788
+ limit_choices_to={"panel__name": "blood_glucose"},
789
+ null=True,
790
+ on_delete=django.db.models.deletion.PROTECT,
791
+ related_name="+",
792
+ to="meta_subject.subjectrequisition",
793
+ verbose_name="Requisition",
794
+ ),
795
+ ),
796
+ (
797
+ "site",
798
+ models.ForeignKey(
799
+ null=True,
800
+ on_delete=django.db.models.deletion.PROTECT,
801
+ related_name="+",
802
+ to="sites.site",
803
+ ),
804
+ ),
805
+ (
806
+ "subject_visit",
807
+ models.OneToOneField(
808
+ on_delete=django.db.models.deletion.PROTECT,
809
+ to="meta_subject.subjectvisit",
810
+ ),
811
+ ),
812
+ ],
813
+ options={
814
+ "verbose_name": "Blood Result: Glucose (DUMMY)",
815
+ "verbose_name_plural": "Blood Results: Glucose (DUMMY)",
816
+ "abstract": False,
817
+ "default_permissions": ("add", "change", "delete", "view", "export", "import"),
818
+ "default_manager_name": "objects",
819
+ "indexes": [
820
+ models.Index(
821
+ fields=["subject_visit", "site"], name="meta_subjec_subject_deb149_idx"
822
+ ),
823
+ models.Index(
824
+ fields=["subject_visit", "report_datetime"],
825
+ name="meta_subjec_subject_d7610d_idx",
826
+ ),
827
+ ],
828
+ },
829
+ managers=[
830
+ ("objects", edc_visit_tracking.managers.CrfModelManager()),
831
+ ("on_site", edc_visit_tracking.managers.CrfCurrentSiteManager()),
832
+ ],
833
+ ),
834
+ ]