meta-edc 0.3.6__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.6.dist-info → meta_edc-0.3.15.dist-info}/METADATA +5 -4
  19. {meta_edc-0.3.6.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.6.dist-info → meta_edc-0.3.15.dist-info}/AUTHORS +0 -0
  127. {meta_edc-0.3.6.dist-info → meta_edc-0.3.15.dist-info}/LICENSE +0 -0
  128. {meta_edc-0.3.6.dist-info → meta_edc-0.3.15.dist-info}/WHEEL +0 -0
  129. {meta_edc-0.3.6.dist-info → meta_edc-0.3.15.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,31 @@
1
+ # Generated by Django 5.0.4 on 2024-04-09 04:18
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0183_alter_dmfollowup_on_dm_medications_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterModelOptions(
14
+ name="glucose",
15
+ options={
16
+ "default_manager_name": "objects",
17
+ "default_permissions": ("add", "change", "delete", "view", "export", "import"),
18
+ "verbose_name": "Glucose (FBG/RBG, OGTT)",
19
+ "verbose_name_plural": "Glucose (FBG/RBG, OGTT)",
20
+ },
21
+ ),
22
+ migrations.AlterModelOptions(
23
+ name="historicalglucose",
24
+ options={
25
+ "get_latest_by": ("history_date", "history_id"),
26
+ "ordering": ("-history_date", "-history_id"),
27
+ "verbose_name": "historical Glucose (FBG/RBG, OGTT)",
28
+ "verbose_name_plural": "historical Glucose (FBG/RBG, OGTT)",
29
+ },
30
+ ),
31
+ ]
@@ -0,0 +1,82 @@
1
+ # Generated by Django 5.0.4 on 2024-04-18 23:46
2
+
3
+ import django.core.validators
4
+ from django.db import migrations, models
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [
10
+ ("meta_subject", "0184_alter_glucose_options_and_more"),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.AlterField(
15
+ model_name="bloodresultsins",
16
+ name="fasting_duration_str",
17
+ field=models.CharField(
18
+ blank=True,
19
+ help_text="As reported by patient. Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
20
+ max_length=8,
21
+ null=True,
22
+ validators=[
23
+ django.core.validators.RegexValidator(
24
+ "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
25
+ message="Invalid format. Expected something like 1h20m, 11h5m, etc. No spaces allowed.",
26
+ )
27
+ ],
28
+ verbose_name="How long have they fasted in hours and/or minutes?",
29
+ ),
30
+ ),
31
+ migrations.AlterField(
32
+ model_name="glucose",
33
+ name="fasting_duration_str",
34
+ field=models.CharField(
35
+ blank=True,
36
+ help_text="As reported by patient. Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
37
+ max_length=8,
38
+ null=True,
39
+ validators=[
40
+ django.core.validators.RegexValidator(
41
+ "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
42
+ message="Invalid format. Expected something like 1h20m, 11h5m, etc. No spaces allowed.",
43
+ )
44
+ ],
45
+ verbose_name="How long have they fasted in hours and/or minutes?",
46
+ ),
47
+ ),
48
+ migrations.AlterField(
49
+ model_name="historicalbloodresultsins",
50
+ name="fasting_duration_str",
51
+ field=models.CharField(
52
+ blank=True,
53
+ help_text="As reported by patient. Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
54
+ max_length=8,
55
+ null=True,
56
+ validators=[
57
+ django.core.validators.RegexValidator(
58
+ "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
59
+ message="Invalid format. Expected something like 1h20m, 11h5m, etc. No spaces allowed.",
60
+ )
61
+ ],
62
+ verbose_name="How long have they fasted in hours and/or minutes?",
63
+ ),
64
+ ),
65
+ migrations.AlterField(
66
+ model_name="historicalglucose",
67
+ name="fasting_duration_str",
68
+ field=models.CharField(
69
+ blank=True,
70
+ help_text="As reported by patient. Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
71
+ max_length=8,
72
+ null=True,
73
+ validators=[
74
+ django.core.validators.RegexValidator(
75
+ "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
76
+ message="Invalid format. Expected something like 1h20m, 11h5m, etc. No spaces allowed.",
77
+ )
78
+ ],
79
+ verbose_name="How long have they fasted in hours and/or minutes?",
80
+ ),
81
+ ),
82
+ ]
@@ -0,0 +1,55 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 17:34
2
+
3
+ import uuid
4
+
5
+ import _socket
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_crf.model_mixins.crf_status_model_mixin
13
+ import edc_model.validators.date
14
+ import edc_protocol.validators
15
+ import edc_utils.date
16
+ import edc_visit_tracking.managers
17
+ import simple_history.models
18
+ from django.conf import settings
19
+ from django.db import migrations, models
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
+ ("meta_subject", "0185_alter_bloodresultsins_fasting_duration_str_and_more"),
28
+ ]
29
+
30
+ operations = [
31
+ migrations.AddField(
32
+ model_name="healtheconomicsupdate",
33
+ name="singleton_field",
34
+ field=models.CharField(
35
+ editable=False,
36
+ help_text="auto updated for unique constraint",
37
+ max_length=50,
38
+ null=True,
39
+ unique=True,
40
+ verbose_name="subject identifier",
41
+ ),
42
+ ),
43
+ migrations.AddField(
44
+ model_name="historicalhealtheconomicsupdate",
45
+ name="singleton_field",
46
+ field=models.CharField(
47
+ db_index=True,
48
+ editable=False,
49
+ help_text="auto updated for unique constraint",
50
+ max_length=50,
51
+ null=True,
52
+ verbose_name="subject identifier",
53
+ ),
54
+ ),
55
+ ]
@@ -0,0 +1,451 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 17:42
2
+
3
+ import uuid
4
+
5
+ import _socket
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_crf.model_mixins.crf_status_model_mixin
13
+ import edc_model.validators.date
14
+ import edc_protocol.validators
15
+ import edc_utils.date
16
+ import edc_visit_tracking.managers
17
+ import simple_history.models
18
+ from django.conf import settings
19
+ from django.db import migrations, models
20
+
21
+
22
+ class Migration(migrations.Migration):
23
+
24
+ dependencies = [
25
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
26
+ ("sites", "0002_alter_domain_unique"),
27
+ ("meta_subject", "0186_healtheconomicsupdate_singleton_field_and_more"),
28
+ ]
29
+
30
+ operations = [
31
+ migrations.CreateModel(
32
+ name="DmDiagnosis",
33
+ fields=[
34
+ (
35
+ "revision",
36
+ django_revision.revision_field.RevisionField(
37
+ blank=True,
38
+ editable=False,
39
+ help_text="System field. Git repository tag:branch:commit.",
40
+ max_length=75,
41
+ null=True,
42
+ verbose_name="Revision",
43
+ ),
44
+ ),
45
+ (
46
+ "created",
47
+ models.DateTimeField(
48
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
49
+ ),
50
+ ),
51
+ (
52
+ "modified",
53
+ models.DateTimeField(
54
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
55
+ ),
56
+ ),
57
+ (
58
+ "user_created",
59
+ django_audit_fields.fields.userfield.UserField(
60
+ blank=True,
61
+ help_text="Updated by admin.save_model",
62
+ max_length=50,
63
+ verbose_name="user created",
64
+ ),
65
+ ),
66
+ (
67
+ "user_modified",
68
+ django_audit_fields.fields.userfield.UserField(
69
+ blank=True,
70
+ help_text="Updated by admin.save_model",
71
+ max_length=50,
72
+ verbose_name="user modified",
73
+ ),
74
+ ),
75
+ (
76
+ "hostname_created",
77
+ models.CharField(
78
+ blank=True,
79
+ default=_socket.gethostname,
80
+ help_text="System field. (modified on create only)",
81
+ max_length=60,
82
+ verbose_name="Hostname created",
83
+ ),
84
+ ),
85
+ (
86
+ "hostname_modified",
87
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
88
+ blank=True,
89
+ help_text="System field. (modified on every save)",
90
+ max_length=50,
91
+ verbose_name="Hostname modified",
92
+ ),
93
+ ),
94
+ (
95
+ "device_created",
96
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
97
+ ),
98
+ (
99
+ "device_modified",
100
+ models.CharField(
101
+ blank=True, max_length=10, verbose_name="Device modified"
102
+ ),
103
+ ),
104
+ (
105
+ "locale_created",
106
+ models.CharField(
107
+ blank=True,
108
+ help_text="Auto-updated by Modeladmin",
109
+ max_length=10,
110
+ null=True,
111
+ verbose_name="Locale created",
112
+ ),
113
+ ),
114
+ (
115
+ "locale_modified",
116
+ models.CharField(
117
+ blank=True,
118
+ help_text="Auto-updated by Modeladmin",
119
+ max_length=10,
120
+ null=True,
121
+ verbose_name="Locale modified",
122
+ ),
123
+ ),
124
+ (
125
+ "id",
126
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
127
+ blank=True,
128
+ editable=False,
129
+ help_text="System auto field. UUID primary key.",
130
+ primary_key=True,
131
+ serialize=False,
132
+ ),
133
+ ),
134
+ ("consent_model", models.CharField(blank=True, max_length=50, null=True)),
135
+ ("consent_version", models.CharField(blank=True, max_length=10, null=True)),
136
+ (
137
+ "report_datetime",
138
+ models.DateTimeField(
139
+ default=edc_utils.date.get_utcnow,
140
+ help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
141
+ validators=[
142
+ edc_protocol.validators.datetime_not_before_study_start,
143
+ edc_model.validators.date.datetime_not_future,
144
+ ],
145
+ verbose_name="Report Date",
146
+ ),
147
+ ),
148
+ (
149
+ "crf_status",
150
+ models.CharField(
151
+ choices=[
152
+ ("INCOMPLETE", "Incomplete (some data pending)"),
153
+ ("COMPLETE", "Complete"),
154
+ ],
155
+ default=edc_crf.model_mixins.crf_status_model_mixin.get_crf_status_default,
156
+ help_text="If some data is still pending, flag this CRF as incomplete",
157
+ max_length=25,
158
+ verbose_name="CRF status",
159
+ ),
160
+ ),
161
+ (
162
+ "crf_status_comments",
163
+ models.TextField(
164
+ blank=True,
165
+ help_text="for example, why some data is still pending",
166
+ null=True,
167
+ verbose_name="Any comments related to status of this CRF",
168
+ ),
169
+ ),
170
+ ("dx_date", models.DateField(verbose_name="Date of diagnosis")),
171
+ (
172
+ "dx_initiated_by",
173
+ models.CharField(
174
+ choices=[
175
+ ("fbg", "Any FBG >= 7.0 mmol/L"),
176
+ ("ogtt", "Annual OGTT >= 11.1 mmol/L"),
177
+ ("OTHER", "Other"),
178
+ ],
179
+ max_length=25,
180
+ verbose_name="What initiated the diagnosis",
181
+ ),
182
+ ),
183
+ (
184
+ "dx_tmg",
185
+ models.CharField(
186
+ choices=[("Yes", "Yes"), ("No", "No")],
187
+ max_length=15,
188
+ verbose_name="Was the diagnosis discussed with the TMG?",
189
+ ),
190
+ ),
191
+ ("dx_tmg_date", models.DateField(verbose_name="Date of TMG discussion")),
192
+ ("comments", models.TextField(verbose_name="Any other comments")),
193
+ (
194
+ "site",
195
+ models.ForeignKey(
196
+ null=True,
197
+ on_delete=django.db.models.deletion.PROTECT,
198
+ related_name="+",
199
+ to="sites.site",
200
+ ),
201
+ ),
202
+ (
203
+ "subject_visit",
204
+ models.OneToOneField(
205
+ on_delete=django.db.models.deletion.PROTECT,
206
+ to="meta_subject.subjectvisit",
207
+ ),
208
+ ),
209
+ ],
210
+ options={
211
+ "verbose_name": "Diabetes diagnosis",
212
+ "verbose_name_plural": "Diabetes diagnosis",
213
+ "abstract": False,
214
+ "default_permissions": ("add", "change", "delete", "view", "export", "import"),
215
+ "default_manager_name": "objects",
216
+ },
217
+ managers=[
218
+ ("objects", edc_visit_tracking.managers.CrfModelManager()),
219
+ ("on_site", edc_visit_tracking.managers.CrfCurrentSiteManager()),
220
+ ],
221
+ ),
222
+ migrations.CreateModel(
223
+ name="HistoricalDmDiagnosis",
224
+ fields=[
225
+ (
226
+ "revision",
227
+ django_revision.revision_field.RevisionField(
228
+ blank=True,
229
+ editable=False,
230
+ help_text="System field. Git repository tag:branch:commit.",
231
+ max_length=75,
232
+ null=True,
233
+ verbose_name="Revision",
234
+ ),
235
+ ),
236
+ (
237
+ "created",
238
+ models.DateTimeField(
239
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
240
+ ),
241
+ ),
242
+ (
243
+ "modified",
244
+ models.DateTimeField(
245
+ blank=True, default=django_audit_fields.models.audit_model_mixin.utcnow
246
+ ),
247
+ ),
248
+ (
249
+ "user_created",
250
+ django_audit_fields.fields.userfield.UserField(
251
+ blank=True,
252
+ help_text="Updated by admin.save_model",
253
+ max_length=50,
254
+ verbose_name="user created",
255
+ ),
256
+ ),
257
+ (
258
+ "user_modified",
259
+ django_audit_fields.fields.userfield.UserField(
260
+ blank=True,
261
+ help_text="Updated by admin.save_model",
262
+ max_length=50,
263
+ verbose_name="user modified",
264
+ ),
265
+ ),
266
+ (
267
+ "hostname_created",
268
+ models.CharField(
269
+ blank=True,
270
+ default=_socket.gethostname,
271
+ help_text="System field. (modified on create only)",
272
+ max_length=60,
273
+ verbose_name="Hostname created",
274
+ ),
275
+ ),
276
+ (
277
+ "hostname_modified",
278
+ django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
279
+ blank=True,
280
+ help_text="System field. (modified on every save)",
281
+ max_length=50,
282
+ verbose_name="Hostname modified",
283
+ ),
284
+ ),
285
+ (
286
+ "device_created",
287
+ models.CharField(blank=True, max_length=10, verbose_name="Device created"),
288
+ ),
289
+ (
290
+ "device_modified",
291
+ models.CharField(
292
+ blank=True, max_length=10, verbose_name="Device modified"
293
+ ),
294
+ ),
295
+ (
296
+ "locale_created",
297
+ models.CharField(
298
+ blank=True,
299
+ help_text="Auto-updated by Modeladmin",
300
+ max_length=10,
301
+ null=True,
302
+ verbose_name="Locale created",
303
+ ),
304
+ ),
305
+ (
306
+ "locale_modified",
307
+ models.CharField(
308
+ blank=True,
309
+ help_text="Auto-updated by Modeladmin",
310
+ max_length=10,
311
+ null=True,
312
+ verbose_name="Locale modified",
313
+ ),
314
+ ),
315
+ (
316
+ "id",
317
+ django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
318
+ blank=True,
319
+ db_index=True,
320
+ editable=False,
321
+ help_text="System auto field. UUID primary key.",
322
+ ),
323
+ ),
324
+ ("consent_model", models.CharField(blank=True, max_length=50, null=True)),
325
+ ("consent_version", models.CharField(blank=True, max_length=10, null=True)),
326
+ (
327
+ "report_datetime",
328
+ models.DateTimeField(
329
+ default=edc_utils.date.get_utcnow,
330
+ help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
331
+ validators=[
332
+ edc_protocol.validators.datetime_not_before_study_start,
333
+ edc_model.validators.date.datetime_not_future,
334
+ ],
335
+ verbose_name="Report Date",
336
+ ),
337
+ ),
338
+ (
339
+ "crf_status",
340
+ models.CharField(
341
+ choices=[
342
+ ("INCOMPLETE", "Incomplete (some data pending)"),
343
+ ("COMPLETE", "Complete"),
344
+ ],
345
+ default=edc_crf.model_mixins.crf_status_model_mixin.get_crf_status_default,
346
+ help_text="If some data is still pending, flag this CRF as incomplete",
347
+ max_length=25,
348
+ verbose_name="CRF status",
349
+ ),
350
+ ),
351
+ (
352
+ "crf_status_comments",
353
+ models.TextField(
354
+ blank=True,
355
+ help_text="for example, why some data is still pending",
356
+ null=True,
357
+ verbose_name="Any comments related to status of this CRF",
358
+ ),
359
+ ),
360
+ ("dx_date", models.DateField(verbose_name="Date of diagnosis")),
361
+ (
362
+ "dx_initiated_by",
363
+ models.CharField(
364
+ choices=[
365
+ ("fbg", "Any FBG >= 7.0 mmol/L"),
366
+ ("ogtt", "Annual OGTT >= 11.1 mmol/L"),
367
+ ("OTHER", "Other"),
368
+ ],
369
+ max_length=25,
370
+ verbose_name="What initiated the diagnosis",
371
+ ),
372
+ ),
373
+ (
374
+ "dx_tmg",
375
+ models.CharField(
376
+ choices=[("Yes", "Yes"), ("No", "No")],
377
+ max_length=15,
378
+ verbose_name="Was the diagnosis discussed with the TMG?",
379
+ ),
380
+ ),
381
+ ("dx_tmg_date", models.DateField(verbose_name="Date of TMG discussion")),
382
+ ("comments", models.TextField(verbose_name="Any other comments")),
383
+ (
384
+ "history_id",
385
+ models.UUIDField(
386
+ default=uuid.uuid4, editable=False, primary_key=True, serialize=False
387
+ ),
388
+ ),
389
+ ("history_date", models.DateTimeField(db_index=True)),
390
+ ("history_change_reason", models.CharField(max_length=100, null=True)),
391
+ (
392
+ "history_type",
393
+ models.CharField(
394
+ choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
395
+ max_length=1,
396
+ ),
397
+ ),
398
+ (
399
+ "history_user",
400
+ models.ForeignKey(
401
+ null=True,
402
+ on_delete=django.db.models.deletion.SET_NULL,
403
+ related_name="+",
404
+ to=settings.AUTH_USER_MODEL,
405
+ ),
406
+ ),
407
+ (
408
+ "site",
409
+ models.ForeignKey(
410
+ blank=True,
411
+ db_constraint=False,
412
+ null=True,
413
+ on_delete=django.db.models.deletion.DO_NOTHING,
414
+ related_name="+",
415
+ to="sites.site",
416
+ ),
417
+ ),
418
+ (
419
+ "subject_visit",
420
+ models.ForeignKey(
421
+ blank=True,
422
+ db_constraint=False,
423
+ null=True,
424
+ on_delete=django.db.models.deletion.DO_NOTHING,
425
+ related_name="+",
426
+ to="meta_subject.subjectvisit",
427
+ ),
428
+ ),
429
+ ],
430
+ options={
431
+ "verbose_name": "historical Diabetes diagnosis",
432
+ "verbose_name_plural": "historical Diabetes diagnosis",
433
+ "ordering": ("-history_date", "-history_id"),
434
+ "get_latest_by": ("history_date", "history_id"),
435
+ },
436
+ bases=(simple_history.models.HistoricalChanges, models.Model),
437
+ ),
438
+ migrations.AddIndex(
439
+ model_name="dmdiagnosis",
440
+ index=models.Index(
441
+ fields=["subject_visit", "site"], name="meta_subjec_subject_40b1c1_idx"
442
+ ),
443
+ ),
444
+ migrations.AddIndex(
445
+ model_name="dmdiagnosis",
446
+ index=models.Index(
447
+ fields=["subject_visit", "report_datetime"],
448
+ name="meta_subjec_subject_2059c2_idx",
449
+ ),
450
+ ),
451
+ ]