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
@@ -0,0 +1,1156 @@
1
+ # Generated by Django 4.2.11 on 2024-04-04 14:18
2
+
3
+ import _socket
4
+ from django.conf import settings
5
+ from django.db import migrations, models
6
+ import django.db.models.deletion
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_audit_fields.models.audit_model_mixin
11
+ import django_revision.revision_field
12
+ import edc_action_item.managers
13
+ import edc_identifier.managers
14
+ import edc_model.validators.date
15
+ import edc_protocol.validators
16
+ import edc_sites.managers
17
+ import edc_utils.date
18
+ import simple_history.models
19
+ import uuid
20
+
21
+
22
+ class Migration(migrations.Migration):
23
+
24
+ dependencies = [
25
+ ("sites", "0002_alter_domain_unique"),
26
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
27
+ ("edc_action_item", "0037_remove_actionitem_reference_model_and_more"),
28
+ ("meta_prn", "0056_alter_endofstudy_clinical_withdrawal_reason_and_more"),
29
+ ]
30
+
31
+ operations = [
32
+ migrations.CreateModel(
33
+ name="HistoricalOnScheduleDmReferral",
34
+ fields=[
35
+ (
36
+ "revision",
37
+ django_revision.revision_field.RevisionField(
38
+ blank=True,
39
+ editable=False,
40
+ help_text="System field. Git repository tag:branch:commit.",
41
+ max_length=75,
42
+ null=True,
43
+ verbose_name="Revision",
44
+ ),
45
+ ),
46
+ (
47
+ "created",
48
+ models.DateTimeField(
49
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
50
+ ),
51
+ ),
52
+ (
53
+ "modified",
54
+ models.DateTimeField(
55
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
56
+ ),
57
+ ),
58
+ (
59
+ "user_created",
60
+ django_audit_fields.fields.userfield.UserField(
61
+ blank=True,
62
+ help_text="Updated by admin.save_model",
63
+ max_length=50,
64
+ verbose_name="user created",
65
+ ),
66
+ ),
67
+ (
68
+ "user_modified",
69
+ django_audit_fields.fields.userfield.UserField(
70
+ blank=True,
71
+ help_text="Updated by admin.save_model",
72
+ max_length=50,
73
+ verbose_name="user modified",
74
+ ),
75
+ ),
76
+ (
77
+ "hostname_created",
78
+ models.CharField(
79
+ blank=True,
80
+ default=_socket.gethostname,
81
+ help_text="System field. (modified on create only)",
82
+ max_length=60,
83
+ verbose_name="Hostname created",
84
+ ),
85
+ ),
86
+ (
87
+ "hostname_modified",
88
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
89
+ blank=True,
90
+ help_text="System field. (modified on every save)",
91
+ max_length=50,
92
+ verbose_name="Hostname modified",
93
+ ),
94
+ ),
95
+ (
96
+ "device_created",
97
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
98
+ ),
99
+ (
100
+ "device_modified",
101
+ models.CharField(
102
+ blank=True, max_length=10, verbose_name="Device modified"
103
+ ),
104
+ ),
105
+ (
106
+ "locale_created",
107
+ models.CharField(
108
+ blank=True,
109
+ help_text="Auto-updated by Modeladmin",
110
+ max_length=10,
111
+ null=True,
112
+ verbose_name="Locale created",
113
+ ),
114
+ ),
115
+ (
116
+ "locale_modified",
117
+ models.CharField(
118
+ blank=True,
119
+ help_text="Auto-updated by Modeladmin",
120
+ max_length=10,
121
+ null=True,
122
+ verbose_name="Locale modified",
123
+ ),
124
+ ),
125
+ (
126
+ "id",
127
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
128
+ blank=True,
129
+ db_index=True,
130
+ editable=False,
131
+ help_text="System auto field. UUID primary key.",
132
+ ),
133
+ ),
134
+ ("subject_identifier", models.CharField(db_index=True, max_length=50)),
135
+ (
136
+ "onschedule_datetime",
137
+ models.DateTimeField(
138
+ default=edc_utils.date.get_utcnow,
139
+ validators=[
140
+ edc_protocol.validators.datetime_not_before_study_start,
141
+ edc_model.validators.date.datetime_not_future,
142
+ ],
143
+ ),
144
+ ),
145
+ ("report_datetime", models.DateTimeField(editable=False)),
146
+ (
147
+ "history_id",
148
+ models.UUIDField(
149
+ default=uuid.uuid4, editable=False, primary_key=True, serialize=False
150
+ ),
151
+ ),
152
+ ("history_date", models.DateTimeField(db_index=True)),
153
+ ("history_change_reason", models.CharField(max_length=100, null=True)),
154
+ (
155
+ "history_type",
156
+ models.CharField(
157
+ choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
158
+ max_length=1,
159
+ ),
160
+ ),
161
+ (
162
+ "history_user",
163
+ models.ForeignKey(
164
+ null=True,
165
+ on_delete=django.db.models.deletion.SET_NULL,
166
+ related_name="+",
167
+ to=settings.AUTH_USER_MODEL,
168
+ ),
169
+ ),
170
+ (
171
+ "site",
172
+ models.ForeignKey(
173
+ blank=True,
174
+ db_constraint=False,
175
+ null=True,
176
+ on_delete=django.db.models.deletion.DO_NOTHING,
177
+ related_name="+",
178
+ to="sites.site",
179
+ ),
180
+ ),
181
+ ],
182
+ options={
183
+ "verbose_name": "historical On-schedule: DM Referral",
184
+ "verbose_name_plural": "historical On-schedule: DM Referral",
185
+ "ordering": ("-history_date", "-history_id"),
186
+ "get_latest_by": ("history_date", "history_id"),
187
+ },
188
+ bases=(simple_history.models.HistoricalChanges, models.Model),
189
+ ),
190
+ migrations.CreateModel(
191
+ name="HistoricalOffScheduleDmReferral",
192
+ fields=[
193
+ (
194
+ "revision",
195
+ django_revision.revision_field.RevisionField(
196
+ blank=True,
197
+ editable=False,
198
+ help_text="System field. Git repository tag:branch:commit.",
199
+ max_length=75,
200
+ null=True,
201
+ verbose_name="Revision",
202
+ ),
203
+ ),
204
+ (
205
+ "created",
206
+ models.DateTimeField(
207
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
208
+ ),
209
+ ),
210
+ (
211
+ "modified",
212
+ models.DateTimeField(
213
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
214
+ ),
215
+ ),
216
+ (
217
+ "user_created",
218
+ django_audit_fields.fields.userfield.UserField(
219
+ blank=True,
220
+ help_text="Updated by admin.save_model",
221
+ max_length=50,
222
+ verbose_name="user created",
223
+ ),
224
+ ),
225
+ (
226
+ "user_modified",
227
+ django_audit_fields.fields.userfield.UserField(
228
+ blank=True,
229
+ help_text="Updated by admin.save_model",
230
+ max_length=50,
231
+ verbose_name="user modified",
232
+ ),
233
+ ),
234
+ (
235
+ "hostname_created",
236
+ models.CharField(
237
+ blank=True,
238
+ default=_socket.gethostname,
239
+ help_text="System field. (modified on create only)",
240
+ max_length=60,
241
+ verbose_name="Hostname created",
242
+ ),
243
+ ),
244
+ (
245
+ "hostname_modified",
246
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
247
+ blank=True,
248
+ help_text="System field. (modified on every save)",
249
+ max_length=50,
250
+ verbose_name="Hostname modified",
251
+ ),
252
+ ),
253
+ (
254
+ "device_created",
255
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
256
+ ),
257
+ (
258
+ "device_modified",
259
+ models.CharField(
260
+ blank=True, max_length=10, verbose_name="Device modified"
261
+ ),
262
+ ),
263
+ (
264
+ "locale_created",
265
+ models.CharField(
266
+ blank=True,
267
+ help_text="Auto-updated by Modeladmin",
268
+ max_length=10,
269
+ null=True,
270
+ verbose_name="Locale created",
271
+ ),
272
+ ),
273
+ (
274
+ "locale_modified",
275
+ models.CharField(
276
+ blank=True,
277
+ help_text="Auto-updated by Modeladmin",
278
+ max_length=10,
279
+ null=True,
280
+ verbose_name="Locale modified",
281
+ ),
282
+ ),
283
+ (
284
+ "id",
285
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
286
+ blank=True,
287
+ db_index=True,
288
+ editable=False,
289
+ help_text="System auto field. UUID primary key.",
290
+ ),
291
+ ),
292
+ ("subject_identifier", models.CharField(db_index=True, max_length=50)),
293
+ (
294
+ "action_identifier",
295
+ models.CharField(blank=True, db_index=True, max_length=50, null=True),
296
+ ),
297
+ (
298
+ "parent_action_identifier",
299
+ models.CharField(
300
+ blank=True,
301
+ help_text="action identifier that links to parent reference model instance.",
302
+ max_length=30,
303
+ null=True,
304
+ ),
305
+ ),
306
+ (
307
+ "related_action_identifier",
308
+ models.CharField(
309
+ blank=True,
310
+ help_text="action identifier that links to related reference model instance.",
311
+ max_length=30,
312
+ null=True,
313
+ ),
314
+ ),
315
+ ("action_item_reason", models.TextField(editable=False, null=True)),
316
+ (
317
+ "offschedule_datetime",
318
+ models.DateTimeField(
319
+ default=edc_utils.date.get_utcnow,
320
+ validators=[
321
+ edc_protocol.validators.datetime_not_before_study_start,
322
+ edc_model.validators.date.datetime_not_future,
323
+ ],
324
+ verbose_name="Date and time subject taken off schedule",
325
+ ),
326
+ ),
327
+ ("report_datetime", models.DateTimeField(editable=False)),
328
+ (
329
+ "history_id",
330
+ models.UUIDField(
331
+ default=uuid.uuid4, editable=False, primary_key=True, serialize=False
332
+ ),
333
+ ),
334
+ ("history_date", models.DateTimeField(db_index=True)),
335
+ ("history_change_reason", models.CharField(max_length=100, null=True)),
336
+ (
337
+ "history_type",
338
+ models.CharField(
339
+ choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
340
+ max_length=1,
341
+ ),
342
+ ),
343
+ (
344
+ "action_item",
345
+ models.ForeignKey(
346
+ blank=True,
347
+ db_constraint=False,
348
+ null=True,
349
+ on_delete=django.db.models.deletion.DO_NOTHING,
350
+ related_name="+",
351
+ to="edc_action_item.actionitem",
352
+ ),
353
+ ),
354
+ (
355
+ "history_user",
356
+ models.ForeignKey(
357
+ null=True,
358
+ on_delete=django.db.models.deletion.SET_NULL,
359
+ related_name="+",
360
+ to=settings.AUTH_USER_MODEL,
361
+ ),
362
+ ),
363
+ (
364
+ "parent_action_item",
365
+ models.ForeignKey(
366
+ blank=True,
367
+ db_constraint=False,
368
+ null=True,
369
+ on_delete=django.db.models.deletion.DO_NOTHING,
370
+ related_name="+",
371
+ to="edc_action_item.actionitem",
372
+ ),
373
+ ),
374
+ (
375
+ "related_action_item",
376
+ models.ForeignKey(
377
+ blank=True,
378
+ db_constraint=False,
379
+ null=True,
380
+ on_delete=django.db.models.deletion.DO_NOTHING,
381
+ related_name="+",
382
+ to="edc_action_item.actionitem",
383
+ ),
384
+ ),
385
+ (
386
+ "site",
387
+ models.ForeignKey(
388
+ blank=True,
389
+ db_constraint=False,
390
+ null=True,
391
+ on_delete=django.db.models.deletion.DO_NOTHING,
392
+ related_name="+",
393
+ to="sites.site",
394
+ ),
395
+ ),
396
+ ],
397
+ options={
398
+ "verbose_name": "historical Off-schedule: DM Referral",
399
+ "verbose_name_plural": "historical Off-schedule: DM Referral",
400
+ "ordering": ("-history_date", "-history_id"),
401
+ "get_latest_by": ("history_date", "history_id"),
402
+ },
403
+ bases=(simple_history.models.HistoricalChanges, models.Model),
404
+ ),
405
+ migrations.CreateModel(
406
+ name="HistoricalDmReferral",
407
+ fields=[
408
+ (
409
+ "revision",
410
+ django_revision.revision_field.RevisionField(
411
+ blank=True,
412
+ editable=False,
413
+ help_text="System field. Git repository tag:branch:commit.",
414
+ max_length=75,
415
+ null=True,
416
+ verbose_name="Revision",
417
+ ),
418
+ ),
419
+ (
420
+ "created",
421
+ models.DateTimeField(
422
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
423
+ ),
424
+ ),
425
+ (
426
+ "modified",
427
+ models.DateTimeField(
428
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
429
+ ),
430
+ ),
431
+ (
432
+ "user_created",
433
+ django_audit_fields.fields.userfield.UserField(
434
+ blank=True,
435
+ help_text="Updated by admin.save_model",
436
+ max_length=50,
437
+ verbose_name="user created",
438
+ ),
439
+ ),
440
+ (
441
+ "user_modified",
442
+ django_audit_fields.fields.userfield.UserField(
443
+ blank=True,
444
+ help_text="Updated by admin.save_model",
445
+ max_length=50,
446
+ verbose_name="user modified",
447
+ ),
448
+ ),
449
+ (
450
+ "hostname_created",
451
+ models.CharField(
452
+ blank=True,
453
+ default=_socket.gethostname,
454
+ help_text="System field. (modified on create only)",
455
+ max_length=60,
456
+ verbose_name="Hostname created",
457
+ ),
458
+ ),
459
+ (
460
+ "hostname_modified",
461
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
462
+ blank=True,
463
+ help_text="System field. (modified on every save)",
464
+ max_length=50,
465
+ verbose_name="Hostname modified",
466
+ ),
467
+ ),
468
+ (
469
+ "device_created",
470
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
471
+ ),
472
+ (
473
+ "device_modified",
474
+ models.CharField(
475
+ blank=True, max_length=10, verbose_name="Device modified"
476
+ ),
477
+ ),
478
+ (
479
+ "locale_created",
480
+ models.CharField(
481
+ blank=True,
482
+ help_text="Auto-updated by Modeladmin",
483
+ max_length=10,
484
+ null=True,
485
+ verbose_name="Locale created",
486
+ ),
487
+ ),
488
+ (
489
+ "locale_modified",
490
+ models.CharField(
491
+ blank=True,
492
+ help_text="Auto-updated by Modeladmin",
493
+ max_length=10,
494
+ null=True,
495
+ verbose_name="Locale modified",
496
+ ),
497
+ ),
498
+ (
499
+ "id",
500
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
501
+ blank=True,
502
+ db_index=True,
503
+ editable=False,
504
+ help_text="System auto field. UUID primary key.",
505
+ ),
506
+ ),
507
+ ("subject_identifier", models.CharField(db_index=True, max_length=50)),
508
+ (
509
+ "action_identifier",
510
+ models.CharField(blank=True, db_index=True, max_length=50, null=True),
511
+ ),
512
+ (
513
+ "parent_action_identifier",
514
+ models.CharField(
515
+ blank=True,
516
+ help_text="action identifier that links to parent reference model instance.",
517
+ max_length=30,
518
+ null=True,
519
+ ),
520
+ ),
521
+ (
522
+ "related_action_identifier",
523
+ models.CharField(
524
+ blank=True,
525
+ help_text="action identifier that links to related reference model instance.",
526
+ max_length=30,
527
+ null=True,
528
+ ),
529
+ ),
530
+ ("action_item_reason", models.TextField(editable=False, null=True)),
531
+ (
532
+ "report_datetime",
533
+ models.DateTimeField(
534
+ default=edc_utils.date.get_utcnow, verbose_name="Report date and time"
535
+ ),
536
+ ),
537
+ (
538
+ "referral_date",
539
+ models.DateField(verbose_name="Date of referral to diabetes clinic"),
540
+ ),
541
+ (
542
+ "history_id",
543
+ models.UUIDField(
544
+ default=uuid.uuid4, editable=False, primary_key=True, serialize=False
545
+ ),
546
+ ),
547
+ ("history_date", models.DateTimeField(db_index=True)),
548
+ ("history_change_reason", models.CharField(max_length=100, null=True)),
549
+ (
550
+ "history_type",
551
+ models.CharField(
552
+ choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
553
+ max_length=1,
554
+ ),
555
+ ),
556
+ (
557
+ "action_item",
558
+ models.ForeignKey(
559
+ blank=True,
560
+ db_constraint=False,
561
+ null=True,
562
+ on_delete=django.db.models.deletion.DO_NOTHING,
563
+ related_name="+",
564
+ to="edc_action_item.actionitem",
565
+ ),
566
+ ),
567
+ (
568
+ "history_user",
569
+ models.ForeignKey(
570
+ null=True,
571
+ on_delete=django.db.models.deletion.SET_NULL,
572
+ related_name="+",
573
+ to=settings.AUTH_USER_MODEL,
574
+ ),
575
+ ),
576
+ (
577
+ "parent_action_item",
578
+ models.ForeignKey(
579
+ blank=True,
580
+ db_constraint=False,
581
+ null=True,
582
+ on_delete=django.db.models.deletion.DO_NOTHING,
583
+ related_name="+",
584
+ to="edc_action_item.actionitem",
585
+ ),
586
+ ),
587
+ (
588
+ "related_action_item",
589
+ models.ForeignKey(
590
+ blank=True,
591
+ db_constraint=False,
592
+ null=True,
593
+ on_delete=django.db.models.deletion.DO_NOTHING,
594
+ related_name="+",
595
+ to="edc_action_item.actionitem",
596
+ ),
597
+ ),
598
+ (
599
+ "site",
600
+ models.ForeignKey(
601
+ blank=True,
602
+ db_constraint=False,
603
+ null=True,
604
+ on_delete=django.db.models.deletion.DO_NOTHING,
605
+ related_name="+",
606
+ to="sites.site",
607
+ ),
608
+ ),
609
+ ],
610
+ options={
611
+ "verbose_name": "historical Diabetes referral",
612
+ "verbose_name_plural": "historical Diabetes referral",
613
+ "ordering": ("-history_date", "-history_id"),
614
+ "get_latest_by": ("history_date", "history_id"),
615
+ },
616
+ bases=(simple_history.models.HistoricalChanges, models.Model),
617
+ ),
618
+ migrations.CreateModel(
619
+ name="OnScheduleDmReferral",
620
+ fields=[
621
+ (
622
+ "revision",
623
+ django_revision.revision_field.RevisionField(
624
+ blank=True,
625
+ editable=False,
626
+ help_text="System field. Git repository tag:branch:commit.",
627
+ max_length=75,
628
+ null=True,
629
+ verbose_name="Revision",
630
+ ),
631
+ ),
632
+ (
633
+ "created",
634
+ models.DateTimeField(
635
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
636
+ ),
637
+ ),
638
+ (
639
+ "modified",
640
+ models.DateTimeField(
641
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
642
+ ),
643
+ ),
644
+ (
645
+ "user_created",
646
+ django_audit_fields.fields.userfield.UserField(
647
+ blank=True,
648
+ help_text="Updated by admin.save_model",
649
+ max_length=50,
650
+ verbose_name="user created",
651
+ ),
652
+ ),
653
+ (
654
+ "user_modified",
655
+ django_audit_fields.fields.userfield.UserField(
656
+ blank=True,
657
+ help_text="Updated by admin.save_model",
658
+ max_length=50,
659
+ verbose_name="user modified",
660
+ ),
661
+ ),
662
+ (
663
+ "hostname_created",
664
+ models.CharField(
665
+ blank=True,
666
+ default=_socket.gethostname,
667
+ help_text="System field. (modified on create only)",
668
+ max_length=60,
669
+ verbose_name="Hostname created",
670
+ ),
671
+ ),
672
+ (
673
+ "hostname_modified",
674
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
675
+ blank=True,
676
+ help_text="System field. (modified on every save)",
677
+ max_length=50,
678
+ verbose_name="Hostname modified",
679
+ ),
680
+ ),
681
+ (
682
+ "device_created",
683
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
684
+ ),
685
+ (
686
+ "device_modified",
687
+ models.CharField(
688
+ blank=True, max_length=10, verbose_name="Device modified"
689
+ ),
690
+ ),
691
+ (
692
+ "locale_created",
693
+ models.CharField(
694
+ blank=True,
695
+ help_text="Auto-updated by Modeladmin",
696
+ max_length=10,
697
+ null=True,
698
+ verbose_name="Locale created",
699
+ ),
700
+ ),
701
+ (
702
+ "locale_modified",
703
+ models.CharField(
704
+ blank=True,
705
+ help_text="Auto-updated by Modeladmin",
706
+ max_length=10,
707
+ null=True,
708
+ verbose_name="Locale modified",
709
+ ),
710
+ ),
711
+ (
712
+ "id",
713
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
714
+ blank=True,
715
+ editable=False,
716
+ help_text="System auto field. UUID primary key.",
717
+ primary_key=True,
718
+ serialize=False,
719
+ ),
720
+ ),
721
+ ("subject_identifier", models.CharField(max_length=50, unique=True)),
722
+ (
723
+ "onschedule_datetime",
724
+ models.DateTimeField(
725
+ default=edc_utils.date.get_utcnow,
726
+ validators=[
727
+ edc_protocol.validators.datetime_not_before_study_start,
728
+ edc_model.validators.date.datetime_not_future,
729
+ ],
730
+ ),
731
+ ),
732
+ ("report_datetime", models.DateTimeField(editable=False)),
733
+ (
734
+ "site",
735
+ models.ForeignKey(
736
+ null=True,
737
+ on_delete=django.db.models.deletion.PROTECT,
738
+ related_name="+",
739
+ to="sites.site",
740
+ ),
741
+ ),
742
+ ],
743
+ options={
744
+ "verbose_name": "On-schedule: DM Referral",
745
+ "verbose_name_plural": "On-schedule: DM Referral",
746
+ "abstract": False,
747
+ "default_permissions": ("add", "change", "delete", "view", "export", "import"),
748
+ "default_manager_name": "objects",
749
+ "indexes": [
750
+ models.Index(
751
+ fields=["subject_identifier", "onschedule_datetime", "site"],
752
+ name="meta_prn_on_subject_bc8f5a_idx",
753
+ )
754
+ ],
755
+ },
756
+ managers=[
757
+ ("objects", edc_identifier.managers.SubjectIdentifierManager()),
758
+ ("on_site", edc_sites.managers.CurrentSiteManager()),
759
+ ],
760
+ ),
761
+ migrations.CreateModel(
762
+ name="OffScheduleDmReferral",
763
+ fields=[
764
+ (
765
+ "revision",
766
+ django_revision.revision_field.RevisionField(
767
+ blank=True,
768
+ editable=False,
769
+ help_text="System field. Git repository tag:branch:commit.",
770
+ max_length=75,
771
+ null=True,
772
+ verbose_name="Revision",
773
+ ),
774
+ ),
775
+ (
776
+ "created",
777
+ models.DateTimeField(
778
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
779
+ ),
780
+ ),
781
+ (
782
+ "modified",
783
+ models.DateTimeField(
784
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
785
+ ),
786
+ ),
787
+ (
788
+ "user_created",
789
+ django_audit_fields.fields.userfield.UserField(
790
+ blank=True,
791
+ help_text="Updated by admin.save_model",
792
+ max_length=50,
793
+ verbose_name="user created",
794
+ ),
795
+ ),
796
+ (
797
+ "user_modified",
798
+ django_audit_fields.fields.userfield.UserField(
799
+ blank=True,
800
+ help_text="Updated by admin.save_model",
801
+ max_length=50,
802
+ verbose_name="user modified",
803
+ ),
804
+ ),
805
+ (
806
+ "hostname_created",
807
+ models.CharField(
808
+ blank=True,
809
+ default=_socket.gethostname,
810
+ help_text="System field. (modified on create only)",
811
+ max_length=60,
812
+ verbose_name="Hostname created",
813
+ ),
814
+ ),
815
+ (
816
+ "hostname_modified",
817
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
818
+ blank=True,
819
+ help_text="System field. (modified on every save)",
820
+ max_length=50,
821
+ verbose_name="Hostname modified",
822
+ ),
823
+ ),
824
+ (
825
+ "device_created",
826
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
827
+ ),
828
+ (
829
+ "device_modified",
830
+ models.CharField(
831
+ blank=True, max_length=10, verbose_name="Device modified"
832
+ ),
833
+ ),
834
+ (
835
+ "locale_created",
836
+ models.CharField(
837
+ blank=True,
838
+ help_text="Auto-updated by Modeladmin",
839
+ max_length=10,
840
+ null=True,
841
+ verbose_name="Locale created",
842
+ ),
843
+ ),
844
+ (
845
+ "locale_modified",
846
+ models.CharField(
847
+ blank=True,
848
+ help_text="Auto-updated by Modeladmin",
849
+ max_length=10,
850
+ null=True,
851
+ verbose_name="Locale modified",
852
+ ),
853
+ ),
854
+ (
855
+ "id",
856
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
857
+ blank=True,
858
+ editable=False,
859
+ help_text="System auto field. UUID primary key.",
860
+ primary_key=True,
861
+ serialize=False,
862
+ ),
863
+ ),
864
+ ("subject_identifier", models.CharField(max_length=50, unique=True)),
865
+ (
866
+ "action_identifier",
867
+ models.CharField(blank=True, max_length=50, null=True, unique=True),
868
+ ),
869
+ (
870
+ "parent_action_identifier",
871
+ models.CharField(
872
+ blank=True,
873
+ help_text="action identifier that links to parent reference model instance.",
874
+ max_length=30,
875
+ null=True,
876
+ ),
877
+ ),
878
+ (
879
+ "related_action_identifier",
880
+ models.CharField(
881
+ blank=True,
882
+ help_text="action identifier that links to related reference model instance.",
883
+ max_length=30,
884
+ null=True,
885
+ ),
886
+ ),
887
+ ("action_item_reason", models.TextField(editable=False, null=True)),
888
+ (
889
+ "offschedule_datetime",
890
+ models.DateTimeField(
891
+ default=edc_utils.date.get_utcnow,
892
+ validators=[
893
+ edc_protocol.validators.datetime_not_before_study_start,
894
+ edc_model.validators.date.datetime_not_future,
895
+ ],
896
+ verbose_name="Date and time subject taken off schedule",
897
+ ),
898
+ ),
899
+ ("report_datetime", models.DateTimeField(editable=False)),
900
+ (
901
+ "action_item",
902
+ models.ForeignKey(
903
+ blank=True,
904
+ null=True,
905
+ on_delete=django.db.models.deletion.PROTECT,
906
+ to="edc_action_item.actionitem",
907
+ ),
908
+ ),
909
+ (
910
+ "parent_action_item",
911
+ models.ForeignKey(
912
+ blank=True,
913
+ null=True,
914
+ on_delete=django.db.models.deletion.PROTECT,
915
+ related_name="+",
916
+ to="edc_action_item.actionitem",
917
+ ),
918
+ ),
919
+ (
920
+ "related_action_item",
921
+ models.ForeignKey(
922
+ blank=True,
923
+ null=True,
924
+ on_delete=django.db.models.deletion.PROTECT,
925
+ related_name="+",
926
+ to="edc_action_item.actionitem",
927
+ ),
928
+ ),
929
+ (
930
+ "site",
931
+ models.ForeignKey(
932
+ null=True,
933
+ on_delete=django.db.models.deletion.PROTECT,
934
+ related_name="+",
935
+ to="sites.site",
936
+ ),
937
+ ),
938
+ ],
939
+ options={
940
+ "verbose_name": "Off-schedule: DM Referral",
941
+ "verbose_name_plural": "Off-schedule: DM Referral",
942
+ "abstract": False,
943
+ "default_permissions": ("add", "change", "delete", "view", "export", "import"),
944
+ "default_manager_name": "objects",
945
+ "indexes": [
946
+ models.Index(
947
+ fields=["subject_identifier", "offschedule_datetime", "site"],
948
+ name="meta_prn_of_subject_b6f04f_idx",
949
+ )
950
+ ],
951
+ },
952
+ managers=[
953
+ ("on_site", edc_sites.managers.CurrentSiteManager()),
954
+ ("objects", edc_action_item.managers.ActionIdentifierModelManager()),
955
+ ],
956
+ ),
957
+ migrations.CreateModel(
958
+ name="DmReferral",
959
+ fields=[
960
+ (
961
+ "revision",
962
+ django_revision.revision_field.RevisionField(
963
+ blank=True,
964
+ editable=False,
965
+ help_text="System field. Git repository tag:branch:commit.",
966
+ max_length=75,
967
+ null=True,
968
+ verbose_name="Revision",
969
+ ),
970
+ ),
971
+ (
972
+ "created",
973
+ models.DateTimeField(
974
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
975
+ ),
976
+ ),
977
+ (
978
+ "modified",
979
+ models.DateTimeField(
980
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
981
+ ),
982
+ ),
983
+ (
984
+ "user_created",
985
+ django_audit_fields.fields.userfield.UserField(
986
+ blank=True,
987
+ help_text="Updated by admin.save_model",
988
+ max_length=50,
989
+ verbose_name="user created",
990
+ ),
991
+ ),
992
+ (
993
+ "user_modified",
994
+ django_audit_fields.fields.userfield.UserField(
995
+ blank=True,
996
+ help_text="Updated by admin.save_model",
997
+ max_length=50,
998
+ verbose_name="user modified",
999
+ ),
1000
+ ),
1001
+ (
1002
+ "hostname_created",
1003
+ models.CharField(
1004
+ blank=True,
1005
+ default=_socket.gethostname,
1006
+ help_text="System field. (modified on create only)",
1007
+ max_length=60,
1008
+ verbose_name="Hostname created",
1009
+ ),
1010
+ ),
1011
+ (
1012
+ "hostname_modified",
1013
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
1014
+ blank=True,
1015
+ help_text="System field. (modified on every save)",
1016
+ max_length=50,
1017
+ verbose_name="Hostname modified",
1018
+ ),
1019
+ ),
1020
+ (
1021
+ "device_created",
1022
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
1023
+ ),
1024
+ (
1025
+ "device_modified",
1026
+ models.CharField(
1027
+ blank=True, max_length=10, verbose_name="Device modified"
1028
+ ),
1029
+ ),
1030
+ (
1031
+ "locale_created",
1032
+ models.CharField(
1033
+ blank=True,
1034
+ help_text="Auto-updated by Modeladmin",
1035
+ max_length=10,
1036
+ null=True,
1037
+ verbose_name="Locale created",
1038
+ ),
1039
+ ),
1040
+ (
1041
+ "locale_modified",
1042
+ models.CharField(
1043
+ blank=True,
1044
+ help_text="Auto-updated by Modeladmin",
1045
+ max_length=10,
1046
+ null=True,
1047
+ verbose_name="Locale modified",
1048
+ ),
1049
+ ),
1050
+ (
1051
+ "id",
1052
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
1053
+ blank=True,
1054
+ editable=False,
1055
+ help_text="System auto field. UUID primary key.",
1056
+ primary_key=True,
1057
+ serialize=False,
1058
+ ),
1059
+ ),
1060
+ ("subject_identifier", models.CharField(max_length=50, unique=True)),
1061
+ (
1062
+ "action_identifier",
1063
+ models.CharField(blank=True, max_length=50, null=True, unique=True),
1064
+ ),
1065
+ (
1066
+ "parent_action_identifier",
1067
+ models.CharField(
1068
+ blank=True,
1069
+ help_text="action identifier that links to parent reference model instance.",
1070
+ max_length=30,
1071
+ null=True,
1072
+ ),
1073
+ ),
1074
+ (
1075
+ "related_action_identifier",
1076
+ models.CharField(
1077
+ blank=True,
1078
+ help_text="action identifier that links to related reference model instance.",
1079
+ max_length=30,
1080
+ null=True,
1081
+ ),
1082
+ ),
1083
+ ("action_item_reason", models.TextField(editable=False, null=True)),
1084
+ (
1085
+ "report_datetime",
1086
+ models.DateTimeField(
1087
+ default=edc_utils.date.get_utcnow, verbose_name="Report date and time"
1088
+ ),
1089
+ ),
1090
+ (
1091
+ "referral_date",
1092
+ models.DateField(verbose_name="Date of referral to diabetes clinic"),
1093
+ ),
1094
+ (
1095
+ "action_item",
1096
+ models.ForeignKey(
1097
+ blank=True,
1098
+ null=True,
1099
+ on_delete=django.db.models.deletion.PROTECT,
1100
+ to="edc_action_item.actionitem",
1101
+ ),
1102
+ ),
1103
+ (
1104
+ "parent_action_item",
1105
+ models.ForeignKey(
1106
+ blank=True,
1107
+ null=True,
1108
+ on_delete=django.db.models.deletion.PROTECT,
1109
+ related_name="+",
1110
+ to="edc_action_item.actionitem",
1111
+ ),
1112
+ ),
1113
+ (
1114
+ "related_action_item",
1115
+ models.ForeignKey(
1116
+ blank=True,
1117
+ null=True,
1118
+ on_delete=django.db.models.deletion.PROTECT,
1119
+ related_name="+",
1120
+ to="edc_action_item.actionitem",
1121
+ ),
1122
+ ),
1123
+ (
1124
+ "site",
1125
+ models.ForeignKey(
1126
+ null=True,
1127
+ on_delete=django.db.models.deletion.PROTECT,
1128
+ related_name="+",
1129
+ to="sites.site",
1130
+ ),
1131
+ ),
1132
+ ],
1133
+ options={
1134
+ "verbose_name": "Diabetes referral",
1135
+ "verbose_name_plural": "Diabetes referral",
1136
+ "abstract": False,
1137
+ "default_permissions": ("add", "change", "delete", "view", "export", "import"),
1138
+ "default_manager_name": "objects",
1139
+ "indexes": [
1140
+ models.Index(
1141
+ fields=[
1142
+ "action_identifier",
1143
+ "action_item",
1144
+ "related_action_item",
1145
+ "parent_action_item",
1146
+ ],
1147
+ name="meta_prn_dm_action__b6eee8_idx",
1148
+ )
1149
+ ],
1150
+ },
1151
+ managers=[
1152
+ ("on_site", edc_sites.managers.CurrentSiteManager()),
1153
+ ("objects", edc_action_item.managers.ActionIdentifierModelManager()),
1154
+ ],
1155
+ ),
1156
+ ]