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,44 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:20
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", "0191_alter_dmdiagnosis_dx_no_tmg_reason_and_more"),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.RenameField(
15
+ model_name="glucosefbg",
16
+ old_name="glucose_quantifier",
17
+ new_name="fbg_quantifier",
18
+ ),
19
+ migrations.RenameField(
20
+ model_name="glucosefbg",
21
+ old_name="glucose_units",
22
+ new_name="fbg_units",
23
+ ),
24
+ migrations.RenameField(
25
+ model_name="historicalglucosefbg",
26
+ old_name="glucose_quantifier",
27
+ new_name="fbg_quantifier",
28
+ ),
29
+ migrations.RenameField(
30
+ model_name="historicalglucosefbg",
31
+ old_name="glucose_units",
32
+ new_name="fbg_units",
33
+ ),
34
+ migrations.RenameField(
35
+ model_name="glucosefbg",
36
+ old_name="glucose_value",
37
+ new_name="fbg_value",
38
+ ),
39
+ migrations.RenameField(
40
+ model_name="historicalglucosefbg",
41
+ old_name="glucose_value",
42
+ new_name="fbg_value",
43
+ ),
44
+ ]
@@ -0,0 +1,44 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:22
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", "0192_rename_glucose_quantifier_glucosefbg_fbg_quantifier_and_more"),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.AlterField(
15
+ model_name="glucosefbg",
16
+ name="fbg_value",
17
+ field=models.DecimalField(
18
+ blank=True,
19
+ decimal_places=2,
20
+ max_digits=8,
21
+ null=True,
22
+ validators=[
23
+ django.core.validators.MinValueValidator(1.0),
24
+ django.core.validators.MaxValueValidator(9999.99),
25
+ ],
26
+ verbose_name="Glucose (FBG)",
27
+ ),
28
+ ),
29
+ migrations.AlterField(
30
+ model_name="historicalglucosefbg",
31
+ name="fbg_value",
32
+ field=models.DecimalField(
33
+ blank=True,
34
+ decimal_places=2,
35
+ max_digits=8,
36
+ null=True,
37
+ validators=[
38
+ django.core.validators.MinValueValidator(1.0),
39
+ django.core.validators.MaxValueValidator(9999.99),
40
+ ],
41
+ verbose_name="Glucose (FBG)",
42
+ ),
43
+ ),
44
+ ]
@@ -0,0 +1,166 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:32
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", "0193_alter_glucosefbg_fbg_value_and_more"),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.RenameField(
15
+ model_name="glucosefbg",
16
+ old_name="assay_datetime",
17
+ new_name="fbg_datetime",
18
+ ),
19
+ migrations.RenameField(
20
+ model_name="historicalglucosefbg",
21
+ old_name="assay_datetime",
22
+ new_name="fbg_datetime",
23
+ ),
24
+ migrations.AddField(
25
+ model_name="glucosefbg",
26
+ name="fasting_duration_minutes",
27
+ field=models.IntegerField(
28
+ blank=True, help_text="system calculated value", null=True
29
+ ),
30
+ ),
31
+ migrations.AddField(
32
+ model_name="glucosefbg",
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.AddField(
49
+ model_name="historicalglucosefbg",
50
+ name="fasting_duration_minutes",
51
+ field=models.IntegerField(
52
+ blank=True, help_text="system calculated value", null=True
53
+ ),
54
+ ),
55
+ migrations.AddField(
56
+ model_name="historicalglucosefbg",
57
+ name="fasting_duration_str",
58
+ field=models.CharField(
59
+ blank=True,
60
+ help_text="As reported by patient. Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
61
+ max_length=8,
62
+ null=True,
63
+ validators=[
64
+ django.core.validators.RegexValidator(
65
+ "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
66
+ message="Invalid format. Expected something like 1h20m, 11h5m, etc. No spaces allowed.",
67
+ )
68
+ ],
69
+ verbose_name="How long have they fasted in hours and/or minutes?",
70
+ ),
71
+ ),
72
+ migrations.AlterField(
73
+ model_name="glucosefbg",
74
+ name="fasting",
75
+ field=models.CharField(
76
+ choices=[("Yes", "Yes"), ("No", "No")],
77
+ help_text="As reported by patient",
78
+ max_length=15,
79
+ null=True,
80
+ verbose_name="Has the participant fasted?",
81
+ ),
82
+ ),
83
+ migrations.AlterField(
84
+ model_name="glucosefbg",
85
+ name="fbg_quantifier",
86
+ field=models.CharField(
87
+ choices=[("=", "="), (">", ">"), (">=", ">="), ("<", "<"), ("<=", "<=")],
88
+ default="=",
89
+ max_length=10,
90
+ verbose_name="FBG quantifier",
91
+ ),
92
+ ),
93
+ migrations.AlterField(
94
+ model_name="glucosefbg",
95
+ name="fbg_units",
96
+ field=models.CharField(
97
+ choices=[
98
+ ("mg/dL", "mg/dL"),
99
+ ("mmol/L", "mmol/L (millimoles/L)"),
100
+ ("N/A", "Not applicable"),
101
+ ],
102
+ default="N/A",
103
+ max_length=15,
104
+ verbose_name="FBG units",
105
+ ),
106
+ ),
107
+ migrations.AlterField(
108
+ model_name="glucosefbg",
109
+ name="fbg_value",
110
+ field=models.DecimalField(
111
+ blank=True,
112
+ decimal_places=2,
113
+ help_text="A `HIGH` reading may be entered as 9999.99",
114
+ max_digits=8,
115
+ null=True,
116
+ verbose_name="FBG level",
117
+ ),
118
+ ),
119
+ migrations.AlterField(
120
+ model_name="historicalglucosefbg",
121
+ name="fasting",
122
+ field=models.CharField(
123
+ choices=[("Yes", "Yes"), ("No", "No")],
124
+ help_text="As reported by patient",
125
+ max_length=15,
126
+ null=True,
127
+ verbose_name="Has the participant fasted?",
128
+ ),
129
+ ),
130
+ migrations.AlterField(
131
+ model_name="historicalglucosefbg",
132
+ name="fbg_quantifier",
133
+ field=models.CharField(
134
+ choices=[("=", "="), (">", ">"), (">=", ">="), ("<", "<"), ("<=", "<=")],
135
+ default="=",
136
+ max_length=10,
137
+ verbose_name="FBG quantifier",
138
+ ),
139
+ ),
140
+ migrations.AlterField(
141
+ model_name="historicalglucosefbg",
142
+ name="fbg_units",
143
+ field=models.CharField(
144
+ choices=[
145
+ ("mg/dL", "mg/dL"),
146
+ ("mmol/L", "mmol/L (millimoles/L)"),
147
+ ("N/A", "Not applicable"),
148
+ ],
149
+ default="N/A",
150
+ max_length=15,
151
+ verbose_name="FBG units",
152
+ ),
153
+ ),
154
+ migrations.AlterField(
155
+ model_name="historicalglucosefbg",
156
+ name="fbg_value",
157
+ field=models.DecimalField(
158
+ blank=True,
159
+ decimal_places=2,
160
+ help_text="A `HIGH` reading may be entered as 9999.99",
161
+ max_digits=8,
162
+ null=True,
163
+ verbose_name="FBG level",
164
+ ),
165
+ ),
166
+ ]
@@ -0,0 +1,27 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:34
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0194_remove_glucosefbg_assay_datetime_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name="glucosefbg",
15
+ name="fbg_datetime",
16
+ field=models.DateTimeField(
17
+ blank=True, null=True, verbose_name="FBG date/time measured"
18
+ ),
19
+ ),
20
+ migrations.AlterField(
21
+ model_name="historicalglucosefbg",
22
+ name="fbg_datetime",
23
+ field=models.DateTimeField(
24
+ blank=True, null=True, verbose_name="FBG date/time measured"
25
+ ),
26
+ ),
27
+ ]
@@ -0,0 +1,49 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:36
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0195_alter_glucosefbg_fbg_datetime_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name="glucosefbg",
15
+ name="fbg_not_performed_reason",
16
+ field=models.CharField(
17
+ blank=True, max_length=150, null=True, verbose_name="If NO, provide reason"
18
+ ),
19
+ ),
20
+ migrations.AddField(
21
+ model_name="glucosefbg",
22
+ name="fbg_performed",
23
+ field=models.CharField(
24
+ choices=[("Yes", "Yes"), ("No", "No")],
25
+ default="Yes",
26
+ max_length=15,
27
+ verbose_name="Was the FBG test performed?",
28
+ ),
29
+ preserve_default=False,
30
+ ),
31
+ migrations.AddField(
32
+ model_name="historicalglucosefbg",
33
+ name="fbg_not_performed_reason",
34
+ field=models.CharField(
35
+ blank=True, max_length=150, null=True, verbose_name="If NO, provide reason"
36
+ ),
37
+ ),
38
+ migrations.AddField(
39
+ model_name="historicalglucosefbg",
40
+ name="fbg_performed",
41
+ field=models.CharField(
42
+ choices=[("Yes", "Yes"), ("No", "No")],
43
+ default="Yes",
44
+ max_length=15,
45
+ verbose_name="Was the FBG test performed?",
46
+ ),
47
+ preserve_default=False,
48
+ ),
49
+ ]
@@ -0,0 +1,33 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:42
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0196_glucosefbg_fbg_not_performed_reason_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name="glucosefbg",
15
+ name="fasting_duration_estimated",
16
+ field=models.CharField(
17
+ default="Yes",
18
+ editable=False,
19
+ help_text="Set to YES for existing values before duration question was added to the form, otherwise NO",
20
+ max_length=15,
21
+ ),
22
+ ),
23
+ migrations.AddField(
24
+ model_name="historicalglucosefbg",
25
+ name="fasting_duration_estimated",
26
+ field=models.CharField(
27
+ default="Yes",
28
+ editable=False,
29
+ help_text="Set to YES for existing values before duration question was added to the form, otherwise NO",
30
+ max_length=15,
31
+ ),
32
+ ),
33
+ ]
@@ -0,0 +1,33 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:46
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0197_glucosefbg_fasting_duration_estimated_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name="glucosefbg",
15
+ name="fasting_duration_estimated",
16
+ field=models.CharField(
17
+ default="No",
18
+ editable=False,
19
+ help_text="Set to YES for existing values before duration question was added to the form, otherwise NO",
20
+ max_length=15,
21
+ ),
22
+ ),
23
+ migrations.AlterField(
24
+ model_name="historicalglucosefbg",
25
+ name="fasting_duration_estimated",
26
+ field=models.CharField(
27
+ default="No",
28
+ editable=False,
29
+ help_text="Set to YES for existing values before duration question was added to the form, otherwise NO",
30
+ max_length=15,
31
+ ),
32
+ ),
33
+ ]
@@ -0,0 +1,18 @@
1
+ # Generated by Django 4.2.11 on 2024-05-15 23:47
2
+
3
+ from django.db import migrations
4
+ from edc_constants.constants import YES
5
+
6
+
7
+ def update_fasting_duration(apps, schema_editor):
8
+ model_cls = apps.get_model("meta_subject.glucosefbg")
9
+ model_cls.objects.filter(fasting_duration_estimated=YES).update(fasting_duration_str="8h")
10
+
11
+
12
+ class Migration(migrations.Migration):
13
+
14
+ dependencies = [
15
+ ("meta_subject", "0198_alter_glucosefbg_fasting_duration_estimated_and_more"),
16
+ ]
17
+
18
+ operations = [migrations.RunPython(update_fasting_duration)]
@@ -0,0 +1,43 @@
1
+ # Generated by Django 4.2.11 on 2024-05-16 00:07
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0199_auto_20240516_0247"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RenameField(
14
+ model_name="bloodresultsins",
15
+ old_name="fasting_duration_minutes",
16
+ new_name="fasting_duration_delta",
17
+ ),
18
+ migrations.RenameField(
19
+ model_name="glucose",
20
+ old_name="fasting_duration_minutes",
21
+ new_name="fasting_duration_delta",
22
+ ),
23
+ migrations.RenameField(
24
+ model_name="glucosefbg",
25
+ old_name="fasting_duration_minutes",
26
+ new_name="fasting_duration_delta",
27
+ ),
28
+ migrations.RenameField(
29
+ model_name="historicalbloodresultsins",
30
+ old_name="fasting_duration_minutes",
31
+ new_name="fasting_duration_delta",
32
+ ),
33
+ migrations.RenameField(
34
+ model_name="historicalglucose",
35
+ old_name="fasting_duration_minutes",
36
+ new_name="fasting_duration_delta",
37
+ ),
38
+ migrations.RenameField(
39
+ model_name="historicalglucosefbg",
40
+ old_name="fasting_duration_minutes",
41
+ new_name="fasting_duration_delta",
42
+ ),
43
+ ]
@@ -0,0 +1,58 @@
1
+ # Generated by Django 4.2.11 on 2024-05-16 00:43
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ (
10
+ "meta_subject",
11
+ "0200_rename_fasting_duration_minutes_bloodresultsins_fasting_duration_delta_and_more",
12
+ ),
13
+ ]
14
+
15
+ operations = [
16
+ migrations.AlterField(
17
+ model_name="bloodresultsins",
18
+ name="fasting_duration_delta",
19
+ field=models.DurationField(
20
+ blank=True, help_text="system calculated value", null=True
21
+ ),
22
+ ),
23
+ migrations.AlterField(
24
+ model_name="glucose",
25
+ name="fasting_duration_delta",
26
+ field=models.DurationField(
27
+ blank=True, help_text="system calculated value", null=True
28
+ ),
29
+ ),
30
+ migrations.AlterField(
31
+ model_name="glucosefbg",
32
+ name="fasting_duration_delta",
33
+ field=models.DurationField(
34
+ blank=True, help_text="system calculated value", null=True
35
+ ),
36
+ ),
37
+ migrations.AlterField(
38
+ model_name="historicalbloodresultsins",
39
+ name="fasting_duration_delta",
40
+ field=models.DurationField(
41
+ blank=True, help_text="system calculated value", null=True
42
+ ),
43
+ ),
44
+ migrations.AlterField(
45
+ model_name="historicalglucose",
46
+ name="fasting_duration_delta",
47
+ field=models.DurationField(
48
+ blank=True, help_text="system calculated value", null=True
49
+ ),
50
+ ),
51
+ migrations.AlterField(
52
+ model_name="historicalglucosefbg",
53
+ name="fasting_duration_delta",
54
+ field=models.DurationField(
55
+ blank=True, help_text="system calculated value", null=True
56
+ ),
57
+ ),
58
+ ]
@@ -0,0 +1,32 @@
1
+ # Generated by Django 4.2.11 on 2024-05-16 00:15
2
+ from django.db import migrations
3
+ from edc_model.utils import duration_hm_to_timedelta
4
+ from tqdm import tqdm
5
+
6
+
7
+ def update_duration(apps, schema_editor):
8
+ for model in [
9
+ "meta_subject.glucosefbg",
10
+ "meta_subject.glucose",
11
+ "meta_subject.bloodresultsins",
12
+ ]:
13
+ model_cls = apps.get_model(model)
14
+ qs = model_cls.objects.all()
15
+ total = qs.count()
16
+ for obj in tqdm(qs, total=total):
17
+ if obj.fasting_duration_str:
18
+ tdelta = duration_hm_to_timedelta(obj.fasting_duration_str)
19
+ obj.fasting_duration_delta = tdelta
20
+ obj.save()
21
+
22
+
23
+ class Migration(migrations.Migration):
24
+
25
+ dependencies = [
26
+ (
27
+ "meta_subject",
28
+ "0201_alter_bloodresultsins_fasting_duration_delta_and_more",
29
+ ),
30
+ ]
31
+
32
+ operations = [migrations.RunPython(update_duration)]
@@ -0,0 +1,67 @@
1
+ # Generated by Django 4.2.11 on 2024-05-16 01:21
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0202_auto_20240516_0315"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name="bloodresultsins",
15
+ name="fasting_duration_delta",
16
+ field=models.DurationField(
17
+ blank=True,
18
+ help_text="system calculated to microseconds. (hours=microseconds/3.6e+9)",
19
+ null=True,
20
+ ),
21
+ ),
22
+ migrations.AlterField(
23
+ model_name="glucose",
24
+ name="fasting_duration_delta",
25
+ field=models.DurationField(
26
+ blank=True,
27
+ help_text="system calculated to microseconds. (hours=microseconds/3.6e+9)",
28
+ null=True,
29
+ ),
30
+ ),
31
+ migrations.AlterField(
32
+ model_name="glucosefbg",
33
+ name="fasting_duration_delta",
34
+ field=models.DurationField(
35
+ blank=True,
36
+ help_text="system calculated to microseconds. (hours=microseconds/3.6e+9)",
37
+ null=True,
38
+ ),
39
+ ),
40
+ migrations.AlterField(
41
+ model_name="historicalbloodresultsins",
42
+ name="fasting_duration_delta",
43
+ field=models.DurationField(
44
+ blank=True,
45
+ help_text="system calculated to microseconds. (hours=microseconds/3.6e+9)",
46
+ null=True,
47
+ ),
48
+ ),
49
+ migrations.AlterField(
50
+ model_name="historicalglucose",
51
+ name="fasting_duration_delta",
52
+ field=models.DurationField(
53
+ blank=True,
54
+ help_text="system calculated to microseconds. (hours=microseconds/3.6e+9)",
55
+ null=True,
56
+ ),
57
+ ),
58
+ migrations.AlterField(
59
+ model_name="historicalglucosefbg",
60
+ name="fasting_duration_delta",
61
+ field=models.DurationField(
62
+ blank=True,
63
+ help_text="system calculated to microseconds. (hours=microseconds/3.6e+9)",
64
+ null=True,
65
+ ),
66
+ ),
67
+ ]
@@ -0,0 +1,27 @@
1
+ # Generated by Django 4.2.11 on 2024-05-16 01:55
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("meta_subject", "0203_alter_bloodresultsins_fasting_duration_delta_and_more"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name="glucosefbg",
15
+ name="repeat_fbg_date",
16
+ field=models.DateField(
17
+ blank=True, help_text="Date should be within 1 week of report date", null=True
18
+ ),
19
+ ),
20
+ migrations.AddField(
21
+ model_name="historicalglucosefbg",
22
+ name="repeat_fbg_date",
23
+ field=models.DateField(
24
+ blank=True, help_text="Date should be within 1 week of report date", null=True
25
+ ),
26
+ ),
27
+ ]