meta-edc 0.3.15__py3-none-any.whl → 0.3.50__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (333) hide show
  1. meta_ae/action_items.py +2 -2
  2. meta_ae/migrations/0017_auto_20221130_2257.py +12 -7
  3. meta_ae/tests/holidays.csv +1 -1
  4. meta_analytics/README.rst +17 -0
  5. meta_analytics/dataframes/__init__.py +19 -0
  6. meta_analytics/dataframes/constants.py +33 -0
  7. meta_analytics/dataframes/enrolled/__init__.py +1 -0
  8. meta_analytics/dataframes/enrolled/get_glucose_df.py +122 -0
  9. meta_analytics/dataframes/get_eos_df.py +26 -0
  10. meta_analytics/dataframes/get_last_imp_visits_df.py +101 -0
  11. meta_analytics/dataframes/glucose_endpoints/__init__.py +2 -0
  12. meta_analytics/dataframes/glucose_endpoints/endpoint_by_date.py +183 -0
  13. meta_analytics/dataframes/glucose_endpoints/glucose_endpoints_by_date.py +531 -0
  14. meta_analytics/dataframes/screening/__init__.py +2 -0
  15. meta_analytics/dataframes/screening/get_glucose_tested_only_df.py +20 -0
  16. meta_analytics/dataframes/screening/get_screening_df.py +163 -0
  17. meta_analytics/dataframes/utils.py +65 -0
  18. meta_analytics/get_tables.py +81 -0
  19. meta_analytics/tables/__init__.py +2 -0
  20. meta_analytics/tables/eligible.py +106 -0
  21. meta_analytics/tables/enrolled/__init__.py +0 -0
  22. meta_analytics/tables/enrolled/glucose.py +28 -0
  23. meta_analytics/tables/has_dm.py +61 -0
  24. meta_analytics/tests/__init__.py +0 -0
  25. meta_analytics/tests/test_endpoints_by_date.py +94 -0
  26. meta_auth/auth_objects.py +22 -0
  27. meta_auth/auths.py +18 -3
  28. meta_consent/action_items.py +18 -1
  29. meta_consent/admin/__init__.py +1 -0
  30. meta_consent/admin/subject_consent_v1_ext_admin.py +45 -0
  31. meta_consent/baker_recipes.py +1 -0
  32. meta_consent/consents.py +20 -1
  33. meta_consent/constants.py +1 -0
  34. meta_consent/forms/__init__.py +1 -0
  35. meta_consent/forms/subject_consent_v1_ext_form.py +16 -0
  36. meta_consent/locale/lg/LC_MESSAGES/django.po +69 -0
  37. meta_consent/locale/sw/LC_MESSAGES/django.po +12 -12
  38. meta_consent/migrations/0026_historicalsubjectconsentv1ext_subjectconsentv1ext.py +544 -0
  39. meta_consent/migrations/0027_auto_20250111_0344.py +30 -0
  40. meta_consent/models/__init__.py +1 -0
  41. meta_consent/models/signals.py +18 -0
  42. meta_consent/models/subject_consent_v1_ext.py +29 -0
  43. meta_consent/tests/holidays.csv +1 -1
  44. meta_dashboard/locale/lg/LC_MESSAGES/django.po +30 -0
  45. meta_dashboard/locale/sw/LC_MESSAGES/django.po +11 -2
  46. meta_dashboard/navbars.py +3 -1
  47. meta_dashboard/templates/meta_dashboard/bootstrap3/buttons/eligibility_button.html +1 -1
  48. meta_dashboard/templates/meta_dashboard/bootstrap3/buttons/screening_button.html +1 -1
  49. meta_dashboard/templates/meta_dashboard/bootstrap3/subject/dashboard/sidebar.html +24 -0
  50. meta_dashboard/templates/meta_dashboard/bootstrap3/subject/dashboard.html +3 -0
  51. meta_dashboard/templatetags/meta_dashboard_extras.py +1 -1
  52. meta_dashboard/tests/holidays.csv +1 -1
  53. meta_dashboard/tests/urls.py +0 -1
  54. meta_dashboard/view_utils/__init__.py +6 -0
  55. meta_dashboard/view_utils/subject_screening_button.py +2 -2
  56. meta_dashboard/views/subject/dashboard/dashboard_view.py +38 -0
  57. meta_edc/__init__.py +7 -0
  58. meta_edc/celery.py +4 -13
  59. meta_edc/celery_live.py +18 -0
  60. meta_edc/celery_uat.py +24 -0
  61. meta_edc/management/commands/update_forms_reference.py +6 -2
  62. meta_edc/migrations/__init__.py +0 -0
  63. meta_edc/navbars.py +2 -1
  64. meta_edc/settings/debug.py +10 -2
  65. meta_edc/settings/defaults.py +58 -43
  66. meta_edc/templates/meta_edc/bootstrap3/home.html +5 -2
  67. meta_edc/tests/tests/test_endpoints.py +2 -0
  68. meta_edc/urls.py +4 -1
  69. meta_edc/wsgi.py +1 -1
  70. meta_edc/wsgi_live.py +1 -1
  71. meta_edc/wsgi_uat.py +1 -1
  72. meta_edc-0.3.50.dist-info/AUTHORS +0 -0
  73. meta_edc-0.3.50.dist-info/METADATA +766 -0
  74. {meta_edc-0.3.15.dist-info → meta_edc-0.3.50.dist-info}/RECORD +316 -127
  75. {meta_edc-0.3.15.dist-info → meta_edc-0.3.50.dist-info}/WHEEL +1 -1
  76. {meta_edc-0.3.15.dist-info → meta_edc-0.3.50.dist-info}/top_level.txt +1 -0
  77. meta_pharmacy/admin/__init__.py +2 -0
  78. meta_pharmacy/admin/rx_admin.py +75 -0
  79. meta_pharmacy/admin/substitutions_admin.py +67 -0
  80. meta_pharmacy/admin_site.py +9 -0
  81. meta_pharmacy/apps.py +5 -0
  82. meta_pharmacy/constants.py +10 -0
  83. meta_pharmacy/forms/__init__.py +2 -0
  84. meta_pharmacy/forms/rx_form.py +16 -0
  85. meta_pharmacy/forms/substitutions_form.py +54 -0
  86. meta_pharmacy/label_configs.py +30 -0
  87. meta_pharmacy/labels/__init__.py +5 -0
  88. meta_pharmacy/labels/draw_label_for_subject_with_barcode.py +62 -0
  89. meta_pharmacy/labels/draw_label_for_subject_with_code128.py +14 -0
  90. meta_pharmacy/labels/draw_label_with_test_data.py +26 -0
  91. meta_pharmacy/labels/label_data.py +14 -0
  92. meta_pharmacy/labels/print_sheets.py +97 -0
  93. meta_pharmacy/list_data.py +8 -0
  94. meta_pharmacy/management/__init__.py +0 -0
  95. meta_pharmacy/management/commands/__init__.py +0 -0
  96. meta_pharmacy/management/commands/update_initial_pharmacy_data.py +10 -0
  97. meta_pharmacy/migrations/0002_initial.py +695 -0
  98. meta_pharmacy/migrations/0003_auto_20240909_2335.py +64 -0
  99. meta_pharmacy/migrations/0004_alter_historicalsubstitutions_report_datetime_and_more.py +23 -0
  100. meta_pharmacy/migrations/0005_auto_20240911_0352.py +17 -0
  101. meta_pharmacy/migrations/0006_lotnumber_label.py +289 -0
  102. meta_pharmacy/migrations/0007_lotnumber_medication.py +24 -0
  103. meta_pharmacy/migrations/0008_remove_lotnumber_medication_and_more.py +390 -0
  104. meta_pharmacy/migrations/0009_remove_historicalrx_slug.py +17 -0
  105. meta_pharmacy/models/__init__.py +3 -0
  106. meta_pharmacy/models/label_data.py +38 -0
  107. meta_pharmacy/models/rx.py +18 -0
  108. meta_pharmacy/models/rx_label.py +39 -0
  109. meta_pharmacy/models/substitutions.py +88 -0
  110. meta_pharmacy/urls.py +8 -0
  111. meta_pharmacy/utils/__init__.py +1 -0
  112. meta_pharmacy/utils/update_initial_pharmacy_data.py +146 -0
  113. meta_prn/action_items.py +9 -1
  114. meta_prn/admin/pregnancy_notification_admin.py +6 -2
  115. meta_prn/migrations/0034_auto_20220630_1110.py +3 -3
  116. meta_prn/migrations/0035_auto_20220630_1140.py +59 -56
  117. meta_prn/tests/tests/test_dm_referral.py +3 -6
  118. meta_reports/__init__.py +1 -0
  119. meta_reports/admin/__init__.py +15 -0
  120. meta_reports/admin/dbviews/__init__.py +14 -0
  121. meta_reports/admin/dbviews/glucose_summary_admin.py +116 -0
  122. meta_reports/admin/dbviews/imp_substitutions_admin.py +101 -0
  123. meta_reports/admin/dbviews/missing_screening_ogtt_admin/__init__.py +2 -0
  124. meta_reports/admin/dbviews/missing_screening_ogtt_admin/note_model_admin.py +53 -0
  125. meta_reports/admin/dbviews/missing_screening_ogtt_admin/unmanaged_model_admin.py +84 -0
  126. meta_reports/admin/dbviews/on_study_missing_lab_values_admin/__init__.py +1 -0
  127. meta_reports/admin/dbviews/on_study_missing_lab_values_admin/unmanaged_model_admin.py +13 -0
  128. meta_reports/admin/dbviews/on_study_missing_values_admin/__init__.py +1 -0
  129. meta_reports/admin/dbviews/on_study_missing_values_admin/unmanaged_model_admin.py +13 -0
  130. meta_reports/admin/dbviews/patient_history_missing_baseline_cd4_admin.py +58 -0
  131. meta_reports/admin/dbviews/unattended_three_in_row2_admin.py +47 -0
  132. meta_reports/admin/dbviews/unattended_three_in_row_admin.py +35 -0
  133. meta_reports/admin/dbviews/unattended_two_in_row_admin.py +34 -0
  134. meta_reports/admin/endpoints_admin.py +14 -0
  135. meta_reports/admin/endpoints_all_admin.py +13 -0
  136. meta_reports/admin/last_imp_refill_admin.py +181 -0
  137. meta_reports/admin/list_filters.py +30 -0
  138. meta_reports/admin/modeladmin_mixins.py +112 -0
  139. meta_reports/admin_site.py +5 -0
  140. meta_reports/apps.py +1 -16
  141. meta_reports/forms/__init__.py +1 -0
  142. meta_reports/forms/missing_ogtt_note_form.py +33 -0
  143. meta_reports/management/__init__.py +0 -0
  144. meta_reports/management/commands/__init__.py +0 -0
  145. meta_reports/management/commands/generate_endpoints.py +13 -0
  146. meta_reports/migrations/0001_initial.py +87 -0
  147. meta_reports/migrations/0002_patienthistorymissingbaselinecd4_and_more.py +64 -0
  148. meta_reports/migrations/0003_auto_20240618_0505.py +12 -0
  149. meta_reports/migrations/0004_alter_patienthistorymissingbaselinecd4_table.py +17 -0
  150. meta_reports/migrations/0005_endpoints.py +47 -0
  151. meta_reports/migrations/0006_endpoints_baseline_datetime.py +18 -0
  152. meta_reports/migrations/0007_alter_endpoints_endpoint_label_and_more.py +43 -0
  153. meta_reports/migrations/0008_alter_endpoints_endpoint_label.py +18 -0
  154. meta_reports/migrations/0009_alter_endpoints_options.py +21 -0
  155. meta_reports/migrations/0010_alter_patienthistorymissingbaselinecd4_options_and_more.py +49 -0
  156. meta_reports/migrations/0011_auto_20240813_0156.py +54 -0
  157. meta_reports/migrations/0012_auto_20240813_1516.py +48 -0
  158. meta_reports/migrations/0013_auto_20240813_1516.py +48 -0
  159. meta_reports/migrations/0014_auto_20240813_1517.py +48 -0
  160. meta_reports/migrations/0015_alter_endpoints_site.py +22 -0
  161. meta_reports/migrations/0016_missingscreeningogtt.py +47 -0
  162. meta_reports/migrations/0017_auto_20240819_1711.py +166 -0
  163. meta_reports/migrations/0018_auto_20240819_1713.py +54 -0
  164. meta_reports/migrations/0019_auto_20240819_1721.py +54 -0
  165. meta_reports/migrations/0020_auto_20240819_1811.py +54 -0
  166. meta_reports/migrations/0021_auto_20240819_1817.py +54 -0
  167. meta_reports/migrations/0022_auto_20240819_1832.py +54 -0
  168. meta_reports/migrations/0023_endpoints_meta_report_subject_a56b22_idx.py +20 -0
  169. meta_reports/migrations/0024_glucosesummary.py +38 -0
  170. meta_reports/migrations/0025_auto_20240822_0115.py +87 -0
  171. meta_reports/migrations/0026_auto_20240822_0120.py +54 -0
  172. meta_reports/migrations/0027_auto_20240822_0140.py +54 -0
  173. meta_reports/migrations/0028_alter_glucosesummary_options.py +22 -0
  174. meta_reports/migrations/0029_auto_20240822_0149.py +54 -0
  175. meta_reports/migrations/0030_auto_20240822_1637.py +54 -0
  176. meta_reports/migrations/0031_endpointsproxy.py +25 -0
  177. meta_reports/migrations/0032_alter_endpointsproxy_options.py +21 -0
  178. meta_reports/migrations/0033_auto_20240823_0012.py +54 -0
  179. meta_reports/migrations/0034_auto_20240823_1642.py +54 -0
  180. meta_reports/migrations/0035_historicalmissingogttnote_missingogttnote.py +457 -0
  181. meta_reports/migrations/0036_historicalmissingogttnote_fasting_and_more.py +86 -0
  182. meta_reports/migrations/0037_historicalmissingogttnote_result_status_and_more.py +51 -0
  183. meta_reports/migrations/0038_alter_historicalmissingogttnote_fasting_and_more.py +33 -0
  184. meta_reports/migrations/0039_onstudymissingvalues.py +44 -0
  185. meta_reports/migrations/0040_auto_20240824_0412.py +282 -0
  186. meta_reports/migrations/0041_auto_20240828_2229.py +14 -0
  187. meta_reports/migrations/0042_onstudymissinglabvalues.py +43 -0
  188. meta_reports/migrations/0043_auto_20240828_2309.py +88 -0
  189. meta_reports/migrations/0044_auto_20240828_2323.py +93 -0
  190. meta_reports/migrations/0045_auto_20240829_0248.py +54 -0
  191. meta_reports/migrations/0046_auto_20240829_0250.py +54 -0
  192. meta_reports/migrations/0047_impsubstitutions.py +56 -0
  193. meta_reports/migrations/0048_auto_20240909_2338.py +48 -0
  194. meta_reports/migrations/0049_auto_20240911_0327.py +54 -0
  195. meta_reports/migrations/0050_alter_endpoints_created.py +19 -0
  196. meta_reports/migrations/0051_remove_endpoints_baseline_datetime_and_more.py +40 -0
  197. meta_reports/migrations/0052_lastimpvisit.py +57 -0
  198. meta_reports/migrations/0053_rename_lastimpvisit_lastimprefill_and_more.py +31 -0
  199. meta_reports/models/__init__.py +16 -0
  200. meta_reports/models/dbviews/README +14 -0
  201. meta_reports/models/dbviews/__init__.py +9 -0
  202. meta_reports/models/dbviews/glucose_summary/__init__.py +2 -0
  203. meta_reports/models/dbviews/glucose_summary/unmanaged_model.py +35 -0
  204. meta_reports/models/dbviews/glucose_summary/view_definition.py +28 -0
  205. meta_reports/models/dbviews/imp_substitutions/__init__.py +1 -0
  206. meta_reports/models/dbviews/imp_substitutions/unmanaged_model.py +41 -0
  207. meta_reports/models/dbviews/imp_substitutions/view_definition.py +21 -0
  208. meta_reports/models/dbviews/missing_screening_ogtt/__init__.py +2 -0
  209. meta_reports/models/dbviews/missing_screening_ogtt/note_model.py +57 -0
  210. meta_reports/models/dbviews/missing_screening_ogtt/unmanaged_model.py +41 -0
  211. meta_reports/models/dbviews/missing_screening_ogtt/view_definition.py +20 -0
  212. meta_reports/models/dbviews/on_study_missing_lab_values/__init__.py +1 -0
  213. meta_reports/models/dbviews/on_study_missing_lab_values/qa_cases.py +53 -0
  214. meta_reports/models/dbviews/on_study_missing_lab_values/unmanged_model.py +20 -0
  215. meta_reports/models/dbviews/on_study_missing_lab_values/view_definition.py +17 -0
  216. meta_reports/models/dbviews/on_study_missing_values/__init__.py +1 -0
  217. meta_reports/models/dbviews/on_study_missing_values/qa_cases.py +54 -0
  218. meta_reports/models/dbviews/on_study_missing_values/unmanged_model.py +20 -0
  219. meta_reports/models/dbviews/on_study_missing_values/view_definition.py +17 -0
  220. meta_reports/models/dbviews/patient_history_missing_baseline_cd4/__init__.py +1 -0
  221. meta_reports/models/dbviews/patient_history_missing_baseline_cd4/unmanaged_model.py +31 -0
  222. meta_reports/models/dbviews/patient_history_missing_baseline_cd4/view_definition.py +21 -0
  223. meta_reports/models/dbviews/unattended_three_in_row/__init__.py +1 -0
  224. meta_reports/models/dbviews/unattended_three_in_row/unmanaged_model.py +29 -0
  225. meta_reports/models/dbviews/unattended_three_in_row/view_definition.py +31 -0
  226. meta_reports/models/dbviews/unattended_three_in_row2/__init__.py +1 -0
  227. meta_reports/models/dbviews/unattended_three_in_row2/unmanaged_model.py +29 -0
  228. meta_reports/models/dbviews/unattended_three_in_row2/view_definition.py +50 -0
  229. meta_reports/models/dbviews/unattended_two_in_row/__init__.py +1 -0
  230. meta_reports/models/dbviews/unattended_two_in_row/unmanaged_model.py +27 -0
  231. meta_reports/models/dbviews/unattended_two_in_row/view_definition.py +30 -0
  232. meta_reports/models/endpoints.py +31 -0
  233. meta_reports/models/endpoints_proxy.py +11 -0
  234. meta_reports/models/last_imp_refill.py +34 -0
  235. meta_reports/tasks.py +12 -0
  236. meta_reports/templates/meta_reports/columns/subject_identifier_column.html +1 -0
  237. meta_reports/templates/meta_reports/endpoints_all_change_list_note.html +12 -0
  238. meta_reports/templates/meta_reports/endpoints_change_list_note.html +12 -0
  239. meta_reports/tests/test_sql_gen.py +5 -0
  240. meta_reports/urls.py +8 -0
  241. meta_reports/utils.py +0 -0
  242. meta_screening/admin/subject_screening_admin.py +1 -0
  243. meta_screening/migrations/0067_alter_historicalscreeningpartone_report_datetime_and_more.py +84 -0
  244. meta_screening/tests/holidays.csv +1 -1
  245. meta_screening/tests/meta_test_case_mixin.py +15 -0
  246. meta_sites/tests/test_sites.py +1 -1
  247. meta_subject/action_items.py +2 -2
  248. meta_subject/admin/__init__.py +2 -1
  249. meta_subject/admin/birth_outcome_admin.py +2 -0
  250. meta_subject/admin/blood_results/__init__.py +1 -1
  251. meta_subject/admin/blood_results/{blood_results_lipid_admin.py → blood_results_lipids_admin.py} +7 -7
  252. meta_subject/admin/diabetes/__init__.py +1 -1
  253. meta_subject/admin/diabetes/dm_endpoint_admin.py +35 -0
  254. meta_subject/admin/glucose_fbg_admin.py +4 -0
  255. meta_subject/admin/other_arv_regimens_admin.py +2 -0
  256. meta_subject/admin/study_medication_admin.py +10 -0
  257. meta_subject/form_validators/__init__.py +1 -1
  258. meta_subject/form_validators/dm_endpoint_form_validator.py +35 -0
  259. meta_subject/forms/__init__.py +2 -2
  260. meta_subject/forms/blood_results/__init__.py +1 -1
  261. meta_subject/forms/blood_results/{blood_results_lipid_form.py → blood_results_lipids_form.py} +5 -5
  262. meta_subject/forms/diabetes/__init__.py +1 -2
  263. meta_subject/forms/diabetes/dm_endpoint_form.py +13 -0
  264. meta_subject/forms/study_medication_form.py +35 -0
  265. meta_subject/locale/lg/LC_MESSAGES/django.po +470 -0
  266. meta_subject/locale/sw/LC_MESSAGES/django.po +191 -89
  267. meta_subject/metadata_rules/metadata_rules.py +7 -0
  268. meta_subject/metadata_rules/predicates.py +45 -8
  269. meta_subject/migrations/0107_auto_20220415_0043.py +28 -22
  270. meta_subject/migrations/0126_auto_20220719_2142.py +4 -4
  271. meta_subject/migrations/0131_auto_20220722_0411.py +28 -23
  272. meta_subject/migrations/0132_auto_20220722_1825.py +10 -6
  273. meta_subject/migrations/0135_auto_20220722_2212.py +39 -35
  274. meta_subject/migrations/0150_auto_20220914_0039.py +15 -11
  275. meta_subject/migrations/0207_alter_historicalphysicalexam_waist_circumference_and_more.py +46 -0
  276. meta_subject/migrations/0208_birthoutcomes_crf_status_and_more.py +62 -0
  277. meta_subject/migrations/0209_remove_historicaldmdxresult_dm_diagnosis_and_more.py +37 -0
  278. meta_subject/migrations/0210_remove_dmdxresult_dm_diagnosis_and_more.py +123 -0
  279. meta_subject/migrations/0211_dmendpoint_endpoint_reached_and_more.py +45 -0
  280. meta_subject/migrations/0212_auto_20240827_2222.py +23 -0
  281. meta_subject/migrations/0213_rename_bloodresultslipid_bloodresultslipids_and_more.py +35 -0
  282. meta_subject/migrations/0214_historicalstudymedication_stock_codes_and_more.py +44 -0
  283. meta_subject/migrations/0215_alter_historicalstudymedication_stock_codes_and_more.py +46 -0
  284. meta_subject/model_mixins/arv_history_model_mixin.py +3 -3
  285. meta_subject/models/__init__.py +3 -2
  286. meta_subject/models/birth_outcomes.py +6 -1
  287. meta_subject/models/blood_results/__init__.py +1 -1
  288. meta_subject/models/blood_results/{blood_results_lipid.py → blood_results_lipids.py} +3 -3
  289. meta_subject/models/diabetes/__init__.py +1 -2
  290. meta_subject/models/diabetes/dm_endpoint.py +61 -0
  291. meta_subject/models/glucose.py +4 -1
  292. meta_subject/models/physical_exam.py +1 -0
  293. meta_subject/models/signals.py +19 -0
  294. meta_subject/models/todo.txt +1 -1
  295. meta_subject/static/meta_subject/slider.css +1 -1
  296. meta_subject/templates/meta_subject/endpoint_review_instructions.html +1 -1
  297. meta_subject/templates/meta_subject/widgets/slider.html +0 -1
  298. meta_subject/tests/holidays.csv +1 -1
  299. meta_subject/tests/tests/test_medication_adherence.py +5 -1
  300. meta_subject/tests/tests/test_metadata_rules.py +2 -2
  301. meta_subject/tests/tests/test_mnsi.py +212 -121
  302. meta_subject/tests/tests/test_sf12.py +0 -12
  303. meta_visit_schedule/constants.py +4 -0
  304. meta_visit_schedule/tests/tests/test_schedule.py +4 -0
  305. meta_visit_schedule/visit_schedules/phase_three/crfs.py +75 -13
  306. meta_visit_schedule/visit_schedules/phase_three/requisitions.py +12 -0
  307. meta_visit_schedule/visit_schedules/phase_three/schedule.py +65 -2
  308. meta_visit_schedule/visit_schedules/phase_three/schedule_dm_referral.py +1 -1
  309. tests/etc/randomization_list.csv +1 -1
  310. {meta_edc/tests → tests}/etc/randomization_list_phase_three.csv +4 -4
  311. tests/holidays.csv +1 -1
  312. {meta_edc/tests → tests}/test_settings.py +16 -6
  313. meta_edc/tests/etc/user-aes-local.key +0 -1
  314. meta_edc/tests/etc/user-aes-restricted.key +0 -0
  315. meta_edc/tests/etc/user-rsa-local-private.pem +0 -27
  316. meta_edc/tests/etc/user-rsa-local-public.pem +0 -9
  317. meta_edc/tests/etc/user-rsa-restricted-private.pem +0 -27
  318. meta_edc/tests/etc/user-rsa-restricted-public.pem +0 -9
  319. meta_edc/tests/etc/user-salt-local.key +0 -0
  320. meta_edc/tests/etc/user-salt-restricted.key +0 -0
  321. meta_edc-0.3.15.dist-info/METADATA +0 -88
  322. meta_reports/tests/holidays.csv +0 -15
  323. meta_subject/admin/diabetes/dm_diagnosis_admin.py +0 -89
  324. meta_subject/form_validators/dm_diagnosis_form_validator.py +0 -38
  325. meta_subject/form_validators/dm_dx_result_form_validator.py +0 -7
  326. meta_subject/forms/diabetes/dm_diagnosis_form.py +0 -13
  327. meta_subject/forms/diabetes/dm_dx_result_form.py +0 -11
  328. meta_subject/models/diabetes/dm_diagnosis.py +0 -50
  329. meta_subject/models/diabetes/dm_dx_result.py +0 -70
  330. /meta_edc-0.3.15.dist-info/AUTHORS → /meta_analytics/__init__.py +0 -0
  331. /meta_pharmacy/models.py → /meta_analytics/constants.py +0 -0
  332. /meta_reports/models.py → /meta_analytics/notebooks/cleaning/__init__.py +0 -0
  333. {meta_edc-0.3.15.dist-info → meta_edc-0.3.50.dist-info}/LICENSE +0 -0
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2023-09-07 09:35-0500\n"
11
+ "POT-Creation-Date: 2024-11-19 23:35+0300\n"
12
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,6 +17,15 @@ msgstr ""
17
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
18
  "Content-Transfer-Encoding: 8bit\n"
19
19
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
- #: views/subject/dashboard/dashboard_view.py:9
20
+
21
+ #: meta_dashboard/view_utils/subject_screening_button.py:42
22
+ msgid "View"
23
+ msgstr ""
24
+
25
+ #: meta_dashboard/view_utils/subject_screening_button.py:44
26
+ msgid "Edit"
27
+ msgstr ""
28
+
29
+ #: meta_dashboard/views/subject/dashboard/dashboard_view.py:17
21
30
  msgid "Audit"
22
31
  msgstr ""
meta_dashboard/navbars.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from edc_adverse_event.navbars import ae_navbar_item, tmg_navbar_item
2
2
  from edc_data_manager.navbar_item import dm_navbar_item
3
3
  from edc_navbar import Navbar, NavbarItem, site_navbars
4
+ from edc_pharmacy.navbars import pharmacy_navbar_item
4
5
  from edc_review_dashboard.navbars import navbar_item as review_navbar_item
5
6
 
6
7
  no_url_namespace = False # True if settings.APP_NAME == "meta_dashboard" else False
@@ -32,9 +33,10 @@ navbar.register(
32
33
  )
33
34
  )
34
35
 
36
+
37
+ navbar.register(pharmacy_navbar_item)
35
38
  navbar.register(review_navbar_item)
36
39
  navbar.register(tmg_navbar_item)
37
40
  navbar.register(ae_navbar_item)
38
41
  navbar.register(dm_navbar_item)
39
-
40
42
  site_navbars.register(navbar)
@@ -12,4 +12,4 @@
12
12
  </ul>
13
13
  {% endif %}
14
14
  </div>
15
- {% endif %}
15
+ {% endif %}
@@ -12,4 +12,4 @@
12
12
  class="btn btn-sm btn-{% if p3 == YES %}success{% elif p1 == YES and p2 == YES and p3 == TBD %}warning{% else %}default{% endif %}"
13
13
  {% if p3_enabled %}href="{{ href_p3 }}"{% else %} disabled {% endif %}>
14
14
  <i class="fas fa-pencil-alt fa-sm"></i> P3
15
- </a>
15
+ </a>
@@ -0,0 +1,24 @@
1
+ {% extends 'edc_subject_dashboard/bootstrap3/dashboard/sidebar.html' %}
2
+ {% load edc_subject_dashboard_extras %}
3
+
4
+ {% block consents %}
5
+ {{ block.super }}
6
+ {% if subject_consent_v1_ext %}
7
+ <table class="table table-condensed">
8
+ <thead></thead>
9
+ <tbody>
10
+ <tr>
11
+ <td class="{% if subject_consent_v1_ext %}default{% else %}warning{% endif %}">
12
+ {% render_subject_consent_dashboard_button subject_consent_v1_ext appointment %}
13
+ </td>
14
+ <td class="{% if subject_consent_v1_ext %}default{% else %}warning{% endif %}">
15
+ <span class="h6">{{ subject_consent_v1_ext.verbose_name|title }}&nbsp;<span class="text {% if subject_consent_v1_ext.agrees_to_extension == YES %}text-success{% else %}text-danger{% endif %}">{{ subject_consent_v1_ext.agrees_to_extension }}</span>
16
+ <span class="text text-muted">{{ subject_consent_v1_ext.report_datetime|date:"SHORT_DATE_FORMAT"}}</span>
17
+ </span>
18
+ </td>
19
+ </tr>
20
+ </tbody>
21
+ </table>
22
+ {% endif %}
23
+
24
+ {% endblock consents %}
@@ -9,3 +9,6 @@
9
9
  {% include "meta_dashboard/bootstrap3/subject/dashboard/top_bar.html" %}
10
10
 
11
11
  {% endblock top_bar %}
12
+
13
+
14
+ {% block side_bar %}{% include 'meta_dashboard/bootstrap3/subject/dashboard/sidebar.html' %}{% endblock side_bar %}
@@ -9,7 +9,7 @@ from edc_dashboard.url_names import url_names
9
9
  from edc_dashboard.utils import get_bootstrap_version
10
10
 
11
11
  from meta_consent.models import SubjectConsent
12
- from meta_dashboard.view_utils.subject_screening_button import (
12
+ from meta_dashboard.view_utils import (
13
13
  SubjectScreeningPartOneButton,
14
14
  SubjectScreeningPartThreeButton,
15
15
  SubjectScreeningPartTwoButton,
@@ -12,4 +12,4 @@
12
12
  2019-12-01,Mawlid Day,tanzania
13
13
  2019-12-09,Independence Day,tanzania
14
14
  2019-12-25,Christmas Day,tanzania
15
- 2019-12-26,Boxing Day,tanzania
15
+ 2019-12-26,Boxing Day,tanzania
@@ -47,7 +47,6 @@ urlpatterns = [
47
47
  path("edc_export/", include("edc_export.urls")),
48
48
  path("edc_lab_dashboard/", include("edc_lab_dashboard.urls")),
49
49
  path("edc_locator/", include("edc_locator.urls")),
50
- path("edc_pharmacy_dashboard/", include("edc_pharmacy_dashboard.urls")),
51
50
  path("edc_protocol/", include("edc_protocol.urls")),
52
51
  path("edc_subject_dashboard/", include("edc_subject_dashboard.urls")),
53
52
  path("edc_visit_schedule/", include("edc_visit_schedule.urls")),
@@ -0,0 +1,6 @@
1
+ from .subject_screening_button import (
2
+ SubjectScreeningButton,
3
+ SubjectScreeningPartOneButton,
4
+ SubjectScreeningPartThreeButton,
5
+ SubjectScreeningPartTwoButton,
6
+ )
@@ -5,10 +5,10 @@ from typing import Type
5
5
 
6
6
  from django.utils.translation import gettext as _
7
7
  from edc_constants.constants import TBD, YES
8
- from edc_subject_dashboard.view_utils import ADD, CHANGE, VIEW
9
- from edc_subject_dashboard.view_utils.subject_screening_button import (
8
+ from edc_subject_dashboard.view_utils import (
10
9
  SubjectScreeningButton as BaseSubjectScreeningButton,
11
10
  )
11
+ from edc_view_utils import ADD, CHANGE, VIEW
12
12
 
13
13
  from meta_screening.models import ScreeningPartOne, ScreeningPartThree, ScreeningPartTwo
14
14
 
@@ -1,9 +1,47 @@
1
+ from typing import Any
2
+
3
+ from django.apps import apps as django_apps
4
+ from django.core.checks import messages
5
+ from django.core.exceptions import ObjectDoesNotExist
6
+ from django.urls import reverse
7
+ from django.utils.html import format_html
1
8
  from django.utils.translation import gettext_lazy as _
2
9
  from edc_subject_dashboard.views import SubjectDashboardView
3
10
 
11
+ from meta_reports.models import Endpoints, GlucoseSummary
12
+
4
13
 
5
14
  class DashboardView(SubjectDashboardView):
6
15
  consent_model = "meta_consent.subjectconsentv1"
7
16
  navbar_selected_item = "consented_subject"
8
17
  visit_model = "meta_subject.subjectvisit"
9
18
  history_button_label = _("Audit")
19
+
20
+ def get_context_data(self, **kwargs) -> dict[str, Any]:
21
+ """Add message if subject reaches DM Endpoint."""
22
+ context = super().get_context_data(**kwargs)
23
+ context.update(subject_consent_v1_ext=self.subject_consent_v1_ext)
24
+ try:
25
+ Endpoints.objects.get(subject_identifier=self.subject_identifier)
26
+ except ObjectDoesNotExist:
27
+ pass
28
+ else:
29
+ url = reverse("meta_reports_admin:meta_reports_glucosesummary_changelist")
30
+ url = f"{url}?q={self.subject_identifier}"
31
+ message = _(
32
+ format_html(
33
+ f"Subject has reached the protocol endpoint. "
34
+ f'See <A href="{url}">{GlucoseSummary._meta.verbose_name}</A>'
35
+ )
36
+ )
37
+ self.message_user(message, level=messages.WARNING)
38
+ return context
39
+
40
+ @property
41
+ def subject_consent_v1_ext(self):
42
+ model_cls = django_apps.get_model("meta_consent.subjectconsentv1ext")
43
+ try:
44
+ obj = model_cls.objects.get(subject_identifier=self.subject_identifier)
45
+ except ObjectDoesNotExist:
46
+ obj = None
47
+ return obj
meta_edc/__init__.py CHANGED
@@ -1,7 +1,14 @@
1
1
  import os
2
2
  from importlib.metadata import PackageNotFoundError, version
3
3
 
4
+ from .celery import app as celery_app
5
+
4
6
  try:
5
7
  __version__ = version(os.getcwd().split(os.sep)[-1])
6
8
  except PackageNotFoundError:
7
9
  __version__ = None
10
+
11
+
12
+ __all__ = ["celery_app", "__version__"]
13
+
14
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.debug")
meta_edc/celery.py CHANGED
@@ -1,23 +1,14 @@
1
- from __future__ import absolute_import, unicode_literals
2
-
3
1
  import os
4
2
 
5
3
  from celery import Celery
6
- from django.conf import settings
7
4
 
8
- # set the default Django settings module for the 'celery' program.
9
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings")
5
+ # load settings
6
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.debug")
10
7
 
8
+ # config celery
11
9
  app = Celery("meta_edc")
12
-
13
- # Using a string here means the worker doesn't have to serialize
14
- # the configuration object to child processes.
15
- # - namespace='CELERY' means all celery-related configuration keys
16
- # should have a `CELERY_` prefix.
17
10
  app.config_from_object("django.conf:settings", namespace="CELERY")
18
-
19
- # Load task modules from all registered Django app configs.
20
- app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
11
+ app.autodiscover_tasks()
21
12
 
22
13
 
23
14
  @app.task(bind=True)
@@ -0,0 +1,18 @@
1
+ import os
2
+
3
+ from celery import Celery
4
+
5
+ # load settings
6
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.debug")
7
+
8
+ # config celery
9
+ app = Celery("meta_edc")
10
+ app.config_from_object("django.conf:settings", namespace="CELERY")
11
+ app.autodiscover_tasks()
12
+
13
+ # app.conf.task_routes = {"*": {"queue": "live_queue"}}
14
+
15
+
16
+ @app.task(bind=True)
17
+ def debug_task(self):
18
+ print("Request: {0!r}".format(self.request))
meta_edc/celery_uat.py ADDED
@@ -0,0 +1,24 @@
1
+ import os
2
+
3
+ from celery import Celery
4
+
5
+ # from kombu import Queue
6
+
7
+ # load settings
8
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.debug")
9
+
10
+ # config celery
11
+ app = Celery("meta_edc")
12
+ app.config_from_object("django.conf:settings", namespace="CELERY")
13
+ app.autodiscover_tasks()
14
+
15
+ # app.conf.task_default_queue = "workuatq1"
16
+ # app.conf.task_queues = (Queue("workuatq1", routing_key="task.#"),)
17
+ # app.conf.task_default_exchange = "workuatq1"
18
+ # app.conf.task_default_exchange_type = "topic"
19
+ # app.conf.task_default_routing_key = "task.workuatq1"
20
+
21
+
22
+ @app.task(bind=True)
23
+ def debug_task(self):
24
+ print("Request: {0!r}".format(self.request))
@@ -20,9 +20,13 @@ def update_forms_reference(sender=None, **kwargs):
20
20
  doc_folder = os.path.join(settings.BASE_DIR, "docs")
21
21
  if not os.path.exists(doc_folder):
22
22
  os.mkdir(doc_folder)
23
- forms = FormsReference(visit_schedules=[visit_schedule], admin_site=meta_subject_admin)
23
+ forms = FormsReference(
24
+ visit_schedules=[visit_schedule],
25
+ admin_site=meta_subject_admin,
26
+ add_per_form_timestamp=False,
27
+ )
24
28
  path = os.path.join(doc_folder, "forms_reference.md")
25
- forms.to_file(path=path, overwrite=True)
29
+ forms.to_file(path=path, overwrite=True, pad=0)
26
30
 
27
31
 
28
32
  class Command(BaseCommand):
File without changes
meta_edc/navbars.py CHANGED
@@ -5,6 +5,7 @@ from edc_adverse_event.navbars import ae_navbar_item, tmg_navbar_item
5
5
  from edc_data_manager.navbar_item import dm_navbar_item
6
6
  from edc_lab_dashboard.navbars import navbar as lab_navbar
7
7
  from edc_navbar import Navbar, site_navbars
8
+ from edc_pharmacy.navbars import pharmacy_navbar_item
8
9
  from edc_review_dashboard.navbars import navbar as review_navbar
9
10
 
10
11
  from meta_dashboard.navbars import navbar as meta_dashboard_navbar
@@ -29,9 +30,9 @@ navbar.register(
29
30
  for navbar_item in review_navbar.navbar_items:
30
31
  navbar.register(navbar_item)
31
32
 
33
+ navbar.register(pharmacy_navbar_item)
32
34
  navbar.register(tmg_navbar_item)
33
35
  navbar.register(ae_navbar_item)
34
36
  navbar.register(dm_navbar_item)
35
37
 
36
-
37
38
  site_navbars.register(navbar)
@@ -8,8 +8,8 @@ print(f"Settings file {__file__}")
8
8
 
9
9
  # TZ Sites:
10
10
  # SITE_ID = SiteID(default=20) # Amana
11
- SITE_ID = SiteID(default=10) # Hindu Mandal
12
- # SITE_ID = SiteID(default=40) # Mwananyamala
11
+ # SITE_ID = SiteID(default=10) # Hindu Mandal
12
+ SITE_ID = SiteID(default=40) # Mwananyamala
13
13
  # SITE_ID = SiteID(default=50) # Mbagala
14
14
  # SITE_ID = SiteID(default=60) # Mnazi-Moja
15
15
  # SITE_ID = SiteID(default=30) # Temeke
@@ -32,3 +32,11 @@ EDC_MODEL_ADMIN_CSS_THEME = "edc_purple"
32
32
  if os.path.exists(BASE_DIR) and not os.path.exists(KEY_PATH): # noqa
33
33
  os.makedirs(KEY_PATH) # noqa
34
34
  AUTO_CREATE_KEYS = True
35
+
36
+ # if debugging, run `export DJANGO_DEBUG=True` before running runserver
37
+ # CELERY_TASK_ALWAYS_EAGER = os.getenv("DJANGO_DEBUG", "False") == "True"
38
+ # CELERY_TASK_EAGER_PROPAGATES = CELERY_TASK_ALWAYS_EAGER
39
+
40
+ EDC_PDF_REPORTS_WATERMARK_WORD = "SAMPLE"
41
+ EDC_PDF_REPORTS_WATERMARK_FONT = ("Helvetica", 100)
42
+ EDC_PHARMACY_LABEL_WATERMARK_WORD = "DO NOT USE"
@@ -2,6 +2,7 @@ import os
2
2
  import sys
3
3
  from importlib.metadata import version
4
4
  from pathlib import Path
5
+ from urllib.parse import quote
5
6
 
6
7
  import django
7
8
  import environ
@@ -33,19 +34,17 @@ env = environ.Env(
33
34
  EDC_SITES_DOMAIN_SUFFIX="meta4.clinicedc.org",
34
35
  )
35
36
 
36
- BASE_DIR = str(Path(os.path.dirname(os.path.abspath(__file__))).parent.parent)
37
- ENV_DIR = str(Path(os.path.dirname(os.path.abspath(__file__))).parent.parent)
37
+ BASE_DIR = Path(__file__).resolve().parent.parent.parent
38
+ ENV_DIR = Path(__file__).resolve().parent.parent.parent
38
39
 
39
40
  # copy your .env file from .envs/ to BASE_DIR
40
41
  if "test" in sys.argv:
41
- env.read_env(os.path.join(ENV_DIR, ".env-tests"))
42
- print(f"Reading env from {os.path.join(BASE_DIR, '.env-tests')}")
42
+ env.read_env(ENV_DIR / ".env-tests")
43
+ print(f"Reading env from {(BASE_DIR /'.env-tests')}") # noqa
43
44
  else:
44
- if not os.path.exists(os.path.join(ENV_DIR, ".env")):
45
- raise FileExistsError(
46
- f"Environment file does not exist. Got `{os.path.join(ENV_DIR, '.env')}`"
47
- )
48
- env.read_env(os.path.join(ENV_DIR, ".env"))
45
+ if not (ENV_DIR / ".env").exists():
46
+ raise FileExistsError(f"Environment file does not exist. Got `{(ENV_DIR / '.env')}`")
47
+ env.read_env(ENV_DIR / ".env")
49
48
 
50
49
 
51
50
  LOGGING_ENABLED = env("DJANGO_LOGGING_ENABLED")
@@ -66,7 +65,7 @@ LIVE_SYSTEM = env.str("DJANGO_LIVE_SYSTEM")
66
65
 
67
66
  ETC_DIR = env.str("DJANGO_ETC_FOLDER")
68
67
 
69
- TEST_DIR = os.path.join(BASE_DIR, APP_NAME, "tests")
68
+ TEST_DIR = BASE_DIR / APP_NAME / "tests"
70
69
 
71
70
  ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS")
72
71
 
@@ -91,6 +90,10 @@ INSTALLED_APPS = [
91
90
  "django.contrib.sites",
92
91
  "multisite.apps.AppConfig",
93
92
  "defender",
93
+ "sequences.apps.SequencesConfig",
94
+ # "django_celery_beat",
95
+ # "django_celery_results",
96
+ "django_db_views",
94
97
  "fontawesomefree",
95
98
  "django_crypto_fields.apps.AppConfig",
96
99
  "django_revision.apps.AppConfig",
@@ -98,6 +101,8 @@ INSTALLED_APPS = [
98
101
  "logentry_admin",
99
102
  "simple_history",
100
103
  "storages",
104
+ "django_pylabels.apps.AppConfig",
105
+ "edc_pylabels.apps.AppConfig",
101
106
  "edc_sites.apps.AppConfig",
102
107
  "edc_action_item.apps.AppConfig",
103
108
  "edc_appointment.apps.AppConfig",
@@ -139,6 +144,7 @@ INSTALLED_APPS = [
139
144
  "edc_protocol.apps.AppConfig",
140
145
  "edc_protocol_incident.apps.AppConfig",
141
146
  "edc_prn.apps.AppConfig",
147
+ "edc_qareports.apps.AppConfig",
142
148
  "edc_qol.apps.AppConfig",
143
149
  "edc_randomization.apps.AppConfig",
144
150
  "edc_refusal.apps.AppConfig",
@@ -157,6 +163,7 @@ INSTALLED_APPS = [
157
163
  "meta_dashboard.apps.AppConfig",
158
164
  "meta_labs.apps.AppConfig",
159
165
  "meta_subject.apps.AppConfig",
166
+ "meta_reports.apps.AppConfig",
160
167
  "meta_visit_schedule.apps.AppConfig",
161
168
  "meta_ae.apps.AppConfig",
162
169
  "meta_auth.apps.AppConfig",
@@ -182,6 +189,7 @@ MIDDLEWARE = [
182
189
  "django.contrib.sites.middleware.CurrentSiteMiddleware",
183
190
  "django.middleware.csrf.CsrfViewMiddleware",
184
191
  "django.contrib.auth.middleware.AuthenticationMiddleware",
192
+ "django.contrib.auth.middleware.LoginRequiredMiddleware",
185
193
  "defender.middleware.FailedLoginMiddleware",
186
194
  "django.contrib.messages.middleware.MessageMiddleware",
187
195
  "django.middleware.clickjacking.XFrameOptionsMiddleware",
@@ -228,7 +236,7 @@ if env("DATABASE_SQLITE_ENABLED"):
228
236
  DATABASES = {
229
237
  "default": {
230
238
  "ENGINE": "django.db.backends.sqlite3",
231
- "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
239
+ "NAME": BASE_DIR / "db.sqlite3",
232
240
  }
233
241
  }
234
242
 
@@ -300,6 +308,11 @@ LANGUAGE_CODE = "en-gb"
300
308
  LANGUAGE_LIST = ["sw", "en-gb", "en", "mas"]
301
309
  LANGUAGES = [(code, LANG_INFO[code]["name"]) for code in LANGUAGE_LIST]
302
310
 
311
+ # LOCALE_PATHS = [
312
+ # base_dir / "locale",
313
+ # base_dir.parent / "edc-pharmacy" / "edc_pharmacy" / "locale",
314
+ # ]
315
+
303
316
  TIME_ZONE = env.str("DJANGO_TIME_ZONE")
304
317
  DATE_INPUT_FORMATS = ["%Y-%m-%d", "%d/%m/%Y"]
305
318
  DATETIME_INPUT_FORMATS = [
@@ -342,8 +355,8 @@ if not DEBUG:
342
355
  SECURE_BROWSER_XSS_FILTER = True
343
356
 
344
357
  # edc_lab and label
345
- LABEL_TEMPLATE_FOLDER = env.str("DJANGO_LABEL_TEMPLATE_FOLDER") or os.path.join(
346
- BASE_DIR, "label_templates", "2.25x1.25in"
358
+ LABEL_TEMPLATE_FOLDER = env.str("DJANGO_LABEL_TEMPLATE_FOLDER") or (
359
+ BASE_DIR / "label_templates" / "2.25x1.25in"
347
360
  )
348
361
  CUPS_SERVERS = env.dict("DJANGO_CUPS_SERVERS")
349
362
 
@@ -390,6 +403,18 @@ EDC_MNSI_MODEL = "meta_subject.mnsi"
390
403
 
391
404
  EDC_OFFSTUDY_OFFSTUDY_MODEL = "meta_prn.endofstudy"
392
405
 
406
+ # edc-pharmacy
407
+ EDC_PDF_REPORTS_WATERMARK_WORD = env.str("EDC_PDF_REPORTS_WATERMARK_WORD")
408
+ EDC_PDF_REPORTS_WATERMARK_FONT = env.str("EDC_PDF_REPORTS_WATERMARK_FONT")
409
+ EDC_PDF_REPORTS_WATERMARK_FONTSIZE = env.int("EDC_PDF_REPORTS_WATERMARK_FONTSIZE")
410
+ EDC_PHARMACY_LABEL_WATERMARK_WORD = env.str("EDC_PHARMACY_LABEL_WATERMARK_WORD")
411
+ if EDC_PDF_REPORTS_WATERMARK_FONT:
412
+ EDC_PDF_REPORTS_WATERMARK_FONT = (
413
+ EDC_PDF_REPORTS_WATERMARK_FONT,
414
+ EDC_PDF_REPORTS_WATERMARK_FONTSIZE,
415
+ )
416
+ else:
417
+ EDC_PDF_REPORTS_WATERMARK_FONT = ()
393
418
  # edc-protocol-incident
394
419
  EDC_PROTOCOL_VIOLATION_TYPE = PROTOCOL_INCIDENT
395
420
 
@@ -407,6 +432,9 @@ EDC_RANDOMIZATION_SKIP_VERIFY_CHECKS = True
407
432
  # edc-sites
408
433
  EDC_SITES_MODULE_NAME = env.str("EDC_SITES_MODULE_NAME")
409
434
 
435
+ # meta_pharmacy
436
+ META_PHARMACY_RX_SUBSTITUTION_FILE = env.str("META_PHARMACY_RX_SUBSTITUTION_FILE")
437
+
410
438
  # django-multisite
411
439
  CACHE_MULTISITE_KEY_PREFIX = "meta4"
412
440
  SILENCED_SYSTEM_CHECKS = ["sites.E101"]
@@ -448,7 +476,7 @@ GIT_DIR = BASE_DIR
448
476
  KEY_PATH = env.str("DJANGO_KEY_FOLDER")
449
477
  AUTO_CREATE_KEYS = env("DJANGO_AUTO_CREATE_KEYS")
450
478
 
451
- EXPORT_FOLDER = env.str("DJANGO_EXPORT_FOLDER") or os.path.expanduser("~/")
479
+ EXPORT_FOLDER = env.str("DJANGO_EXPORT_FOLDER") or Path("~/").expanduser()
452
480
 
453
481
  # django_simple_history
454
482
  SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS = True
@@ -505,49 +533,36 @@ if env("AWS_ENABLED"):
505
533
  AWS_S3_OBJECT_PARAMETERS = {"CacheControl": "max-age=86400"}
506
534
  AWS_LOCATION = env.str("AWS_LOCATION")
507
535
  AWS_IS_GZIPPED = True
508
- STATICFILES_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
536
+ STORAGES = {"staticfiles": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage"}}
509
537
  STATIC_URL = f"{os.path.join(AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION)}/"
510
538
  STATIC_ROOT = ""
511
539
  elif DEBUG:
512
540
  STATIC_URL = env.str("DJANGO_STATIC_URL")
513
- STATIC_ROOT = os.path.expanduser("~/source/edc_source/meta-edc/static/")
541
+ STATIC_ROOT = Path("~/source/edc_source/meta-edc/static/").expanduser()
514
542
  else:
515
543
  # run collectstatic, check nginx LOCATION
516
544
  STATIC_URL = env.str("DJANGO_STATIC_URL")
517
545
  STATIC_ROOT = env.str("DJANGO_STATIC_ROOT")
518
546
 
519
547
  # CELERY
520
- # see docs on setting up the broker
521
548
  CELERY_ENABLED = env("CELERY_ENABLED")
522
549
  if CELERY_ENABLED:
523
- CELERY_BROKER_USER = env.str("CELERY_BROKER_USER")
524
- CELERY_BROKER_PASSWORD = env.str("CELERY_BROKER_PASSWORD")
525
- CELERY_BROKER_HOST = env.str("CELERY_BROKER_HOST")
526
- CELERY_BROKER_PORT = env.str("CELERY_BROKER_PORT")
527
- if DEBUG:
528
- CELERY_BROKER_VHOST = f"{APP_NAME}_debug"
529
- elif LIVE_SYSTEM:
530
- CELERY_BROKER_VHOST = f"{APP_NAME}_production"
531
- else:
532
- CELERY_BROKER_VHOST = f"{APP_NAME}_uat"
550
+ CELERY_CACHE_BACKEND = "default"
551
+ if env.str("DJANGO_REDIS_PASSWORD"):
533
552
  CELERY_BROKER_URL = (
534
- f"amqp://{CELERY_BROKER_USER}:{CELERY_BROKER_PASSWORD}@"
535
- f"{CELERY_BROKER_HOST}:{CELERY_BROKER_PORT}/{CELERY_BROKER_VHOST}"
553
+ f"redis://:{quote(env.str('DJANGO_REDIS_PASSWORD'), safe='')}@127.0.0.1:6379/0"
536
554
  )
537
- DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTH = 191
538
- CELERY_RESULT_BACKEND = "django-db"
539
- # CELERY_QUEUES = (
540
- # Queue('high', Exchange('high'), routing_key='high'),
541
- # Queue('normal', Exchange('normal'), routing_key='normal'),
542
- # Queue('low', Exchange('low'), routing_key='low'),
543
- # )
544
- # CELERY_DEFAULT_QUEUE = 'normal'
545
- # CELERY_DEFAULT_EXCHANGE = 'normal'
546
- # CELERY_DEFAULT_ROUTING_KEY = 'normal'
547
- # CELERY_ROUTES = {
548
- # 'edc_data_manager.tasks.*': {'queue': 'normal'},
549
- # }
550
-
555
+ CELERY_RESULT_BACKEND = (
556
+ f"redis://:{quote(env.str('DJANGO_REDIS_PASSWORD'), safe='')}@127.0.0.1:6379/0"
557
+ )
558
+ else:
559
+ CELERY_BROKER_URL = "redis://127.0.0.1:6379/0"
560
+ CELERY_RESULT_BACKEND = "redis://localhost:6379/0"
561
+ # CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers.DatabaseScheduler"
562
+ CELERY_ACCEPT_CONTENT = ["json"]
563
+ CELERY_TASK_SERIALIZER = "json"
564
+ CELERY_RESULT_SERIALIZER = "json"
565
+ CELERY_TIMEZONE = "UTC"
551
566
 
552
567
  if "test" in sys.argv:
553
568
 
@@ -56,8 +56,11 @@ a { cursor: pointer; }
56
56
  {% if perms.edc_data_manager.nav_data_manager_section %}
57
57
  <a href="{% url 'edc_data_manager:home_url' %}" class="list-group-item"><i class="fas fa-database fa-lg fa-fw"></i>&nbsp;&nbsp;&nbsp;Data Management</a>
58
58
  {% endif %}
59
- {% if perms.edc_navbar.nav_pharmacy_section %}
60
- <a href="{% url edc_randomization_url_name %}" class="list-group-item"><i class="fas fa-medkit fa-lg fa-fw"></i>&nbsp;&nbsp;&nbsp;Pharmacy</a>
59
+ {% if perms.meta_reports %}
60
+ <a href="{% url 'meta_reports:home_url' %}" class="list-group-item"><i class="fa-solid fa-stroopwafel fa-lg fa-fw"></i></i>&nbsp;&nbsp;&nbsp;QA Reports</a>
61
+ {% endif %}
62
+ {% if perms.edc_pharmacy.nav_pharmacy_section %}
63
+ <a href="{% url 'edc_pharmacy:home_url' %}" class="list-group-item"><i class="fas fa-prescription fa-lg fa-fw"></i>&nbsp;&nbsp;&nbsp;Pharmacy</a>
61
64
  {% endif %}
62
65
  {% if perms.edc_export %}
63
66
  <a href="{% url 'edc_export:home_url' %}" class="list-group-item"><i class="fas fa-file-export fa-lg fa-fw"></i>&nbsp;&nbsp;&nbsp;Export data</a>
@@ -85,8 +85,10 @@ class AdminSiteTest(MetaTestCaseMixin, WebTest):
85
85
  import_module("edc_adverse_event.auths")
86
86
  import_module("edc_appointment.auths")
87
87
  import_module("edc_consent.auths")
88
+ import_module("edc_pylabels.auths")
88
89
  import_module("edc_dashboard.auths")
89
90
  import_module("edc_data_manager.auths")
91
+ import_module("edc_qareports.auths")
90
92
  import_module("edc_export.auths")
91
93
  import_module("edc_lab.auths")
92
94
  import_module("edc_lab_dashboard.auths")
meta_edc/urls.py CHANGED
@@ -22,6 +22,7 @@ urlpatterns = [
22
22
  path("accounts/", include("edc_auth.urls_for_accounts", namespace="auth")),
23
23
  path("administration/", AdministrationView.as_view(), name="administration_url"),
24
24
  path("subject/", include("meta_dashboard.urls")),
25
+ *paths_for_urlpatterns("edc_pylabels"),
25
26
  *paths_for_urlpatterns("edc_auth"),
26
27
  *paths_for_urlpatterns("edc_action_item"),
27
28
  *paths_for_urlpatterns("edc_adverse_event"),
@@ -56,15 +57,17 @@ urlpatterns = [
56
57
  *paths_for_urlpatterns("edc_sites"),
57
58
  *paths_for_urlpatterns("edc_subject_dashboard"),
58
59
  *paths_for_urlpatterns("edc_unblinding"),
60
+ *paths_for_urlpatterns("edc_qareports"),
59
61
  *paths_for_urlpatterns("edc_visit_schedule"),
60
- # *paths_for_urlpatterns("canned_views"),
61
62
  *paths_for_urlpatterns("meta_ae"),
62
63
  *paths_for_urlpatterns("meta_consent"),
63
64
  *paths_for_urlpatterns("meta_export"),
64
65
  *paths_for_urlpatterns("meta_lists"),
66
+ *paths_for_urlpatterns("meta_pharmacy"),
65
67
  *paths_for_urlpatterns("meta_prn"),
66
68
  *paths_for_urlpatterns("meta_screening"),
67
69
  *paths_for_urlpatterns("meta_subject"),
70
+ *paths_for_urlpatterns("meta_reports"),
68
71
  ]
69
72
 
70
73
  if settings.DEFENDER_ENABLED:
meta_edc/wsgi.py CHANGED
@@ -2,6 +2,6 @@ import os
2
2
 
3
3
  from django.core.wsgi import get_wsgi_application
4
4
 
5
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.debug")
5
+ os.environ["DJANGO_SETTINGS_MODULE"] = "meta_edc.settings.debug"
6
6
 
7
7
  application = get_wsgi_application()
meta_edc/wsgi_live.py CHANGED
@@ -2,6 +2,6 @@ import os
2
2
 
3
3
  from django.core.wsgi import get_wsgi_application
4
4
 
5
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.live")
5
+ os.environ["DJANGO_SETTINGS_MODULE"] = "meta_edc.settings.live"
6
6
 
7
7
  application = get_wsgi_application()
meta_edc/wsgi_uat.py CHANGED
@@ -2,6 +2,6 @@ import os
2
2
 
3
3
  from django.core.wsgi import get_wsgi_application
4
4
 
5
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meta_edc.settings.uat")
5
+ os.environ["DJANGO_SETTINGS_MODULE"] = "meta_edc.settings.uat"
6
6
 
7
7
  application = get_wsgi_application()
File without changes