clinicedc 2.0.41__py3-none-any.whl → 2.0.42__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of clinicedc might be problematic. Click here for more details.

Files changed (346) hide show
  1. {clinicedc-2.0.41.dist-info → clinicedc-2.0.42.dist-info}/METADATA +3 -1
  2. {clinicedc-2.0.41.dist-info → clinicedc-2.0.42.dist-info}/RECORD +337 -344
  3. edc_action_item/action.py +1 -1
  4. edc_action_item/action_item_notification.py +1 -1
  5. edc_action_item/choices.py +1 -1
  6. edc_action_item/data_fixers.py +1 -2
  7. edc_action_item/delete_action_item.py +1 -2
  8. edc_action_item/forms/action_item_form.py +1 -1
  9. edc_action_item/models/action_item.py +1 -1
  10. edc_action_item/models/action_type.py +1 -1
  11. edc_action_item/models/signals.py +1 -1
  12. edc_action_item/templatetags/action_item_extras.py +1 -1
  13. edc_action_item/utils.py +1 -2
  14. edc_action_item/view_mixins/action_item_view_mixin.py +1 -1
  15. edc_adherence/choices.py +1 -1
  16. edc_adherence/form_validator_mixin.py +1 -2
  17. edc_adherence/list_data.py +1 -1
  18. edc_adherence/model_mixins.py +1 -1
  19. edc_adverse_event/action_items/ae_followup_action.py +9 -9
  20. edc_adverse_event/action_items/ae_initial_action.py +12 -16
  21. edc_adverse_event/action_items/ae_susar_action.py +2 -1
  22. edc_adverse_event/action_items/ae_tmg_action.py +6 -4
  23. edc_adverse_event/action_items/death_report_action.py +7 -7
  24. edc_adverse_event/action_items/death_report_tmg_action.py +2 -1
  25. edc_adverse_event/action_items/death_report_tmg_second_action.py +2 -1
  26. edc_adverse_event/action_items/hospitalization_action.py +2 -1
  27. edc_adverse_event/auths.py +3 -1
  28. edc_adverse_event/choices.py +13 -6
  29. edc_adverse_event/constants.py +1 -23
  30. edc_adverse_event/form_validator_mixins/death_report_form_validator.py +1 -1
  31. edc_adverse_event/form_validator_mixins/requires_death_report_form_validator_mixin.py +1 -2
  32. edc_adverse_event/form_validators/ae_followup.py +2 -3
  33. edc_adverse_event/form_validators/ae_initial.py +2 -1
  34. edc_adverse_event/form_validators/ae_tmg.py +2 -1
  35. edc_adverse_event/form_validators/death_report_tmg.py +1 -1
  36. edc_adverse_event/form_validators/hospitalization.py +2 -1
  37. edc_adverse_event/list_data.py +1 -1
  38. edc_adverse_event/model_mixins/ae_followup/ae_followup_fields_model_mixin.py +1 -1
  39. edc_adverse_event/model_mixins/ae_followup/ae_followup_methods_model_mixin.py +1 -2
  40. edc_adverse_event/model_mixins/ae_initial/ae_initial_fields_model_mixin.py +1 -1
  41. edc_adverse_event/model_mixins/ae_initial/ae_initial_susar_model_mixin.py +2 -2
  42. edc_adverse_event/model_mixins/ae_susar/ae_susar_methods_model_mixin.py +1 -2
  43. edc_adverse_event/model_mixins/ae_tmg/ae_tmg_fields_model_mixin.py +1 -1
  44. edc_adverse_event/model_mixins/hospitaization/hospitalization_model_mixin.py +1 -1
  45. edc_adverse_event/modeladmin_mixins/ae_initial_admin_mixin.py +1 -1
  46. edc_adverse_event/modeladmin_mixins/ae_tmg_admin_mixin.py +1 -1
  47. edc_adverse_event/modeladmin_mixins/death_report_admin_mixin.py +1 -1
  48. edc_adverse_event/modeladmin_mixins/death_report_tmg_admin_mixin.py +1 -1
  49. edc_adverse_event/modelform_mixins/ae_followup_modelform_mixin.py +1 -2
  50. edc_adverse_event/modelform_mixins/ae_initial_modelform_mixin.py +1 -2
  51. edc_adverse_event/models/signals.py +2 -2
  52. edc_adverse_event/pdf_reports/ae_pdf_report.py +3 -2
  53. edc_adverse_event/pdf_reports/death_pdf_report.py +3 -2
  54. edc_adverse_event/templatetags/edc_adverse_event_extras.py +2 -3
  55. edc_adverse_event/urls.py +1 -0
  56. edc_adverse_event/utils.py +11 -14
  57. edc_adverse_event/view_mixins/ae/ae_listboard_view_mixin.py +3 -3
  58. edc_adverse_event/view_mixins/ae/death_report_listboard_view_mixin.py +1 -1
  59. edc_adverse_event/view_mixins/tmg/tmg_ae_listboard_view_mixin.py +2 -1
  60. edc_adverse_event/views/home_view.py +1 -0
  61. edc_adverse_event/views/tmg/home_view.py +1 -1
  62. edc_adverse_event/views/tmg/status_listboards.py +1 -1
  63. edc_analytics/custom_tables/age.py +1 -2
  64. edc_analytics/custom_tables/art.py +1 -2
  65. edc_analytics/custom_tables/bmi.py +1 -3
  66. edc_analytics/custom_tables/bp.py +1 -3
  67. edc_analytics/custom_tables/fasting.py +1 -2
  68. edc_analytics/custom_tables/fbg.py +1 -2
  69. edc_analytics/custom_tables/fbg_ogtt.py +1 -2
  70. edc_analytics/custom_tables/hba1c.py +1 -2
  71. edc_analytics/custom_tables/ogtt.py +1 -2
  72. edc_analytics/custom_tables/waist.py +1 -2
  73. edc_analytics/row/row_statistics_with_gender.py +1 -2
  74. edc_analytics/table.py +1 -2
  75. edc_appointment/admin/actions.py +1 -1
  76. edc_appointment/admin/appointment_admin.py +1 -1
  77. edc_appointment/appointment_reason_updater.py +1 -1
  78. edc_appointment/choices.py +1 -2
  79. edc_appointment/form_validator_mixins/next_appointment_crf_form_validator_mixin.py +1 -1
  80. edc_appointment/list_data.py +2 -3
  81. edc_appointment/model_mixins/missed_appointment_model_mixin.py +1 -1
  82. edc_appointment/model_mixins/next_appointment_crf_model_mixin.py +1 -2
  83. edc_appointment/modeladmin_mixins/next_appointment_crf_modeladmin_mixin.py +1 -1
  84. edc_appointment/models/signals.py +1 -1
  85. edc_appointment/utils.py +4 -2
  86. edc_auth/constants.py +3 -0
  87. edc_consent/choices.py +1 -1
  88. edc_consent/consent_definition.py +1 -1
  89. edc_consent/consent_definition_extension.py +1 -1
  90. edc_consent/field_mixins/citizen_fields_mixin.py +3 -3
  91. edc_consent/model_mixins/consent_model_mixin.py +1 -1
  92. edc_consent/modelform_mixins/consent_modelform_mixin/consent_modelform_validation_mixin.py +1 -1
  93. edc_consent/modelform_mixins/consent_modelform_mixin/review_fields_modelform_mixin.py +1 -2
  94. edc_consent/validators.py +5 -10
  95. edc_constants/__init__.py +0 -3
  96. edc_constants/choices.py +2 -3
  97. edc_constants/context_processor.py +2 -3
  98. edc_constants/utils.py +2 -3
  99. edc_crf/model_mixins/crf_status_model_mixin.py +1 -1
  100. edc_crf/model_mixins/singleton_crf_model_mixin.py +0 -1
  101. edc_crf/update_crf_status_command.py +1 -2
  102. edc_crf/update_crf_status_for_instance.py +1 -2
  103. edc_dashboard/url_config.py +1 -2
  104. edc_dashboard/views/administration_view.py +1 -0
  105. edc_data_manager/action_items.py +7 -7
  106. edc_data_manager/admin/actions.py +1 -1
  107. edc_data_manager/admin/data_query_admin.py +10 -10
  108. edc_data_manager/choices.py +1 -1
  109. edc_data_manager/forms/data_query.py +1 -1
  110. edc_data_manager/handlers/handlers.py +1 -1
  111. edc_data_manager/models/data_query.py +1 -1
  112. edc_data_manager/models/model_mixins.py +1 -2
  113. edc_data_manager/models/query_rule.py +1 -1
  114. edc_data_manager/view_mixins/data_manager_view_mixin.py +1 -1
  115. edc_document_status/model_mixins.py +1 -1
  116. edc_document_status/models/signals.py +1 -2
  117. edc_dx/diagnoses.py +2 -3
  118. edc_dx/form_validators/diagnosis_form_validator_mixin.py +1 -2
  119. edc_dx_review/choices.py +1 -1
  120. edc_dx_review/form_validator_mixins/clinical_review_followup_form_validator_mixin.py +2 -1
  121. edc_dx_review/list_data.py +1 -1
  122. edc_dx_review/medical_date.py +1 -1
  123. edc_dx_review/model_mixins/clinical_review_baseline_model_mixin.py +1 -1
  124. edc_dx_review/model_mixins/clinical_review_followup/clinical_review_followup_chol_model_mixin.py +1 -1
  125. edc_dx_review/model_mixins/clinical_review_followup/clinical_review_followup_dm_model_mixin.py +1 -1
  126. edc_dx_review/model_mixins/clinical_review_followup/clinical_review_followup_hiv_model_mixin.py +1 -1
  127. edc_dx_review/model_mixins/clinical_review_followup/clinical_review_followup_htn_model_mixin.py +1 -1
  128. edc_dx_review/model_mixins/clinical_review_followup/clinical_review_followup_model_mixin.py +1 -1
  129. edc_dx_review/model_mixins/factory/baseline_review_model_mixin_factory.py +1 -1
  130. edc_dx_review/model_mixins/factory/calculate_date.py +1 -1
  131. edc_dx_review/model_mixins/factory/dx_initial_review_model_mixin_factory.py +1 -1
  132. edc_dx_review/model_mixins/factory/followup_review_model_mixin_factory.py +1 -1
  133. edc_dx_review/model_mixins/factory/rx_initial_review_model_mixin_factory.py +1 -1
  134. edc_dx_review/model_mixins/followup_review/followup_review_model_mixin.py +1 -1
  135. edc_dx_review/model_mixins/followup_review/hiv_followup_review_model_mixin.py +1 -1
  136. edc_dx_review/model_mixins/initial_review/chol_initial_review_model_mixin.py +1 -1
  137. edc_dx_review/model_mixins/initial_review/hiv_initial_model_mixins.py +2 -3
  138. edc_dx_review/model_mixins/initial_review/ncd_initial_review_model_mixin.py +1 -1
  139. edc_dx_review/utils.py +1 -1
  140. edc_egfr/__init__.py +0 -1
  141. edc_egfr/egfr.py +23 -15
  142. edc_egfr/form_validator_mixins/egfr_form_validator_mixins.py +30 -25
  143. edc_egfr/model_mixins/egfr_drop_notification_model_mixin.py +8 -2
  144. edc_egfr/model_mixins/egfr_model_mixin.py +2 -2
  145. edc_export/management/commands/import_receipts.py +1 -2
  146. edc_export/model_exporter/object_history_helpers.py +1 -2
  147. edc_export/models/object_history.py +1 -1
  148. edc_export/models/upload_export_receipt_file.py +1 -1
  149. edc_facility/list_data.py +1 -1
  150. edc_fieldsets/fieldsets_modeladmin_mixin.py +1 -2
  151. edc_form_validators/applicable_field_validator.py +1 -1
  152. edc_form_validators/date_validator.py +1 -1
  153. edc_form_validators/many_to_many_field_validator.py +1 -2
  154. edc_form_validators/other_specify_field_validator.py +1 -2
  155. edc_form_validators/required_field_validator.py +1 -2
  156. edc_glucose/form_validators/fasting_form_validator.py +1 -1
  157. edc_glucose/form_validators/glucose_form_validator.py +3 -3
  158. edc_glucose/form_validators/glucose_form_validator_mixin.py +1 -2
  159. edc_glucose/form_validators/ogtt_form_validator_mixin.py +1 -2
  160. edc_glucose/model_mixin_factories/fasting_model_mixin_factory.py +1 -1
  161. edc_glucose/model_mixin_factories/fbg_model_mixin_factory.py +1 -2
  162. edc_glucose/model_mixin_factories/glucose_model_mixin_factory.py +1 -1
  163. edc_glucose/model_mixin_factories/ogtt_model_mixin_factory.py +1 -2
  164. edc_glucose/model_mixins/hba1c_model_mixin.py +1 -3
  165. edc_glucose/utils.py +2 -2
  166. edc_identifier/model_mixins.py +1 -2
  167. edc_identifier/models.py +1 -1
  168. edc_identifier/simple_identifier.py +1 -2
  169. edc_lab/admin/modeladmin_mixins.py +1 -1
  170. edc_lab/choices.py +7 -10
  171. edc_lab/constants.py +0 -2
  172. edc_lab/form_validators/crf_requisition_form_validator_mixin.py +1 -0
  173. edc_lab/form_validators/requisition_form_validator_mixin.py +1 -1
  174. edc_lab/lab/specimen.py +1 -2
  175. edc_lab/model_mixins/requisition/requisition_identifier_mixin.py +1 -1
  176. edc_lab/model_mixins/requisition/requisition_model_mixin.py +1 -1
  177. edc_lab/model_mixins/shipping/manifest_model_mixin.py +1 -1
  178. edc_lab/model_mixins/shipping/verify_model_mixin.py +1 -2
  179. edc_lab/models/box.py +1 -1
  180. edc_lab_dashboard/middleware.py +1 -0
  181. edc_lab_dashboard/urls.py +1 -0
  182. edc_lab_dashboard/view_mixins/form_action_view_mixin.py +1 -0
  183. edc_lab_dashboard/view_mixins/process_requisition_view_mixin.py +1 -1
  184. edc_lab_dashboard/views/action_views/manage_box_item_view.py +1 -0
  185. edc_lab_dashboard/views/action_views/receive_view.py +1 -1
  186. edc_lab_dashboard/views/listboard_views/manage_box_listboard_view.py +1 -0
  187. edc_lab_dashboard/views/listboard_views/pack_listboard_view.py +1 -1
  188. edc_lab_dashboard/views/listboard_views/process_listboard_view.py +2 -1
  189. edc_lab_dashboard/views/listboard_views/receive_listboard_view.py +2 -1
  190. edc_lab_dashboard/views/listboard_views/requisition_listboard_view.py +1 -2
  191. edc_lab_dashboard/views/listboard_views/verify_box_listboard_view.py +1 -0
  192. edc_lab_results/action_items.py +1 -1
  193. edc_lab_results/form_validator_mixins/blood_results_fbg_form_validator_mixin.py +1 -1
  194. edc_lab_results/form_validator_mixins/blood_results_form_validator_mixin.py +2 -1
  195. edc_lab_results/model_mixin_factories/field_attrs.py +1 -1
  196. edc_lab_results/model_mixins/electrolytes_model_mixins.py +2 -2
  197. edc_lab_results/model_mixins/fbc_model_mixins.py +9 -8
  198. edc_lab_results/model_mixins/fbg_model_mixin.py +2 -7
  199. edc_lab_results/model_mixins/glucose_model_mixin.py +2 -7
  200. edc_lab_results/model_mixins/insulin_model_mixin.py +2 -1
  201. edc_lab_results/model_mixins/lft_model_mixins.py +7 -6
  202. edc_lab_results/model_mixins/lipid_model_mixins.py +1 -2
  203. edc_lab_results/model_mixins/proteinuria_model_mixin.py +1 -2
  204. edc_lab_results/model_mixins/rft_model_mixins.py +5 -3
  205. edc_listboard/views/screen/screening_listboard_view.py +1 -1
  206. edc_locator/action_items.py +2 -1
  207. edc_locator/forms/subject_locator_form_validator.py +1 -1
  208. edc_locator/modeladmin_mixins.py +1 -1
  209. edc_ltfu/action_items.py +2 -1
  210. edc_ltfu/choices.py +1 -1
  211. edc_ltfu/constants.py +0 -2
  212. edc_ltfu/forms/ltfu_form_validator.py +2 -1
  213. edc_ltfu/forms/ltfu_form_validator_mixin.py +1 -1
  214. edc_ltfu/modelform_mixins.py +2 -5
  215. edc_metadata/admin/modeladmin_mixins.py +4 -4
  216. edc_model/choices.py +1 -1
  217. edc_model/models/fields/date_estimated.py +1 -1
  218. edc_model_admin/context_processors.py +1 -1
  219. edc_model_admin/list_filters/future_date_list_filter.py +6 -7
  220. edc_model_admin/list_filters/list_field_with_other_list_filter.py +1 -1
  221. edc_model_admin/list_filters/past_date_list_filter.py +6 -7
  222. edc_model_admin/mixins/model_admin_redirect_on_delete_mixin.py +1 -0
  223. edc_model_admin/templatetags/edc_admin_modify.py +1 -1
  224. edc_model_fields/fields/date_estimated.py +1 -1
  225. edc_model_to_dataframe/model_to_dataframe.py +1 -1
  226. edc_navbar/navbar_item.py +1 -0
  227. edc_navbar/system_checks.py +3 -0
  228. edc_offstudy/action_items.py +2 -1
  229. edc_offstudy/choices.py +2 -1
  230. edc_pdf_reports/crf_pdf_report.py +9 -7
  231. edc_pdutils/dataframes/get_subject_consent.py +1 -2
  232. edc_pdutils/dataframes/get_subject_visit.py +1 -11
  233. edc_pdutils/helper.py +1 -2
  234. edc_pdutils/mappings.py +1 -1
  235. edc_pdutils/tables/crf.py +1 -2
  236. edc_pdutils/tables/requisition.py +1 -2
  237. edc_pdutils/utils/__init__.py +1 -0
  238. edc_pdutils/utils/convert_visit_code_to_float.py +8 -0
  239. edc_pdutils/utils/decrypt.py +5 -4
  240. edc_pdutils/utils/missing_subject_identifiers.py +5 -4
  241. edc_pharmacy/action_items.py +2 -1
  242. edc_pharmacy/admin/list_filters.py +1 -1
  243. edc_pharmacy/admin/stock/allocation_admin.py +1 -1
  244. edc_pharmacy/admin/stock/order_item_admin.py +1 -1
  245. edc_pharmacy/admin/stock/stock_request_admin.py +1 -1
  246. edc_pharmacy/admin/stock/stock_transfer_admin.py +1 -1
  247. edc_pharmacy/admin/stock/stock_transfer_item_admin.py +1 -1
  248. edc_pharmacy/choices.py +1 -2
  249. edc_pharmacy/form_validators/crf/study_medication_form_validator.py +1 -1
  250. edc_pharmacy/list_data.py +1 -1
  251. edc_pharmacy/model_mixins/study_medication_crf_model_mixin.py +1 -1
  252. edc_pharmacy/model_mixins/study_medication_refill_model_mixin.py +1 -1
  253. edc_pharmacy/models/model_mixins.py +1 -2
  254. edc_pharmacy/models/prescription/rx.py +1 -1
  255. edc_pharmacy/models/signals.py +1 -1
  256. edc_pharmacy/models/stock/order.py +1 -1
  257. edc_pharmacy/models/stock/order_item.py +1 -2
  258. edc_pharmacy/models/stock/stock_request.py +1 -1
  259. edc_pharmacy/views/confirm_stock_from_queryset_view.py +2 -1
  260. edc_pharmacy/views/confirmation_at_site_view.py +1 -1
  261. edc_prn/models.py +1 -2
  262. edc_protocol_incident/action_items.py +2 -1
  263. edc_protocol_incident/choices.py +1 -1
  264. edc_protocol_incident/form_validators/mixins.py +2 -1
  265. edc_protocol_incident/form_validators/protocol_deviation_violation_form_validator.py +2 -1
  266. edc_protocol_incident/form_validators/protocol_incident_form_validator.py +2 -1
  267. edc_protocol_incident/list_data.py +1 -1
  268. edc_protocol_incident/model_mixins/protocol_deviation_violation_model_mixin.py +1 -1
  269. edc_protocol_incident/modeladmin_mixins.py +1 -1
  270. edc_qareports/choices.py +1 -1
  271. edc_qareports/migrations/0017_auto_20240816_0256.py +1 -2
  272. edc_qareports/modeladmin_mixins/list_filters.py +1 -2
  273. edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py +1 -1
  274. edc_qareports/sql_generator/requisition_subquery.py +1 -1
  275. edc_refusal/forms.py +2 -1
  276. edc_refusal/list_data.py +1 -1
  277. edc_registration/model_mixins/updates_or_creates_registered_subject_model_mixin.py +1 -1
  278. edc_registration/models/registered_subject.py +1 -1
  279. edc_reportable/__init__.py +0 -35
  280. edc_reportable/choices.py +8 -3
  281. edc_reportable/constants.py +0 -7
  282. edc_reportable/data/__init__.py +0 -1
  283. edc_reportable/data/grading_data/ctcae_v5.py +1 -2
  284. edc_reportable/data/grading_data/daids_july_2017.py +7 -6
  285. edc_reportable/data/normal_data/africa.py +6 -5
  286. edc_reportable/exceptions.py +0 -4
  287. edc_reportable/forms/reportables_form_validator_mixin.py +2 -1
  288. edc_reportable/formula.py +1 -1
  289. edc_reportable/post_migrate_signals.py +1 -1
  290. edc_reportable/reference_range_evaluator.py +8 -2
  291. edc_reportable/units.py +2 -23
  292. edc_reportable/utils/__init__.py +1 -1
  293. edc_reportable/utils/get_mw.py +20 -0
  294. edc_reportable/utils/get_normal_data_or_raise.py +1 -1
  295. edc_review_dashboard/auths.py +1 -1
  296. edc_review_dashboard/middleware.py +1 -0
  297. edc_review_dashboard/urls.py +1 -0
  298. edc_review_dashboard/views/subject_review_listboard_view.py +1 -0
  299. edc_screening/choices.py +1 -1
  300. edc_screening/gender_evaluator.py +1 -1
  301. edc_screening/model_mixins/screening_fields_model_mixin.py +1 -1
  302. edc_screening/modelform_mixins.py +1 -1
  303. edc_screening/screening_eligibility.py +1 -2
  304. edc_sites/models/site_profile.py +1 -2
  305. edc_sites/site.py +1 -1
  306. edc_subject_dashboard/requisition_labels.py +1 -1
  307. edc_subject_dashboard/requisition_report.py +1 -1
  308. edc_subject_dashboard/requisition_verifier.py +1 -1
  309. edc_subject_dashboard/urls.py +1 -0
  310. edc_subject_dashboard/view_utils/go_to_forms_button.py +1 -1
  311. edc_subject_dashboard/views/requisition_print_actions_view.py +1 -1
  312. edc_subject_dashboard/views/subject_dashboard_view.py +1 -0
  313. edc_transfer/action_items.py +2 -1
  314. edc_transfer/choices.py +1 -1
  315. edc_transfer/form_validators.py +1 -1
  316. edc_transfer/list_data.py +1 -1
  317. edc_unblinding/action_items.py +2 -1
  318. edc_unblinding/models/unblinding_request.py +1 -1
  319. edc_unblinding/models/unblinding_review.py +1 -1
  320. edc_visit_schedule/action_items.py +2 -1
  321. edc_visit_schedule/admin/subject_schedule_history_admin.py +1 -0
  322. edc_visit_tracking/action_items.py +2 -1
  323. edc_visit_tracking/choices.py +1 -1
  324. edc_visit_tracking/form_validators/visit_form_validator.py +1 -1
  325. edc_visit_tracking/form_validators/visit_missed_form_validator.py +2 -1
  326. edc_visit_tracking/managers.py +1 -2
  327. edc_visit_tracking/model_mixins/subject_visit_missed_model_mixin.py +1 -1
  328. edc_visit_tracking/model_mixins/visit_model_mixin/caretaker_fields_mixin.py +1 -1
  329. edc_visit_tracking/model_mixins/visit_model_mixin/visit_model_fields_mixin.py +1 -1
  330. edc_visit_tracking/model_mixins/visit_model_mixin/visit_model_mixin.py +1 -1
  331. edc_visit_tracking/modeladmin_mixins/crf_model_admin_mixin.py +2 -1
  332. edc_visit_tracking/modeladmin_mixins/visit_model_admin_mixin.py +1 -1
  333. edc_visit_tracking/models/signals.py +1 -1
  334. edc_visit_tracking/view_utils/related_visit_button.py +1 -1
  335. edc_vitals/form_validators/blood_pressure_form_validator_mixin.py +1 -2
  336. edc_constants/constants.py +0 -250
  337. edc_constants/disease_constants.py +0 -22
  338. edc_egfr/calculators/__init__.py +0 -4
  339. edc_egfr/calculators/base_egrfr.py +0 -56
  340. edc_egfr/calculators/egfr_ckd_epi.py +0 -68
  341. edc_egfr/calculators/egfr_cockcroft_gault.py +0 -62
  342. edc_egfr/calculators/percent_change.py +0 -7
  343. edc_reportable/data/molecular_weights.py +0 -11
  344. edc_reportable/utils/convert_units.py +0 -163
  345. {clinicedc-2.0.41.dist-info → clinicedc-2.0.42.dist-info}/WHEEL +0 -0
  346. {clinicedc-2.0.41.dist-info → clinicedc-2.0.42.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,5 @@
1
- from edc_constants.constants import ALIVE, NO, OTHER, UNKNOWN, YES
1
+ from clinicedc_constants import ALIVE, NO, OTHER, UNKNOWN, YES
2
+
2
3
  from edc_form_validators import FormValidator
3
4
 
4
5
 
@@ -2,12 +2,11 @@ from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
5
+ from clinicedc_constants import INCOMPLETE, NOT_APPLICABLE, OTHER
5
6
  from django.contrib.sites.managers import CurrentSiteManager as DjangoCurrentSiteManager
6
7
  from django.core.exceptions import ObjectDoesNotExist
7
8
  from django.db import IntegrityError, models, transaction
8
9
 
9
- from edc_constants.constants import INCOMPLETE, NOT_APPLICABLE, OTHER
10
-
11
10
  from .constants import MISSED_VISIT
12
11
  from .exceptions import RelatedVisitReasonError
13
12
 
@@ -1,9 +1,9 @@
1
+ from clinicedc_constants import NO, NOT_APPLICABLE
1
2
  from django.core.validators import MinValueValidator
2
3
  from django.db import models
3
4
  from django.utils.translation import gettext_lazy as _
4
5
 
5
6
  from edc_constants.choices import ALIVE_DEAD_UNKNOWN, YES_NO, YES_NO_NA
6
- from edc_constants.constants import NO, NOT_APPLICABLE
7
7
  from edc_model import models as edc_models
8
8
  from edc_model.validators import date_not_future
9
9
  from edc_protocol.validators import date_not_before_study_start
@@ -1,7 +1,7 @@
1
+ from clinicedc_constants import YES
1
2
  from django.db import models
2
3
 
3
4
  from edc_constants.choices import YES_NO
4
- from edc_constants.constants import YES
5
5
 
6
6
 
7
7
  class CaretakerFieldsMixin(models.Model):
@@ -1,8 +1,8 @@
1
+ from clinicedc_constants import ALIVE, NOT_APPLICABLE, YES
1
2
  from django.db import models
2
3
  from django.utils import timezone
3
4
 
4
5
  from edc_constants.choices import ALIVE_DEAD_UNKNOWN_NA_MISSED, YES_NO
5
- from edc_constants.constants import ALIVE, NOT_APPLICABLE, YES
6
6
  from edc_model.validators import date_not_future, datetime_not_future
7
7
  from edc_model_fields.fields import OtherCharField
8
8
  from edc_protocol.validators import (
@@ -1,12 +1,12 @@
1
1
  from typing import Any
2
2
 
3
+ from clinicedc_constants import NO, YES
3
4
  from django.db import models
4
5
  from django.db.models.deletion import PROTECT
5
6
 
6
7
  from edc_appointment.appointment_status_updater import AppointmentStatusUpdater
7
8
  from edc_appointment.constants import MISSED_APPT
8
9
  from edc_consent.model_mixins import RequiresConsentFieldsModelMixin
9
- from edc_constants.constants import NO, YES
10
10
  from edc_document_status.model_mixins import DocumentStatusModelMixin
11
11
  from edc_identifier.model_mixins import NonUniqueSubjectIdentifierFieldMixin
12
12
  from edc_metadata.model_mixins import MetadataHelperModelMixin
@@ -3,8 +3,9 @@ from __future__ import annotations
3
3
  from typing import TYPE_CHECKING
4
4
  from uuid import UUID
5
5
 
6
+ from clinicedc_constants import UUID_PATTERN
7
+
6
8
  from edc_consent.fieldsets import REQUIRES_CONSENT_FIELDS
7
- from edc_constants.constants import UUID_PATTERN
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from django.core.handlers.wsgi import WSGIRequest
@@ -2,12 +2,12 @@ from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
5
+ from clinicedc_constants import OTHER
5
6
  from django.contrib import admin
6
7
  from django.core.exceptions import ObjectDoesNotExist
7
8
  from django_audit_fields.admin import audit_fieldset_tuple
8
9
 
9
10
  from edc_appointment.utils import get_appointment_model_cls
10
- from edc_constants.constants import OTHER
11
11
  from edc_document_status.fieldsets import document_status_fieldset_tuple
12
12
  from edc_document_status.modeladmin_mixins import DocumentStatusModelAdminMixin
13
13
  from edc_visit_schedule.fieldsets import (
@@ -1,8 +1,8 @@
1
+ from clinicedc_constants import NOT_APPLICABLE, PATIENT
1
2
  from django.db.models.signals import post_delete, post_save
2
3
  from django.dispatch import receiver
3
4
 
4
5
  from edc_appointment.constants import ONTIME_APPT
5
- from edc_constants.constants import NOT_APPLICABLE, PATIENT
6
6
  from edc_metadata import REQUIRED
7
7
  from edc_metadata.metadata import CrfMetadataGetter
8
8
  from edc_pharmacy.constants import IN_PROGRESS_APPT
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  from dataclasses import dataclass, field
4
4
  from typing import TYPE_CHECKING, TypeVar
5
5
 
6
+ from clinicedc_constants import INCOMPLETE
6
7
  from django.utils.translation import gettext as _
7
8
 
8
9
  from edc_appointment.constants import (
@@ -12,7 +13,6 @@ from edc_appointment.constants import (
12
13
  INCOMPLETE_APPT,
13
14
  SKIPPED_APPT,
14
15
  )
15
- from edc_constants.constants import INCOMPLETE
16
16
  from edc_view_utils import ADD, CHANGE, VIEW, DashboardModelButton
17
17
 
18
18
  if TYPE_CHECKING:
@@ -1,7 +1,6 @@
1
+ from clinicedc_constants import YES
1
2
  from django import forms
2
3
 
3
- from edc_constants.constants import YES
4
-
5
4
  from ..utils import calculate_avg_bp, has_severe_htn
6
5
 
7
6
 
@@ -1,250 +0,0 @@
1
- import re
2
-
3
- UUID_PATTERN = re.compile(
4
- "[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
5
- )
6
-
7
- ABNORMAL = "ABNORMAL"
8
- ABSENT = "absent"
9
- ADDITIONAL = True
10
- AFTERNOON = "afternoon"
11
- AGREE = "agree"
12
- ALIVE = "alive"
13
- ALWAYS = "always"
14
- ANONYMOUS = "anonymous"
15
- ANYTIME = "anytime"
16
- AWAITING_RESULTS = "awaiting_results"
17
- BLACK = "black"
18
- BOTH = "both"
19
- BY_BIRTH = "BY_BIRTH"
20
- CANCELLED = "cancelled"
21
- CHOL = "chol"
22
- CLINIC = "clinic"
23
- CLINICAL_ENDPOINT = "clinical_endpoint"
24
- CLINICAL_WITHDRAWAL = "clinical_withdrawal"
25
- CLINICIAN = "clinician"
26
- CLOSED = "closed"
27
- COLLATERAL_HISTORY = "collateral_history"
28
- COMPLETE = "COMPLETE"
29
- COMMUNITY = "community"
30
- CONFIRMED = "confirmed"
31
- CONSENTED = "consented"
32
- CONTINUOUS = "continuous"
33
- CONTROL = "control"
34
- CREATE = "CREATE"
35
- DEAD = "dead"
36
- DECEASED = "dead"
37
- DECLINED = "Declined"
38
- DECREASED = "decreased"
39
- DEFAULTED = "defaulted"
40
- DEFAULTER = "defaulter"
41
- DELETE = "DELETE"
42
- DELIVERY = "delivery"
43
- DIABETES = "diabetes"
44
- DISAGREE = "disagree"
45
- DIVORCED = "divorced"
46
- DM = "dm"
47
- DONE = "done"
48
- DONT_KNOW = "dont_know"
49
- DWTA = "DWTA" # don't want to answer
50
- ERROR = "ERROR"
51
- ESTIMATED = "estimated"
52
- EVENING = "evening"
53
- FAILED_ELIGIBILITY = "failed eligibility"
54
- FALSE = "false"
55
- FASTING = "fasting"
56
- FEEDBACK = "feedback"
57
- FEMALE = "F"
58
- FORMER_SMOKER = "former_smoker"
59
- FREE_OF_CHARGE = "free"
60
- FUTURE_DATE = "future_date"
61
- GRADE0 = "0"
62
- GRADE1 = "1"
63
- GRADE2 = "2"
64
- GRADE3 = "3"
65
- GRADE4 = "4"
66
- GRADE5 = "5"
67
- HEADACHE = "headache"
68
- HELD = "held"
69
- HIDE_FORM = "NOT_REQUIRED"
70
- HIGH = "high"
71
- HIGH_PRIORITY = "high"
72
- HIV = "HIV"
73
- HOME = "home"
74
- HOSPITAL = "hospital"
75
- HOSPITALIZED = "hospitalized"
76
- HOSPITAL_NOTES = "hospital_notes"
77
- HOSPITAL_OR_CLINIC = "hospital_or_clinic"
78
- HTN = "htn"
79
- HYPERTENSION = "hypertension"
80
- IGNORE = "ignore"
81
- IN_PROGRESS = "in_progress"
82
- INCOMPLETE = "INCOMPLETE"
83
- IND = "IND"
84
- INITIAL = "initial"
85
- INPATIENT = "inpatient"
86
- INSERT = "INSERT"
87
- INSURANCE = "insurance"
88
- INTEGRATED = "integrated"
89
- INTEGRATED_CLINIC = "integrated_clinic"
90
- INTERVENTION = "intervention"
91
- INVESTIGATOR = "investigator"
92
- INVESTIGATOR_DECISION = "investigator_decision"
93
- IN_PERSON = "in_person"
94
- IS_NULL = "is_null"
95
- LAST_MONTH = "last_month"
96
- LAST_WEEK = "last_week"
97
- LIVE = "live"
98
- LOW = "low"
99
- LOW_PRIORITY = "low"
100
- MALE = "M"
101
- MALIGNANCY = "malignancy"
102
- MARRIED = "married"
103
- MEDIUM_PRIORITY = "medium"
104
- MEASURED = "measured"
105
- MICROSCOPY = "microscopy"
106
- MOBILE_NUMBER = "mobile_no"
107
- MODIFIED = "modified"
108
- MONTHLY = "monthly"
109
- MORNING = "morning"
110
- MULTI_MORBIDITY = "multi"
111
- NAIVE = "NAIVE"
112
- NCD = "NCD"
113
- NEG = "NEG"
114
- NEUTRAL = "neutral"
115
- NEVER = "NEVER"
116
- NEW = "New"
117
- NEW_FIELD = "new_field"
118
- NEXT_OF_KIN = "next_of_kin"
119
- NEXT_WEEK = "next_week"
120
- NO = "No"
121
- NONE = "none"
122
- NONSMOKER = "nonsmoker"
123
- NON_BLACK = "non_black"
124
- NON_FASTING = "non_fasting"
125
- NORMAL = "NORMAL"
126
- NOT_ADDITIONAL = False
127
- NOT_ANSWERED = "not_answered"
128
- NOT_APPLICABLE = "N/A"
129
- NOT_AVAILABLE = "not_available"
130
- NOT_DONE = "not_done"
131
- NOT_ESTIMATED = "not_estimated"
132
- NOT_EVALUATED = "not_evaluated"
133
- NOT_EXAMINED = "not_examined"
134
- NOT_NULL = "not_null"
135
- NOT_RECORDED = "not_recorded"
136
- NOT_REQUIRED = "not_required"
137
- NOT_SURE = "not_sure"
138
- NOT_TESTED = "not_tested"
139
- NO_EXAM = "NO_EXAM"
140
- NO_UNCONFIRMED = "no_unconfirmed"
141
- NULL_STRING = ""
142
- OBSERVATION = "observation"
143
- OK = "OK"
144
- OFF_STUDY = "off study"
145
- OFF_STUDY_VISIT = "off study"
146
- OMANG = "OMANG"
147
- ON_ART = "on_art"
148
- ON_STUDY = "on study"
149
- ONGOING = "ongoing"
150
- OPEN = "open"
151
- OPTION_RETIRED = "OPTION_RETIRED"
152
- OPTIONAL = True
153
- OTHER = "OTHER"
154
- OTHER_PLEASE_SPECIFY_TEXT = "Other, please specify below ..."
155
- OUTPATIENT_CARDS = "outpatient_cards"
156
- OUTPATIENT = "outpatient"
157
- OWN_CASH = "own_cash"
158
- PARTIAL = "PARTIAL"
159
- PARTICIPANT = "participant"
160
- PAST_DATE = "past_date"
161
- PATIENT = "patient"
162
- PATIENT_CLUB = "club"
163
- PATIENT_REPRESENTATIVE = "patient_representative"
164
- PENDING = "PENDING"
165
- PER_PROTOCOL = "per_protocol"
166
- POS = "POS"
167
- PREGNANCY = "pregnancy"
168
- PRESENT = "present"
169
- PRESENT_WITH_REINFORCEMENT = "present_with_reinforcement"
170
- PRIMARY = "primary"
171
- PRINT = "PRINT"
172
- PRIVATE = "private"
173
- PURPOSIVELY_SELECTED = "purposively_selected"
174
- QUERY = "QUERY"
175
- QUESTION_RETIRED = "QUESTION_RETIRED"
176
- RANDOM_SAMPLING = "random_sampling"
177
- RAPID_TEST = "rapid_test"
178
- RARELY = "rarely"
179
- RECEIVED = "received"
180
- REDUCED = "reduced"
181
- REFILL = "refill"
182
- REFUSED = "REFUSED"
183
- RELATIVE = "relative"
184
- RESOLVED = "resolved"
185
- RESTARTED = "restarted"
186
- ROUTINE_VISIT = "routine_visit"
187
- SAE = "sae"
188
- SCREENED = "SCREENED"
189
- SECONDARY = "secondary"
190
- SEQUENTIAL = "sequential"
191
- SEROCONVERSION = "seroconversion"
192
- SHOW_FORM = "NEW"
193
- SINGLE = "single"
194
- SMOKER = "smoker"
195
- SOMETIMES = "sometimes"
196
- STEROIDS = "steroids"
197
- STOPPED = "stopped"
198
- STRONGLY_AGREE = "strongly_agree"
199
- STRONGLY_DISAGREE = "strongly_disagree"
200
- STUDY_DEFINED_TIMEPOINT = "study_defined_timepoint"
201
- SUBJECT = "subject"
202
- SYSTEMATIC = "systematic"
203
- TBD = "tbd" # to be determined
204
- TELEPHONE = "telephone"
205
- TERTIARY = "tertiary"
206
- TEST = "test"
207
- THIS_MONTH = "this_month"
208
- THIS_WEEK = "this_week"
209
- TIMEPOINT = "timepoint"
210
- TODAY = "today"
211
- TOMORROW = "tomorrow"
212
- TOXICITY = "toxicity"
213
- TRUE = "true"
214
- TUBERCULOSIS = "TB"
215
- UNK = "UNK"
216
- UNKNOWN = "unknown"
217
- UNWELL_VISIT = "unwell_visit"
218
- UPDATE = "UPDATE"
219
- VERY_OFTEN = "very_often"
220
- VIEW = "VIEW"
221
- VISUAL_LOSS = "visual_loss"
222
- WARN = "warn"
223
- WEEKDAYS = "weekdays"
224
- WEEKENDS = "weekends"
225
- WEEKLY = "weekly"
226
- WIDOWED = "widowed"
227
- YEARLY = "yearly"
228
- YES = "Yes"
229
- YESTERDAY = "yesterday"
230
-
231
- # operators
232
- EQ = "="
233
- GT = ">"
234
- GTE = ">="
235
- LT = "<"
236
- LTE = "<="
237
-
238
- # days of the week
239
- MONDAY = "monday"
240
- TUESDAY = "tuesday"
241
- WEDNESDAY = "wednesday"
242
- THURSDAY = "thursday"
243
- FRIDAY = "friday"
244
- SATURDAY = "saturday"
245
- SUNDAY = "sunday"
246
-
247
- VERY_DIFFICULT = "very_difficult"
248
- DIFFICULT = "difficult"
249
- EASY = "easy"
250
- VERY_EASY = "very_easy"
@@ -1,22 +0,0 @@
1
- ANAEMIA = "anaemia"
2
- BACTERAEMIA = "bacteraemia"
3
- BACTERAEMIA_SEPSIS = "bacteraemia_sepsis"
4
- BACTERIAL_PNEUMONIA = "bacterial_pneumonia"
5
- CM_IRIS = "cm_iris"
6
- CM_RELAPSE = "cm_relapse"
7
- CM_RELAPSE_IRIS = "cm_relapse_iris"
8
- CN_PALSY_LEFT_OTHER = "cn_palsy_left_other"
9
- CN_PALSY_RIGHT_OTHER = "cn_palsy_right_other"
10
- COVID_19 = "covid_19"
11
- CRYPTOCOCCAL_MENINGITIS = "cm"
12
- DIARRHOEA = "diarrhoea"
13
- DIARRHOEAL_WASTING = "diarrhoeal_wasting"
14
- FOCAL_NEUROLOGIC_DEFICIT_OTHER = "focal_neurologic_deficit_other"
15
- NEUTROPAENIA = "neutropaenia"
16
- PNEUMONIA = "pneumonia"
17
- RENAL_IMPAIRMENT = "renal_impairment"
18
- SEPSIS = "sepsis"
19
- TB_EXTRAPULMONARY = "tb_extrapulmonary"
20
- TB_PULMONARY = "tb_pulmonary"
21
- THERAPEUTIC_LP = "therapeutic_lp"
22
- THROMBOCYTOPENIA = "thrombocytopenia"
@@ -1,4 +0,0 @@
1
- from .base_egrfr import EgfrCalculatorError
2
- from .egfr_ckd_epi import EgfrCkdEpi
3
- from .egfr_cockcroft_gault import EgfrCockcroftGault
4
- from .percent_change import egfr_percent_change
@@ -1,56 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from edc_constants.constants import FEMALE, MALE
4
- from edc_reportable import MICROMOLES_PER_LITER, MILLIGRAMS_PER_DECILITER
5
- from edc_reportable.utils import convert_units
6
-
7
-
8
- class EgfrCalculatorError(Exception):
9
- pass
10
-
11
-
12
- class BaseEgfr:
13
- def __init__(
14
- self,
15
- gender: str | None = None,
16
- age_in_years: int | float | None = None,
17
- creatinine_value: float | int | None = None,
18
- creatinine_units: str | None = None,
19
- **kwargs, # noqa
20
- ):
21
- """Expects creatinine (scr) in umols/L.
22
-
23
- Converts to creatinine to mg/dL for the calculation.
24
- """
25
- self.scr = {}
26
- if not gender or gender not in [MALE, FEMALE]:
27
- raise EgfrCalculatorError(
28
- f"Invalid gender. Expected one of {MALE}, {FEMALE}. Got {gender}."
29
- )
30
- self.gender = gender
31
- if not (18 <= (age_in_years or 0) < 120):
32
- raise EgfrCalculatorError(
33
- f"Invalid age. See {self.__class__.__name__}. Got {age_in_years}"
34
- )
35
- self.age_in_years = float(age_in_years) if age_in_years else None
36
- if creatinine_value and creatinine_units:
37
- self.scr.update(
38
- {
39
- MILLIGRAMS_PER_DECILITER: convert_units(
40
- label="creatinine",
41
- value=float(creatinine_value),
42
- units_from=creatinine_units,
43
- units_to=MILLIGRAMS_PER_DECILITER,
44
- )
45
- }
46
- )
47
- self.scr.update(
48
- {
49
- MICROMOLES_PER_LITER: convert_units(
50
- label="creatinine",
51
- value=float(creatinine_value),
52
- units_from=creatinine_units,
53
- units_to=MICROMOLES_PER_LITER,
54
- )
55
- }
56
- )
@@ -1,68 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from edc_constants.constants import BLACK, FEMALE
4
- from edc_reportable import MILLIGRAMS_PER_DECILITER
5
-
6
- from .base_egrfr import BaseEgfr, EgfrCalculatorError
7
-
8
- # TODO: https://www.rcpa.edu.au/Manuals/RCPA-Manual/
9
- # Pathology-Tests/C/Creatinine-clearance-Cockcroft-and-Gault
10
-
11
-
12
- class EgfrCkdEpi(BaseEgfr):
13
- """Reference https://nephron.com/epi_equation
14
-
15
- CKD-EPI Creatinine equation (2009)
16
-
17
- Levey AS, Stevens LA, et al. A New Equation to Estimate Glomerular
18
- Filtration Rate. Ann Intern Med. 2009; 150:604-612.
19
- """
20
-
21
- def __init__(self, ethnicity: str = None, **kwargs):
22
- self.ethnicity = ethnicity
23
- super().__init__(**kwargs)
24
-
25
- @property
26
- def value(self) -> float | None:
27
- if (
28
- self.gender
29
- and self.age_in_years
30
- and self.ethnicity
31
- and self.scr.get(MILLIGRAMS_PER_DECILITER)
32
- ):
33
- scr = self.scr.get(MILLIGRAMS_PER_DECILITER)
34
- return float(
35
- 141.000
36
- * (min(scr / self.kappa, 1.000) ** self.alpha)
37
- * (max(scr / self.kappa, 1.000) ** -1.209)
38
- * self.age_factor
39
- * self.gender_factor
40
- * self.ethnicity_factor
41
- )
42
- opts = dict(
43
- gender=self.gender,
44
- age_in_years=self.age_in_years,
45
- ethnicity=self.ethnicity,
46
- scr=self.scr.get(MILLIGRAMS_PER_DECILITER),
47
- )
48
- raise EgfrCalculatorError(f"Unable to calculate. Insufficient information. Got {opts}")
49
-
50
- @property
51
- def alpha(self) -> float:
52
- return float(-0.329 if self.gender == FEMALE else -0.411)
53
-
54
- @property
55
- def kappa(self) -> float:
56
- return float(0.7 if self.gender == FEMALE else 0.9)
57
-
58
- @property
59
- def ethnicity_factor(self) -> float:
60
- return float(1.159 if self.ethnicity == BLACK else 1.000)
61
-
62
- @property
63
- def gender_factor(self) -> float:
64
- return float(1.018 if self.gender == FEMALE else 1.000)
65
-
66
- @property
67
- def age_factor(self) -> float:
68
- return float(0.993**self.age_in_years)
@@ -1,62 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from decimal import Decimal
4
-
5
- from edc_constants.constants import FEMALE
6
- from edc_reportable import MICROMOLES_PER_LITER
7
-
8
- from .base_egrfr import BaseEgfr, EgfrCalculatorError
9
-
10
-
11
- class EgfrCockcroftGault(BaseEgfr):
12
- """Reference https://www.mdcalc.com/creatinine-clearance-cockcroft-gault-equation
13
-
14
- Cockcroft-Gault
15
-
16
- eGFR (mL/min) = { (140 – age (years)) x weight (kg) x constant*} /
17
- serum creatinine (μmol/L)
18
- *constant = 1.23 for males and 1.05 for females
19
-
20
- Cockcroft-Gault CrCl, mL/min =
21
- (140 – age) × (weight, kg) × (0.85 if female) / (72 × SCr(mg/dL))
22
-
23
- or:
24
-
25
- https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2763564/
26
-
27
- GFR = 141 × min(Scr/κ, 1)α × max(Scr/κ, 1)-1.209 × 0.993Age
28
- """ # noqa: RUF002
29
-
30
- def __init__(self, weight: int | float | Decimal | None = None, **kwargs):
31
- self.weight = float(weight) if weight else None
32
- super().__init__(**kwargs)
33
-
34
- @property
35
- def value(self) -> float:
36
- """Returns the eGFR value or raises.
37
-
38
- eGFR (mL/min) = { (140 – age (years)) x weight (kg) x constant*} /
39
- serum creatinine (μmol/L)
40
-
41
- *constant = 1.23 for males and 1.05 for females
42
- """ # noqa: RUF002
43
- if (
44
- self.gender
45
- and self.age_in_years
46
- and self.weight
47
- and self.scr.get(MICROMOLES_PER_LITER)
48
- ):
49
- gender_factor = 1.05 if self.gender == FEMALE else 1.23
50
- adjusted_age = 140.00 - self.age_in_years
51
- return (adjusted_age * self.weight * gender_factor) / float(
52
- self.scr.get(MICROMOLES_PER_LITER)
53
- )
54
- opts = dict(
55
- gender=self.gender,
56
- age_in_years=self.age_in_years,
57
- weight=self.weight,
58
- scr=self.scr.get(MICROMOLES_PER_LITER),
59
- )
60
- raise EgfrCalculatorError(
61
- f"Unable to calculate egfr_value. Insufficient information. Got {opts}."
62
- )
@@ -1,7 +0,0 @@
1
- def egfr_percent_change(egfr_value: float, baseline_egfr_value: float) -> float:
2
- """Returns the percent change from baseline"""
3
- if egfr_value and baseline_egfr_value:
4
- return 100 * (
5
- (float(baseline_egfr_value) - float(egfr_value)) / float(baseline_egfr_value)
6
- )
7
- return 0.0
@@ -1,11 +0,0 @@
1
- # in g/mol
2
- molecular_weights = dict(
3
- glucose=180.16,
4
- chol=386.65,
5
- trig=885,
6
- creatinine=113.12,
7
- urea=60.06,
8
- tbil=584.6,
9
- haemoglobin=64500,
10
- albumin=66000,
11
- )