clinicedc 2.0.0__py3-none-any.whl → 2.0.2__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.
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.2.dist-info}/METADATA +15 -22
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.2.dist-info}/RECORD +895 -792
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.2.dist-info}/WHEEL +1 -1
- edc_action_item/action.py +13 -32
- edc_action_item/action_with_notification.py +1 -2
- edc_action_item/admin/action_item_admin.py +2 -6
- edc_action_item/admin_site.py +1 -3
- edc_action_item/auths.py +1 -3
- edc_action_item/create_or_update_action_type.py +1 -3
- edc_action_item/data_fixers.py +7 -20
- edc_action_item/forms/action_item_form.py +1 -3
- edc_action_item/management/commands/inspect_action_items.py +3 -9
- edc_action_item/migrations/0001_initial.py +4 -5
- edc_action_item/migrations/0003_auto_20180116_1528.py +2 -1
- edc_action_item/migrations/0006_auto_20180707_1659.py +3 -4
- edc_action_item/migrations/0007_auto_20180707_1715.py +1 -3
- edc_action_item/migrations/0008_auto_20180809_0303.py +2 -1
- edc_action_item/migrations/0014_auto_20181121_1738.py +2 -6
- edc_action_item/migrations/0015_auto_20190114_0250.py +4 -3
- edc_action_item/migrations/0021_auto_20190628_2113.py +1 -3
- edc_action_item/migrations/0022_auto_20190628_2136.py +2 -6
- edc_action_item/migrations/0030_edcpermissions.py +1 -1
- edc_action_item/migrations/0033_alter_actionitem_managers.py +1 -0
- edc_action_item/migrations/0034_alter_actionitem_device_created_and_more.py +13 -37
- edc_action_item/migrations/0038_alter_actionitem_revision_alter_actiontype_revision_and_more.py +86 -0
- edc_action_item/models/action_item.py +2 -6
- edc_action_item/models/action_model_mixin.py +5 -16
- edc_action_item/models/action_type.py +1 -3
- edc_action_item/models/reference.py +1 -2
- edc_action_item/models/signals.py +3 -9
- edc_action_item/site_action_items.py +4 -12
- edc_action_item/templatetags/action_item_extras.py +1 -3
- edc_action_item/view_utils/action_item_button.py +1 -3
- edc_action_item/view_utils/action_item_popover_list_item.py +1 -2
- edc_adherence/migrations/0002_nonadherencereasons_plural_name.py +1 -3
- edc_adherence/model_admin_mixin.py +1 -3
- edc_adverse_event/action_items/ae_followup_action.py +2 -6
- edc_adverse_event/action_items/ae_initial_action.py +3 -7
- edc_adverse_event/auth_objects.py +2 -6
- edc_adverse_event/constants.py +1 -3
- edc_adverse_event/form_validator_mixins/death_report_form_validator.py +1 -3
- edc_adverse_event/form_validator_mixins/requires_death_report_form_validator_mixin.py +2 -7
- edc_adverse_event/form_validators/hospitalization.py +1 -3
- edc_adverse_event/migrations/0003_auto_20191026_2231.py +3 -9
- edc_adverse_event/migrations/0008_auto_20220825_0451.py +1 -1
- edc_adverse_event/migrations/0009_auto_20220907_0157.py +1 -1
- edc_adverse_event/migrations/0010_auto_20220913_2139.py +4 -12
- edc_adverse_event/migrations/0013_alter_aeactionclassification_device_created_and_more.py +11 -31
- edc_adverse_event/migrations/0015_alter_aeactionclassification_revision_and_more.py +74 -0
- edc_adverse_event/model_mixins/ae_followup/ae_followup_fields_model_mixin.py +1 -3
- edc_adverse_event/model_mixins/ae_followup/ae_followup_model_mixin.py +1 -5
- edc_adverse_event/model_mixins/ae_initial/ae_initial_ae_model_mixin.py +1 -3
- edc_adverse_event/model_mixins/ae_initial/ae_initial_fields_model_mixin.py +1 -3
- edc_adverse_event/model_mixins/ae_initial/ae_initial_susar_model_mixin.py +1 -2
- edc_adverse_event/model_mixins/ae_special_interest/aesi_model_mixin.py +1 -5
- edc_adverse_event/model_mixins/ae_susar/ae_susar_model_mixin.py +1 -5
- edc_adverse_event/model_mixins/ae_tmg/ae_tmg_fields_model_mixin.py +2 -6
- edc_adverse_event/model_mixins/ae_tmg/ae_tmg_model_mixin.py +1 -5
- edc_adverse_event/model_mixins/death_report/death_report_extra_fields_model_mixin.py +1 -2
- edc_adverse_event/model_mixins/death_report/death_report_model_mixin.py +2 -5
- edc_adverse_event/model_mixins/death_report/death_report_tmg_model_mixin.py +2 -7
- edc_adverse_event/model_mixins/death_report/simple_death_report_model_mixin.py +1 -3
- edc_adverse_event/modeladmin_mixins/ae_tmg_admin_mixin.py +1 -3
- edc_adverse_event/modeladmin_mixins/death_report_admin_mixin.py +6 -10
- edc_adverse_event/modelform_mixins/ae_tmg_modelform_mixin.py +1 -3
- edc_adverse_event/models/signals.py +3 -9
- edc_adverse_event/pdf_reports/ae_pdf_report.py +6 -18
- edc_adverse_event/pdf_reports/death_pdf_report.py +3 -9
- edc_adverse_event/templatetags/edc_adverse_event_extras.py +5 -15
- edc_adverse_event/utils.py +2 -6
- edc_adverse_event/view_mixins/ae/ae_listboard_view_mixin.py +1 -3
- edc_adverse_event/view_mixins/ae/death_report_listboard_view_mixin.py +1 -3
- edc_adverse_event/view_mixins/tmg/tmg_ae_listboard_view_mixin.py +2 -6
- edc_adverse_event/view_utils/tmg_button.py +2 -6
- edc_adverse_event/views/home_view.py +1 -3
- edc_adverse_event/views/tmg/death_listboard_view.py +1 -3
- edc_adverse_event/views/tmg/home_view.py +2 -6
- edc_adverse_event/views/tmg/summary_listboard_view.py +1 -3
- edc_appconfig/apps.py +3 -2
- edc_appointment/admin/appointment_admin.py +1 -3
- edc_appointment/admin/list_filters.py +1 -3
- edc_appointment/admin_site.py +1 -3
- edc_appointment/analytics/dataframes/get_appointment_df.py +2 -6
- edc_appointment/appointment_reason_updater.py +2 -5
- edc_appointment/appointment_status_updater.py +1 -4
- edc_appointment/constants.py +1 -3
- edc_appointment/creators/appointment_creator.py +4 -10
- edc_appointment/creators/appointments_creator.py +3 -2
- edc_appointment/creators/unscheduled_appointment_creator.py +3 -7
- edc_appointment/creators/utils.py +4 -0
- edc_appointment/form_validator_mixins/next_appointment_crf_form_validator_mixin.py +3 -10
- edc_appointment/form_validator_mixins/window_period_form_validator_mixin.py +3 -9
- edc_appointment/form_validators/appointment_form_validator.py +11 -37
- edc_appointment/form_validators/next_appointment_crf_form_validator.py +1 -3
- edc_appointment/form_validators/utils.py +1 -3
- edc_appointment/managers.py +2 -6
- edc_appointment/migrations/0002_auto_20161126_1156.py +5 -8
- edc_appointment/migrations/0003_auto_20161127_2226.py +7 -16
- edc_appointment/migrations/0006_auto_20170106_2118.py +2 -1
- edc_appointment/migrations/0008_auto_20171115_1601.py +3 -4
- edc_appointment/migrations/0014_auto_20180116_1411.py +2 -1
- edc_appointment/migrations/0024_auto_20200911_0425.py +1 -1
- edc_appointment/migrations/0034_appointmenttype_alter_appointment_appt_type_and_more.py +2 -4
- edc_appointment/migrations/0036_auto_20230124_1822.py +2 -6
- edc_appointment/migrations/0040_appointment_appt_type_other_and_more.py +1 -0
- edc_appointment/migrations/0042_alter_appointment_device_created_and_more.py +5 -13
- edc_appointment/migrations/0046_infosources.py +1 -3
- edc_appointment/migrations/0047_alter_appointment_options_and_more.py +1 -3
- edc_appointment/migrations/0049_alter_appointment_revision_and_more.py +38 -0
- edc_appointment/model_mixins/appointment_methods_model_mixin.py +1 -5
- edc_appointment/model_mixins/appointment_model_mixin.py +7 -12
- edc_appointment/model_mixins/next_appointment_crf_model_mixin.py +1 -3
- edc_appointment/modeladmin_mixins/next_appointment_crf_modeladmin_mixin.py +1 -3
- edc_appointment/modelform_mixins/next_appointment_crf_modelform_mixins.py +1 -5
- edc_appointment/models/signals.py +5 -17
- edc_appointment/utils.py +11 -33
- edc_appointment/view_mixins/appointment_view_mixin.py +2 -6
- edc_auth/admin/list_filters.py +2 -6
- edc_auth/admin/role_admin.py +1 -3
- edc_auth/admin/user_admin.py +4 -12
- edc_auth/admin/user_profile_admin.py +2 -5
- edc_auth/auth_updater/auth_updater.py +1 -3
- edc_auth/forms.py +1 -3
- edc_auth/get_app_codenames.py +1 -3
- edc_auth/import_users.py +3 -9
- edc_auth/management/commands/export_users.py +1 -3
- edc_auth/management/commands/reset_password.py +1 -3
- edc_auth/migrations/0001_squashed_0033_alter_userprofile_is_multisite_viewer.py +4 -12
- edc_auth/migrations/0015_auto_20191026_2149.py +1 -3
- edc_auth/migrations/0016_auto_20191026_2153.py +1 -3
- edc_auth/migrations/0025_permissions.py +1 -1
- edc_auth/migrations/0029_alter_edcpermissions_device_created_and_more.py +5 -13
- edc_auth/migrations/0034_alter_edcpermissions_revision_alter_role_revision.py +38 -0
- edc_auth/models/__init__.py +1 -3
- edc_auth/models/signals.py +2 -6
- edc_auth/models/user_profile.py +1 -3
- edc_auth/password_setter.py +1 -3
- edc_auth/system_checks.py +1 -5
- edc_auth/urls_for_accounts.py +1 -3
- edc_auth/utils.py +3 -9
- edc_consent/actions.py +3 -9
- edc_consent/consent_definition.py +5 -8
- edc_consent/consent_definition_extension.py +4 -12
- edc_consent/field_mixins/citizen_fields_mixin.py +2 -4
- edc_consent/field_mixins/identity_fields_mixin.py +1 -2
- edc_consent/field_mixins/personal_fields_mixin.py +8 -3
- edc_consent/field_mixins/site_fields_mixin.py +1 -2
- edc_consent/form_validators/subject_consent_form_validator.py +4 -8
- edc_consent/migrations/0001_initial.py +1 -1
- edc_consent/migrations/0002_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_consent/migrations/0005_alter_edcpermissions_revision.py +26 -0
- edc_consent/model_mixins/consent_extension_model_mixin.py +2 -3
- edc_consent/model_mixins/consent_model_mixin.py +3 -9
- edc_consent/modeladmin_mixins/consent_model_admin_mixin.py +7 -17
- edc_consent/modelform_mixins/consent_modelform_mixin/consent_modelform_validation_mixin.py +6 -10
- edc_consent/modelform_mixins/requires_consent_modelform_mixin.py +1 -3
- edc_consent/models/signals.py +3 -6
- edc_consent/site_consents.py +6 -17
- edc_consent/system_checks.py +3 -9
- edc_consent/validators.py +1 -2
- edc_consent/view_mixins/consent_view_mixins.py +3 -5
- edc_crf/crf_form_validator.py +4 -7
- edc_crf/crf_form_validator_mixins.py +2 -6
- edc_crf/migrations/0004_alter_crfstatus_device_created_and_more.py +3 -7
- edc_crf/migrations/0008_alter_crfstatus_revision.py +26 -0
- edc_crf/utils.py +1 -3
- edc_dashboard/management/commands/update_search_slugs.py +1 -3
- edc_dashboard/migrations/0001_initial.py +1 -1
- edc_dashboard/migrations/0003_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_dashboard/migrations/0005_alter_edcpermissions_revision.py +26 -0
- edc_dashboard/templatetags/edc_dashboard_extras.py +2 -6
- edc_dashboard/view_mixins/administration_view_mixin.py +1 -3
- edc_dashboard/view_mixins/edc_view_mixin.py +1 -3
- edc_dashboard/views/administration_view.py +1 -3
- edc_data_manager/action_items.py +1 -3
- edc_data_manager/admin/actions.py +3 -9
- edc_data_manager/admin/data_query_admin.py +4 -12
- edc_data_manager/admin/query_rule_admin.py +4 -13
- edc_data_manager/auths.py +1 -3
- edc_data_manager/forms/data_query.py +2 -6
- edc_data_manager/forms/query_rule.py +1 -3
- edc_data_manager/get_longitudinal_value.py +2 -5
- edc_data_manager/handlers/handlers.py +2 -6
- edc_data_manager/migrations/0001_initial.py +4 -3
- edc_data_manager/migrations/0003_auto_20190806_1749.py +2 -6
- edc_data_manager/migrations/0004_auto_20190806_1750.py +1 -3
- edc_data_manager/migrations/0025_edcpermissions.py +1 -1
- edc_data_manager/migrations/0027_alter_dataquery_dm_user.py +1 -1
- edc_data_manager/migrations/0028_alter_dataquery_options_alter_queryrule_options_and_more.py +2 -1
- edc_data_manager/migrations/0029_alter_dataquery_managers.py +2 -1
- edc_data_manager/migrations/0030_alter_datadictionary_device_created_and_more.py +15 -43
- edc_data_manager/migrations/0039_alter_datadictionary_revision_and_more.py +101 -0
- edc_data_manager/models/model_mixins.py +1 -3
- edc_data_manager/populate_data_dictionary.py +1 -2
- edc_data_manager/post_migrate_signals.py +1 -3
- edc_data_manager/site_data_manager.py +1 -3
- edc_document_status/model_mixins.py +1 -3
- edc_egfr/__init__.py +1 -0
- edc_egfr/admin/__init__.py +1 -0
- edc_egfr/admin/egfr_drop_notification_admin_mixin.py +73 -0
- edc_egfr/apps.py +5 -0
- edc_egfr/calculators/__init__.py +4 -0
- edc_egfr/calculators/base_egrfr.py +56 -0
- edc_egfr/calculators/egfr_ckd_epi.py +68 -0
- edc_egfr/calculators/egfr_cockcroft_gault.py +63 -0
- edc_egfr/calculators/percent_change.py +7 -0
- edc_egfr/constants.py +1 -0
- edc_egfr/egfr.py +237 -0
- edc_egfr/form_validator_mixins/__init__.py +4 -0
- edc_egfr/form_validator_mixins/egfr_form_validator_mixins.py +55 -0
- edc_egfr/get_drop_notification_model.py +10 -0
- edc_egfr/get_egfr_for_subject.py +31 -0
- edc_egfr/model_mixins/__init__.py +2 -0
- edc_egfr/model_mixins/egfr_drop_notification_model_mixin.py +63 -0
- edc_egfr/model_mixins/egfr_model_mixin.py +120 -0
- edc_export/archive_exporter.py +2 -6
- edc_export/exportables.py +2 -6
- edc_export/files_emailer.py +1 -3
- edc_export/management/commands/import_receipts.py +1 -3
- edc_export/managers.py +3 -9
- edc_export/migrations/0001_initial.py +15 -36
- edc_export/migrations/0005_exportdata_importdata.py +1 -3
- edc_export/migrations/0006_auto_20200512_0208.py +2 -6
- edc_export/migrations/0010_auto_20210910_1636.py +2 -6
- edc_export/migrations/0013_edcpermissions.py +1 -1
- edc_export/migrations/0015_alter_datarequest_managers_and_more.py +2 -1
- edc_export/migrations/0016_alter_datarequest_device_created_and_more.py +27 -79
- edc_export/migrations/0017_alter_datarequest_options_and_more.py +2 -6
- edc_export/migrations/0020_remove_datarequesthistory_edc_export__exporte_ba8050_idx_and_more.py +2 -6
- edc_export/migrations/0021_alter_datarequest_revision_and_more.py +173 -0
- edc_export/model_exporter/model_exporter.py +4 -15
- edc_export/model_exporter/object_history_helpers.py +1 -3
- edc_export/model_exporter/value_getter.py +5 -14
- edc_export/models/signals.py +1 -3
- edc_export/models/upload_export_receipt_file.py +1 -3
- edc_export/utils.py +1 -4
- edc_export/views/export_selected_models_view.py +6 -17
- edc_facility/default_definitions.py +1 -3
- edc_facility/facility.py +4 -14
- edc_facility/import_holidays.py +1 -3
- edc_facility/migrations/0005_healthfacility_healthfacilitytypes_and_more.py +4 -6
- edc_facility/migrations/0006_alter_healthfacility_health_facility_type.py +1 -1
- edc_facility/migrations/0008_alter_healthfacility_device_created_and_more.py +5 -13
- edc_facility/migrations/0015_alter_healthfacility_revision_and_more.py +38 -0
- edc_facility/models/holiday.py +1 -3
- edc_facility/utils.py +1 -3
- edc_fieldsets/fieldsets_modeladmin_mixin.py +1 -3
- edc_form_describer/form_describer.py +3 -9
- edc_form_describer/make_forms_reference.py +1 -3
- edc_form_describer/management/commands/make_forms_reference.py +1 -3
- edc_form_runners/admin/issue_admin.py +2 -6
- edc_form_runners/form_runner.py +4 -13
- edc_form_runners/form_runner_by_scr_id.py +1 -3
- edc_form_runners/get_form_runner.py +1 -3
- edc_form_runners/get_form_runner_by_src_id.py +3 -3
- edc_form_runners/management/commands/run_form_runners.py +1 -3
- edc_form_runners/migrations/0001_initial.py +2 -4
- edc_form_runners/migrations/0004_alter_issue_revision.py +26 -0
- edc_form_runners/run_form_runners.py +1 -3
- edc_form_runners/utils.py +1 -3
- edc_form_validators/applicable_field_validator.py +6 -17
- edc_form_validators/base_form_validator.py +1 -3
- edc_form_validators/date_range_validator.py +4 -12
- edc_form_validators/date_validator.py +3 -9
- edc_form_validators/many_to_many_field_validator.py +1 -3
- edc_form_validators/other_specify_field_validator.py +3 -7
- edc_form_validators/range_field_validator.py +1 -3
- edc_form_validators/required_field_validator.py +5 -18
- edc_glucose/__init__.py +0 -0
- edc_glucose/apps.py +6 -0
- edc_glucose/constants.py +3 -0
- edc_glucose/fieldsets.py +14 -0
- edc_glucose/form_validators/__init__.py +6 -0
- edc_glucose/form_validators/fasting_form_validator.py +12 -0
- edc_glucose/form_validators/fbg_form_validator_mixin.py +32 -0
- edc_glucose/form_validators/fbg_ogtt_form_validator_mixin.py +47 -0
- edc_glucose/form_validators/glucose_form_validator.py +44 -0
- edc_glucose/form_validators/glucose_form_validator_mixin.py +53 -0
- edc_glucose/form_validators/ogtt_form_validator_mixin.py +91 -0
- edc_glucose/list_filters.py +42 -0
- edc_glucose/migrations/__init__.py +0 -0
- edc_glucose/model_mixin_factories/__init__.py +4 -0
- edc_glucose/model_mixin_factories/fasting_model_mixin_factory.py +63 -0
- edc_glucose/model_mixin_factories/fbg_model_mixin_factory.py +48 -0
- edc_glucose/model_mixin_factories/glucose_model_mixin_factory.py +49 -0
- edc_glucose/model_mixin_factories/ogtt_model_mixin_factory.py +71 -0
- edc_glucose/model_mixins/__init__.py +5 -0
- edc_glucose/model_mixins/fasting_model_mixin.py +15 -0
- edc_glucose/model_mixins/fbg_model_mixin.py +10 -0
- edc_glucose/model_mixins/glucose_model_mixin.py +17 -0
- edc_glucose/model_mixins/hba1c_model_mixin.py +42 -0
- edc_glucose/model_mixins/ogtt_model_mixin.py +10 -0
- edc_glucose/models.py +0 -0
- edc_glucose/utils.py +42 -0
- edc_identifier/admin_site.py +1 -3
- edc_identifier/identifier.py +1 -3
- edc_identifier/migrations/0001_initial.py +3 -4
- edc_identifier/migrations/0001_squashed_0018_auto_20180128_1054.py +3 -2
- edc_identifier/migrations/0005_alter_identifiermodel_managers.py +2 -1
- edc_identifier/migrations/0005_historicalidentifierhistory_historicalidentifiertracker_historicalsubjectidentifier.py +4 -5
- edc_identifier/migrations/0006_auto_20161127_2226.py +16 -43
- edc_identifier/migrations/0007_alter_identifiermodel_device_created_and_more.py +3 -7
- edc_identifier/migrations/0007_auto_20161204_2227.py +4 -7
- edc_identifier/migrations/0009_auto_20161221_2323.py +1 -0
- edc_identifier/migrations/0010_alter_identifiermodel_revision.py +26 -0
- edc_identifier/migrations/0010_auto_20170112_0602.py +2 -1
- edc_identifier/migrations/0012_auto_20171116_1606.py +2 -1
- edc_identifier/migrations/0013_auto_20171230_1316.py +3 -9
- edc_identifier/research_identifier.py +3 -11
- edc_identifier/short_identifier.py +5 -9
- edc_identifier/utils.py +1 -3
- edc_lab/admin/modeladmin_mixins.py +2 -8
- edc_lab/aliquot_types.py +1 -3
- edc_lab/form_validators/requisition_form_validator_mixin.py +1 -3
- edc_lab/forms/box_type_form.py +4 -6
- edc_lab/lab/aliquot_type.py +2 -6
- edc_lab/lab/manifest.py +2 -6
- edc_lab/lab/primary_aliquot.py +1 -3
- edc_lab/lab/requisition_panel.py +1 -3
- edc_lab/lab/requisition_panel_group.py +2 -6
- edc_lab/lab/specimen.py +1 -3
- edc_lab/labels/aliquot_label.py +4 -6
- edc_lab/labels/manifest_label.py +1 -3
- edc_lab/migrations/0001_initial.py +12 -29
- edc_lab/migrations/0002_auto_20170305_1939.py +4 -12
- edc_lab/migrations/0007_auto_20170321_1119.py +2 -6
- edc_lab/migrations/0008_auto_20170921_0719.py +2 -1
- edc_lab/migrations/0010_auto_20171127_1541.py +3 -2
- edc_lab/migrations/0012_auto_20180114_1438.py +2 -1
- edc_lab/migrations/0013_auto_20180117_1438.py +2 -1
- edc_lab/migrations/0022_auto_20211210_1839.py +1 -0
- edc_lab/migrations/0024_alter_manifestitem_managers.py +2 -1
- edc_lab/migrations/0027_alter_aliquot_managers_alter_box_managers_and_more.py +1 -1
- edc_lab/migrations/0028_alter_aliquot_device_created_and_more.py +43 -127
- edc_lab/migrations/0035_alter_aliquot_revision_alter_box_revision_and_more.py +266 -0
- edc_lab/model_mixins/aliquot/aliquot_label_mixin.py +1 -3
- edc_lab/model_mixins/aliquot/aliquot_model_mixin.py +4 -12
- edc_lab/model_mixins/requisition/requisition_identifier_mixin.py +1 -3
- edc_lab/model_mixins/shipping/manifest_model_mixin.py +1 -3
- edc_lab/models/box_item.py +1 -3
- edc_lab/models/box_type.py +1 -3
- edc_lab/models/manifest/manifest.py +3 -9
- edc_lab/models/manifest/manifest_item.py +1 -3
- edc_lab/models/order.py +1 -3
- edc_lab/models/signals.py +1 -3
- edc_lab/patterns.py +1 -3
- edc_lab/pdf_reports/manifest_pdf_report.py +9 -27
- edc_lab/post_migrate_signals.py +1 -3
- edc_lab/site_labs.py +4 -10
- edc_lab_dashboard/migrations/0001_initial.py +1 -1
- edc_lab_dashboard/migrations/0002_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_lab_dashboard/migrations/0004_alter_edcpermissions_revision.py +26 -0
- edc_lab_dashboard/view_mixins/box_view_mixin.py +1 -3
- edc_lab_dashboard/view_mixins/manifest_view_mixin.py +4 -12
- edc_lab_dashboard/views/action_views/receive_view.py +1 -3
- edc_lab_dashboard/views/action_views/verify_box_item_view.py +1 -3
- edc_lab_dashboard/views/listboard_filters/aliquot_listboard_view_filters.py +2 -6
- edc_lab_dashboard/views/listboard_filters/manifest_listboard_filters.py +1 -3
- edc_lab_dashboard/views/listboard_views/base_box_item_listboard_view.py +1 -3
- edc_lab_dashboard/views/listboard_views/manifest_listboard_view.py +1 -3
- edc_lab_dashboard/views/listboard_views/process_listboard_view.py +2 -6
- edc_lab_dashboard/views/listboard_views/receive_listboard_view.py +2 -6
- edc_lab_dashboard/views/listboard_views/requisition_listboard_view.py +2 -6
- edc_lab_results/action_items.py +1 -3
- edc_lab_results/form_validator_mixins/blood_results_fbg_form_validator_mixin.py +2 -4
- edc_lab_results/form_validator_mixins/blood_results_form_validator_mixin.py +1 -3
- edc_lab_results/get_summary.py +3 -5
- edc_lab_results/model_mixin_factories/__init__.py +10 -0
- edc_lab_results/{model_mixin_factory → model_mixin_factories}/field_attrs.py +8 -8
- edc_lab_results/{model_mixin_factory → model_mixin_factories}/reportable_result_model_mixin_factory.py +2 -0
- edc_lab_results/{model_mixin_factory → model_mixin_factories}/result_model_mixin_factory.py +2 -0
- edc_lab_results/model_mixins/blood_result_model_mixin.py +2 -5
- edc_lab_results/model_mixins/electrolytes_model_mixins.py +1 -1
- edc_lab_results/model_mixins/fbc_model_mixins.py +1 -1
- edc_lab_results/model_mixins/fbg_model_mixin.py +6 -3
- edc_lab_results/model_mixins/glucose_model_mixin.py +2 -2
- edc_lab_results/model_mixins/hba1c_model_mixin.py +2 -28
- edc_lab_results/model_mixins/insulin_model_mixin.py +5 -11
- edc_lab_results/model_mixins/lft_model_mixins.py +1 -1
- edc_lab_results/model_mixins/lipid_model_mixins.py +1 -1
- edc_lab_results/model_mixins/proteinuria_model_mixin.py +1 -1
- edc_lab_results/model_mixins/rft_model_mixins.py +1 -1
- edc_label/apps.py +1 -2
- edc_label/migrations/0001_initial.py +1 -1
- edc_label/migrations/0003_alter_zpllabeltemplates_device_created_and_more.py +3 -7
- edc_label/migrations/0006_alter_zpllabeltemplates_revision.py +29 -0
- edc_label/printer.py +2 -6
- edc_label/printers_mixin.py +1 -3
- edc_label/urls.py +1 -3
- edc_label/view_mixins.py +1 -3
- edc_label/views/print_label_view.py +1 -3
- edc_list_data/model_mixins.py +1 -3
- edc_list_data/preload_data.py +2 -6
- edc_list_data/site_list_data.py +1 -3
- edc_listboard/migrations/0001_initial.py +1 -1
- edc_listboard/migrations/0003_alter_listboard_device_created_and_more.py +3 -7
- edc_listboard/migrations/0006_alter_listboard_revision.py +29 -0
- edc_listboard/view_mixins/listboard_filter_view_mixin.py +5 -15
- edc_listboard/view_mixins/search_listboard_view_mixin.py +2 -6
- edc_listboard/views/listboard_view.py +2 -6
- edc_listboard/views/screen/screening_listboard_view.py +1 -3
- edc_listboard/views/subject/subject_listboard_view.py +1 -3
- edc_locator/forms/subject_locator_form_validator.py +4 -12
- edc_locator/migrations/0001_initial.py +3 -2
- edc_locator/migrations/0003_auto_20180103_1351.py +2 -1
- edc_locator/migrations/0004_auto_20180106_2148.py +2 -1
- edc_locator/migrations/0007_auto_20180117_1819.py +2 -1
- edc_locator/migrations/0011_auto_20181007_0053.py +1 -1
- edc_locator/migrations/0013_auto_20181007_0054.py +2 -3
- edc_locator/migrations/0014_auto_20181009_0545.py +1 -0
- edc_locator/migrations/0032_alter_subjectlocator_managers.py +1 -1
- edc_locator/migrations/0034_alter_historicalsubjectlocator_device_created_and_more.py +5 -13
- edc_locator/migrations/0039_alter_historicalsubjectlocator_revision_and_more.py +38 -0
- edc_locator/modeladmin_mixins.py +1 -3
- edc_locator/view_mixins/subject_locator_view_mixins.py +1 -3
- edc_ltfu/admin.py +1 -3
- edc_ltfu/forms/ltfu_form.py +1 -3
- edc_ltfu/forms/ltfu_form_validator_mixin.py +1 -2
- edc_ltfu/modelform_mixins.py +3 -8
- edc_metadata/admin/modeladmin_mixins.py +2 -8
- edc_metadata/management/commands/validate_entry_status.py +1 -3
- edc_metadata/metadata/metadata.py +12 -41
- edc_metadata/metadata/metadata_getter.py +2 -9
- edc_metadata/metadata/requisition_metadata_getter.py +1 -3
- edc_metadata/metadata_handler.py +3 -9
- edc_metadata/metadata_helper/metadata_helper_mixin.py +1 -3
- edc_metadata/metadata_mixins/source_model_metadata_mixin.py +3 -9
- edc_metadata/metadata_refresher.py +3 -9
- edc_metadata/metadata_rules/crf/crf_rule_group.py +2 -5
- edc_metadata/metadata_rules/persistant_singleton_mixin.py +3 -3
- edc_metadata/metadata_rules/requisition/requisition_rule_group.py +1 -2
- edc_metadata/metadata_rules/rule_evaluator.py +1 -3
- edc_metadata/metadata_rules/rule_group.py +2 -6
- edc_metadata/metadata_rules/rule_group_meta_options.py +1 -3
- edc_metadata/metadata_updater.py +1 -3
- edc_metadata/metadata_wrappers/metadata_wrapper.py +1 -3
- edc_metadata/migrations/0001_initial.py +2 -1
- edc_metadata/migrations/0002_auto_20161127_2226.py +6 -13
- edc_metadata/migrations/0005_auto_20170112_0602.py +2 -1
- edc_metadata/migrations/0007_auto_20170810_1032.py +2 -1
- edc_metadata/migrations/0009_auto_20180116_1528.py +2 -1
- edc_metadata/migrations/0014_auto_20190707_0002.py +1 -1
- edc_metadata/migrations/0015_auto_20190709_0009.py +3 -5
- edc_metadata/migrations/0021_alter_crfmetadata_managers_and_more.py +1 -1
- edc_metadata/migrations/0023_alter_crfmetadata_device_created_and_more.py +5 -13
- edc_metadata/migrations/0030_alter_crfmetadata_revision_and_more.py +38 -0
- edc_metadata/model_mixins/creates/creates_metadata_model_mixin.py +1 -3
- edc_metadata/model_mixins/updates/updates_metadata_model_mixin.py +1 -3
- edc_metadata/models/crf_metadata_model_mixin.py +2 -6
- edc_metadata/next_form_getter.py +1 -3
- edc_metadata/requisition/requisition_metadata_handler.py +3 -2
- edc_metadata/requisition/requisition_metadata_updater.py +1 -3
- edc_metadata/update_metadata_on_schedule_change.py +7 -14
- edc_model/models/fields/initials_field.py +1 -3
- edc_model/models/signals.py +1 -3
- edc_model/system_checks.py +1 -3
- edc_model/validators/duration.py +1 -3
- edc_model_admin/admin_site.py +1 -3
- edc_model_admin/changelist_buttons/model_admin_changelist_button_mixin.py +4 -12
- edc_model_admin/changelist_buttons/model_admin_changelist_model_button_mixin.py +1 -3
- edc_model_admin/dashboard/model_admin_crf_dashboard_mixin.py +1 -3
- edc_model_admin/dashboard/model_admin_dashboard_mixin.py +1 -3
- edc_model_admin/mixins/base_model_admin_redirect_mixin.py +2 -6
- edc_model_admin/mixins/inlines/limited_admin_inline_mixin.py +1 -3
- edc_model_admin/mixins/model_admin_bypass_default_form_cls_mixin.py +4 -12
- edc_model_admin/mixins/model_admin_form_auto_number_mixin.py +2 -6
- edc_model_admin/mixins/model_admin_form_instructions_mixin.py +2 -6
- edc_model_admin/mixins/model_admin_next_url_redirect_mixin.py +3 -9
- edc_model_admin/mixins/model_admin_protect_pii_mixin.py +1 -3
- edc_model_admin/mixins/model_admin_redirect_all_to_changelist_mixin.py +2 -6
- edc_model_admin/mixins/model_admin_redirect_on_delete_mixin.py +1 -3
- edc_model_admin/templatetags/edc_admin_modify.py +3 -9
- edc_model_fields/fields/initials_field.py +1 -3
- edc_model_form/mixins/inline_model_form_mixin.py +5 -9
- edc_model_to_dataframe/model_to_dataframe.py +15 -46
- edc_navbar/get_default_navbar.py +1 -3
- edc_navbar/migrations/0004_auto_20220825_0451.py +1 -1
- edc_navbar/migrations/0006_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_navbar/migrations/0008_alter_edcpermissions_revision.py +26 -0
- edc_navbar/navbar.py +1 -3
- edc_navbar/navbar_item.py +1 -3
- edc_navbar/site_navbars.py +2 -6
- edc_navbar/templatetags/edc_navbar_extras.py +1 -3
- edc_notification/admin_site.py +1 -3
- edc_notification/mailing_list_manager.py +5 -15
- edc_notification/migrations/0001_initial.py +2 -1
- edc_notification/migrations/0008_alter_notification_device_created_and_more.py +3 -7
- edc_notification/migrations/0010_alter_notification_revision.py +26 -0
- edc_notification/modeladmin_mixins.py +1 -3
- edc_notification/models/notification.py +1 -3
- edc_notification/models/signals.py +3 -10
- edc_notification/notification/model_notification.py +3 -9
- edc_notification/notification/notification.py +4 -12
- edc_notification/site_notifications.py +5 -14
- edc_offstudy/migrations/0001_initial.py +2 -1
- edc_offstudy/migrations/0002_auto_20180921_0434.py +4 -3
- edc_offstudy/migrations/0008_auto_20191102_0033.py +2 -1
- edc_offstudy/migrations/0015_auto_20220925_0032.py +1 -1
- edc_offstudy/migrations/0016_auto_20220929_1742.py +1 -0
- edc_offstudy/migrations/0018_alter_subjectoffstudy_managers.py +2 -1
- edc_offstudy/migrations/0019_alter_historicalsubjectoffstudy_device_created_and_more.py +5 -13
- edc_offstudy/migrations/0022_alter_historicalsubjectoffstudy_revision_and_more.py +41 -0
- edc_offstudy/model_mixins/offstudy_model_mixin.py +3 -3
- edc_offstudy/modelform_mixins/crf/offstudy_crf_modelform_mixin.py +2 -6
- edc_offstudy/templatetags/edc_offstudy_extras.py +2 -6
- edc_offstudy/utils.py +1 -3
- edc_pdf_reports/admin/modeladmin_mixins.py +1 -3
- edc_pdf_reports/crf_pdf_report.py +3 -9
- edc_pdf_reports/flowables/textbox.py +1 -3
- edc_pdf_reports/report.py +6 -18
- edc_pdf_reports/utils.py +1 -3
- edc_pdf_reports/views/pdf_intermediate_view.py +1 -3
- edc_pdf_reports/views/print_pdf_report_view.py +2 -6
- edc_pdutils/actions.py +4 -12
- edc_pdutils/choices.py +1 -4
- edc_pdutils/database.py +1 -3
- edc_pdutils/df_exporters/csv_crf_inline_tables_exporter.py +4 -12
- edc_pdutils/df_exporters/csv_exporter.py +7 -22
- edc_pdutils/df_handlers/crf_df_handler.py +3 -9
- edc_pdutils/df_handlers/df_handler.py +1 -3
- edc_pdutils/df_handlers/registered_subject_df_handler.py +1 -3
- edc_pdutils/management/commands/export_models.py +2 -6
- edc_pdutils/migrations/0001_initial.py +6 -9
- edc_pdutils/site.py +2 -6
- edc_pdutils/site_values_mappings.py +3 -9
- edc_pdutils/tables/aliquot.py +2 -9
- edc_pdutils/tables/consent.py +2 -6
- edc_pdutils/tables/crf.py +4 -12
- edc_pdutils/tables/requisition.py +4 -12
- edc_pdutils/tables/visit.py +1 -3
- edc_pdutils/utils/convert_dates_from_model.py +3 -9
- edc_pdutils/utils/convert_numerics_from_model.py +1 -3
- edc_pdutils/utils/convert_timedelta_from_model.py +1 -3
- edc_pdutils/utils/missing_subject_identifiers.py +1 -3
- edc_pharmacy/admin/actions/confirm_stock.py +2 -6
- edc_pharmacy/admin/actions/delete_order_items.py +1 -3
- edc_pharmacy/admin/actions/delete_receive_items.py +1 -3
- edc_pharmacy/admin/actions/print_stock_report.py +1 -3
- edc_pharmacy/admin/list_filters.py +5 -17
- edc_pharmacy/admin/model_admin_mixin.py +1 -3
- edc_pharmacy/admin/prescription/rx_admin.py +2 -6
- edc_pharmacy/admin/prescription/rx_refill_admin.py +1 -3
- edc_pharmacy/admin/reports/stock_availability_admin.py +1 -5
- edc_pharmacy/admin/stock/allocation_admin.py +5 -15
- edc_pharmacy/admin/stock/allocation_proxy_admin.py +1 -3
- edc_pharmacy/admin/stock/confirmation_admin.py +1 -3
- edc_pharmacy/admin/stock/confirmation_at_site_admin.py +4 -12
- edc_pharmacy/admin/stock/confirmation_at_site_item_admin.py +5 -17
- edc_pharmacy/admin/stock/dispense_admin.py +3 -11
- edc_pharmacy/admin/stock/dispense_item_admin.py +4 -14
- edc_pharmacy/admin/stock/order_admin.py +1 -3
- edc_pharmacy/admin/stock/order_item_admin.py +5 -15
- edc_pharmacy/admin/stock/receive_admin.py +4 -12
- edc_pharmacy/admin/stock/receive_item_admin.py +4 -12
- edc_pharmacy/admin/stock/repack_request_admin.py +2 -6
- edc_pharmacy/admin/stock/stock_adjustment_admin.py +1 -3
- edc_pharmacy/admin/stock/stock_admin.py +8 -24
- edc_pharmacy/admin/stock/stock_proxy_admin.py +1 -5
- edc_pharmacy/admin/stock/stock_request_admin.py +5 -4
- edc_pharmacy/admin/stock/stock_request_item_admin.py +10 -19
- edc_pharmacy/admin/stock/stock_transfer_admin.py +4 -12
- edc_pharmacy/admin/stock/stock_transfer_item_admin.py +6 -18
- edc_pharmacy/admin/stock/storage_bin_admin.py +3 -11
- edc_pharmacy/admin/stock/storage_bin_item_admin.py +4 -14
- edc_pharmacy/analytics/dataframes/get_next_scheduled_visit_for_subjects_df.py +1 -1
- edc_pharmacy/analytics/dataframes/in_stock_for_subjects_df.py +2 -6
- edc_pharmacy/analytics/dataframes/stock_for_subjects.py +1 -3
- edc_pharmacy/form_validators/crf/study_medication_form_validator.py +9 -27
- edc_pharmacy/forms/stock/container_form.py +2 -6
- edc_pharmacy/forms/stock/receive_item_form.py +2 -6
- edc_pharmacy/forms/stock/repack_request_form.py +4 -11
- edc_pharmacy/forms/stock/stock_request_form.py +1 -0
- edc_pharmacy/forms/stock/stock_request_item_form.py +1 -3
- edc_pharmacy/labels/draw_bulk_stock_label_code128.py +1 -3
- edc_pharmacy/labels/draw_bulk_stock_label_code39.py +3 -9
- edc_pharmacy/labels/draw_patient_stock_label_code128.py +1 -3
- edc_pharmacy/migrations/0001_initial.py +7 -15
- edc_pharmacy/migrations/0005_alter_rx_managers.py +2 -1
- edc_pharmacy/migrations/0015_auto_20220913_2139.py +9 -22
- edc_pharmacy/migrations/0016_auto_20220929_1742.py +2 -1
- edc_pharmacy/migrations/0018_alter_rxrefill_managers.py +1 -1
- edc_pharmacy/migrations/0020_alter_box_device_created_alter_box_device_modified_and_more.py +71 -211
- edc_pharmacy/migrations/0021_alter_box_options_alter_container_options_and_more.py +1 -1
- edc_pharmacy/migrations/0023_remove_rx_edc_pharmac_modifie_986021_idx_and_more.py +1 -3
- edc_pharmacy/migrations/0024_allocation_assignment_containerunits_dispense_and_more.py +40 -104
- edc_pharmacy/migrations/0031_historicalrepackrequest_task_id_and_more.py +2 -1
- edc_pharmacy/migrations/0033_container_display_name_and_more.py +1 -3
- edc_pharmacy/migrations/0035_container_max_per_subject_and_more.py +2 -6
- edc_pharmacy/migrations/0037_remove_historicalstock_confirmed_at_site_by_and_more.py +2 -6
- edc_pharmacy/migrations/0039_remove_dispense_registered_subject_and_more.py +7 -9
- edc_pharmacy/migrations/0043_stockproxy_alter_historicallot_lot_no_and_more.py +2 -1
- edc_pharmacy/migrations/0049_remove_stocktransferconfirmation_stock_and_more.py +5 -13
- edc_pharmacy/migrations/0050_remove_stocktransferconfirmation2_location_and_more.py +2 -6
- edc_pharmacy/migrations/0051_alter_historicalstocktransferconfirmationitem_options_and_more.py +2 -1
- edc_pharmacy/migrations/0053_alter_location_managers_alter_historicalstock_lot_and_more.py +7 -11
- edc_pharmacy/migrations/0057_scanduplicates.py +3 -4
- edc_pharmacy/migrations/0058_stockrequestproxy_alter_stockproxy_options.py +2 -1
- edc_pharmacy/migrations/0060_alter_container_max_per_subject_and_more.py +8 -14
- edc_pharmacy/migrations/0061_alter_historicalstocktransferconfirmation_options_and_more.py +1 -1
- edc_pharmacy/migrations/0062_auto_20250312_1433.py +2 -6
- edc_pharmacy/migrations/0063_alter_allocation_managers_remove_allocation_site_and_more.py +2 -1
- edc_pharmacy/migrations/0065_allocationproxy.py +2 -1
- edc_pharmacy/migrations/0068_stockout.py +2 -1
- edc_pharmacy/migrations/0076_historicalstockadjustment_stockadjustment.py +5 -8
- edc_pharmacy/migrations/0077_historicalstockadjustment_adjustment_datetime_and_more.py +2 -1
- edc_pharmacy/migrations/0078_alter_historicalstock_qty_and_more.py +2 -1
- edc_pharmacy/migrations/0081_historicalconfirmation_confirmation.py +8 -10
- edc_pharmacy/migrations/0084_confirmationatsiteitem_and_more.py +2 -2
- edc_pharmacy/migrations/0088_alter_allocation_revision_alter_assignment_revision_and_more.py +794 -0
- edc_pharmacy/model_mixins/study_medication_crf_model_mixin.py +3 -9
- edc_pharmacy/models/medication/dosage_guideline.py +1 -3
- edc_pharmacy/models/medication/formulation.py +1 -3
- edc_pharmacy/models/prescription/rx.py +1 -3
- edc_pharmacy/models/prescription/rx_refill.py +2 -6
- edc_pharmacy/models/signals.py +11 -21
- edc_pharmacy/models/stock/allocation.py +3 -9
- edc_pharmacy/models/stock/confirmation.py +1 -3
- edc_pharmacy/models/stock/confirmation_at_site_item.py +1 -3
- edc_pharmacy/models/stock/container.py +1 -3
- edc_pharmacy/models/stock/dispense.py +1 -3
- edc_pharmacy/models/stock/dispense_item.py +1 -3
- edc_pharmacy/models/stock/lot.py +1 -3
- edc_pharmacy/models/stock/order_item.py +2 -6
- edc_pharmacy/models/stock/product.py +2 -6
- edc_pharmacy/models/stock/receive_item.py +4 -12
- edc_pharmacy/models/stock/repack_request.py +1 -3
- edc_pharmacy/models/stock/stock.py +3 -8
- edc_pharmacy/models/stock/stock_request_item.py +4 -4
- edc_pharmacy/models/stock/stock_transfer_item.py +1 -3
- edc_pharmacy/models/stock/supplier.py +1 -3
- edc_pharmacy/models/storage/utils.py +1 -4
- edc_pharmacy/pdf_reports/manifest_pdf_report.py +3 -9
- edc_pharmacy/pdf_reports/stock_pdf_report.py +6 -11
- edc_pharmacy/refill/adjust_previous_end_datetime.py +2 -6
- edc_pharmacy/refill/create_next_refill.py +1 -3
- edc_pharmacy/refill/create_refill.py +1 -3
- edc_pharmacy/refill/refill_creator.py +2 -6
- edc_pharmacy/sample_usb_printing/network_printers.py +1 -3
- edc_pharmacy/settings.py +3 -9
- edc_pharmacy/urls.py +1 -3
- edc_pharmacy/utils/allocate_stock.py +1 -3
- edc_pharmacy/utils/confirm_stock_at_site.py +3 -5
- edc_pharmacy/utils/dispense.py +1 -4
- edc_pharmacy/utils/get_unit_qty_out.py +1 -3
- edc_pharmacy/utils/process_repack_request.py +1 -3
- edc_pharmacy/utils/process_repack_request_queryset.py +1 -3
- edc_pharmacy/utils/stock_request/bulk_create_stock_request_items.py +2 -6
- edc_pharmacy/utils/stock_request/get_instock_and_nostock_data.py +3 -8
- edc_pharmacy/utils/transfer_stock.py +1 -3
- edc_pharmacy/utils/update_previous_refill_end_datetime.py +1 -3
- edc_pharmacy/views/add_to_storage_bin_view.py +2 -6
- edc_pharmacy/views/allocate_to_subject_view.py +7 -21
- edc_pharmacy/views/confirm_stock_from_instance_view.py +2 -6
- edc_pharmacy/views/confirm_stock_from_queryset_view.py +2 -7
- edc_pharmacy/views/confirmation_at_site_view.py +10 -31
- edc_pharmacy/views/dispense_view.py +2 -6
- edc_pharmacy/views/move_to_storage_bin_view.py +2 -6
- edc_pharmacy/views/prepare_and_review_stock_request_view.py +3 -9
- edc_pharmacy/views/print_labels_view.py +1 -3
- edc_pharmacy/views/print_stock_transfer_manifest_view.py +1 -3
- edc_pharmacy/views/transfer_stock_view.py +1 -3
- edc_prn/modelform_mixins.py +1 -3
- edc_prn/prn.py +2 -6
- edc_prn/templatetags/edc_prn_extras.py +4 -8
- edc_protocol/research_protocol_config.py +2 -5
- edc_protocol_incident/admin/protocol_deviation_violation_admin.py +1 -3
- edc_protocol_incident/auth_objects.py +1 -3
- edc_protocol_incident/auths.py +1 -3
- edc_protocol_incident/form_validators/mixins.py +3 -9
- edc_protocol_incident/form_validators/protocol_deviation_violation_form_validator.py +6 -18
- edc_protocol_incident/form_validators/protocol_incident_form_validator.py +3 -8
- edc_protocol_incident/migrations/0001_initial.py +4 -3
- edc_protocol_incident/migrations/0001_squashed_0015_auto_20220927_0401.py +7 -12
- edc_protocol_incident/migrations/0005_protocolincident_historicalprotocolincident_and_more.py +4 -3
- edc_protocol_incident/migrations/0012_auto_20220913_2139.py +3 -9
- edc_protocol_incident/migrations/0020_alter_historicalprotocoldeviationviolation_device_created_and_more.py +9 -25
- edc_protocol_incident/migrations/0023_alter_historicalprotocoldeviationviolation_revision_and_more.py +65 -0
- edc_protocol_incident/model_mixins/protocol_deviation_violation_model_mixin.py +3 -7
- edc_protocol_incident/model_mixins/protocol_incident_model_mixin.py +1 -3
- edc_protocol_incident/urls.py +1 -3
- edc_pylabels/actions.py +2 -6
- edc_pylabels/admin/label_configuration_admin.py +4 -4
- edc_pylabels/drawing_callable_example.py +1 -3
- edc_pylabels/migrations/0001_initial.py +1 -3
- edc_pylabels/migrations/0002_alter_label_options_label_created_and_more.py +2 -6
- edc_pylabels/migrations/0005_labelconfiguration_delete_label_and_more.py +1 -3
- edc_pylabels/migrations/0012_alter_labelconfiguration_revision.py +26 -0
- edc_pylabels/models/label_configuration.py +1 -3
- edc_qareports/migrations/0001_initial.py +3 -4
- edc_qareports/migrations/0005_edcpermissions.py +2 -4
- edc_qareports/migrations/0006_qareportlog.py +2 -1
- edc_qareports/migrations/0007_qareportlog_edc_qarepor_accesse_738ffe_idx.py +1 -3
- edc_qareports/migrations/0017_auto_20240816_0256.py +1 -0
- edc_qareports/migrations/0018_alter_edcpermissions_revision_alter_note_revision.py +38 -0
- edc_qareports/model_mixins/note_model_mixin.py +1 -3
- edc_qareports/modeladmin_mixins/list_filters.py +8 -12
- edc_qareports/modeladmin_mixins/note_modeladmin_mixin.py +1 -3
- edc_qareports/modeladmin_mixins/on_study_missing_values_modeladmin_mixin.py +2 -6
- edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py +1 -3
- edc_qareports/sql_generator/crf_case.py +1 -5
- edc_qareports/sql_generator/sql_view_generator.py +1 -3
- edc_qareports/utils.py +4 -7
- edc_randomization/admin.py +1 -3
- edc_randomization/auths.py +2 -6
- edc_randomization/blinding.py +1 -3
- edc_randomization/migrations/0001_initial.py +3 -4
- edc_randomization/migrations/0009_edcpermissions.py +1 -1
- edc_randomization/migrations/0011_alter_edcpermissions_device_created_and_more.py +7 -19
- edc_randomization/migrations/0013_alter_edcpermissions_revision_and_more.py +50 -0
- edc_randomization/model_mixins.py +2 -5
- edc_randomization/randomization_list_importer.py +3 -7
- edc_randomization/randomization_list_verifier.py +2 -7
- edc_randomization/randomizer.py +4 -7
- edc_randomization/site_randomizers.py +1 -3
- edc_randomization/system_checks.py +1 -3
- edc_randomization/utils.py +2 -6
- edc_refusal/admin.py +1 -3
- edc_refusal/forms.py +1 -2
- edc_refusal/migrations/0001_initial.py +2 -1
- edc_refusal/migrations/0002_historicalsubjectrefusal.py +6 -4
- edc_refusal/migrations/0004_refusalreasons_plural_name.py +1 -3
- edc_refusal/migrations/0005_alter_subjectrefusal_options_and_more.py +2 -1
- edc_refusal/migrations/0006_alter_subjectrefusal_managers.py +2 -1
- edc_refusal/migrations/0008_alter_historicalsubjectrefusal_device_created_and_more.py +5 -13
- edc_refusal/migrations/0011_alter_historicalsubjectrefusal_revision_and_more.py +38 -0
- edc_registration/admin_site.py +1 -3
- edc_registration/migrations/0001_initial.py +3 -4
- edc_registration/migrations/0002_auto_20161127_2226.py +4 -7
- edc_registration/migrations/0004_auto_20161221_0018.py +2 -1
- edc_registration/migrations/0005_auto_20170111_1809.py +2 -1
- edc_registration/migrations/0008_auto_20170810_1032.py +2 -1
- edc_registration/migrations/0012_auto_20180116_1528.py +2 -1
- edc_registration/migrations/0015_auto_20181006_2257.py +1 -1
- edc_registration/migrations/0016_historicalregisteredsubject.py +5 -6
- edc_registration/migrations/0026_historicalregisteredsubject_familiar_name_and_more.py +1 -1
- edc_registration/migrations/0028_alter_registeredsubject_managers.py +1 -1
- edc_registration/migrations/0029_alter_historicalregisteredsubject_device_created_and_more.py +5 -13
- edc_registration/migrations/0032_alter_historicalregisteredsubject_revision_and_more.py +38 -0
- edc_registration/modeladmin_mixins.py +1 -3
- edc_registration/models/registered_subject.py +4 -11
- edc_registration/utils.py +1 -3
- edc_reportable/admin_site.py +1 -3
- edc_reportable/data/normal_data/africa.py +4 -14
- edc_reportable/evaluator.py +2 -6
- edc_reportable/forms/reportables_form_validator_mixin.py +5 -4
- edc_reportable/formula.py +2 -6
- edc_reportable/management/commands/export_reportables.py +1 -3
- edc_reportable/migrations/0001_initial.py +3 -9
- edc_reportable/migrations/0003_referencerangecollection_grade1_and_more.py +3 -9
- edc_reportable/migrations/0004_alter_referencerangecollection_grade3_and_more.py +4 -7
- edc_reportable/migrations/0006_alter_gradingdata_revision_and_more.py +370 -0
- edc_reportable/models/mw.py +1 -3
- edc_reportable/models/reference_model_mixins.py +1 -3
- edc_reportable/models/reference_range_collection.py +3 -9
- edc_reportable/post_migrate_signals.py +1 -3
- edc_reportable/reference_range_evaluator.py +4 -11
- edc_reportable/utils/convert_units.py +3 -4
- edc_reportable/utils/get_grade_for_value.py +3 -1
- edc_reportable/utils/get_reference_range_collection.py +2 -2
- edc_reportable/utils/load_data.py +1 -3
- edc_reportable/utils/molecular_weight_model_cls.py +1 -1
- edc_reportable/utils/update_grading_data.py +2 -6
- edc_review_dashboard/migrations/0001_initial.py +1 -1
- edc_review_dashboard/migrations/0003_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_review_dashboard/migrations/0005_alter_edcpermissions_revision.py +26 -0
- edc_review_dashboard/views/subject_review_listboard_view.py +1 -3
- edc_screening/eligibility.py +1 -3
- edc_screening/fc.py +1 -3
- edc_screening/migrations/0001_initial.py +1 -1
- edc_screening/migrations/0002_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_screening/migrations/0004_alter_edcpermissions_revision.py +26 -0
- edc_screening/model_mixins/eligibility_model_mixin.py +1 -3
- edc_screening/model_mixins/screening_fields_model_mixin.py +2 -0
- edc_screening/modelform_mixins.py +1 -3
- edc_screening/screening_eligibility.py +1 -0
- edc_search/search_slug.py +2 -6
- edc_search/updater.py +2 -5
- edc_sites/admin/site_model_admin_mixin.py +4 -12
- edc_sites/management/commands/sync_sites.py +1 -3
- edc_sites/migrations/0007_edcpermissions.py +2 -4
- edc_sites/migrations/0009_alter_edcpermissions_revision.py +26 -0
- edc_sites/single_site/get_languages.py +1 -3
- edc_sites/single_site/single_site.py +1 -1
- edc_sites/site.py +6 -12
- edc_sites/system_checks.py +1 -4
- edc_sites/utils/add_or_update_django_sites.py +2 -4
- edc_subject_dashboard/migrations/0001_initial.py +1 -1
- edc_subject_dashboard/migrations/0002_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_subject_dashboard/migrations/0004_alter_edcpermissions_revision.py +26 -0
- edc_subject_dashboard/requisition_labels.py +1 -3
- edc_subject_dashboard/requisition_report.py +5 -15
- edc_subject_dashboard/requisition_verifier.py +2 -7
- edc_subject_dashboard/templatetags/edc_subject_dashboard_extras.py +2 -6
- edc_subject_dashboard/view_mixins/subject_visit_view_mixin.py +1 -2
- edc_subject_dashboard/view_utils/crf_button.py +1 -3
- edc_subject_dashboard/view_utils/subject_consent_listboard_button.py +1 -3
- edc_subject_dashboard/view_utils/timepoint_status_button.py +1 -3
- edc_subject_dashboard/views/requisition_print_actions_view.py +4 -12
- edc_subject_dashboard/views/requisition_verify_actions_view.py +1 -3
- edc_subject_dashboard/views/subject_dashboard_view.py +1 -3
- edc_timepoint/apps.py +1 -3
- edc_timepoint/timepoint.py +1 -3
- edc_timepoint/timepoint_lookup.py +1 -3
- edc_transfer/form_validators.py +4 -6
- edc_transfer/model_mixins.py +1 -3
- edc_transfer/modelform_mixins.py +1 -3
- edc_unblinding/action_items.py +1 -3
- edc_unblinding/admin_site.py +1 -3
- edc_unblinding/migrations/0001_initial.py +6 -4
- edc_unblinding/migrations/0002_auto_20210908_2318.py +1 -1
- edc_unblinding/migrations/0009_alter_unblindingrequest_managers_and_more.py +2 -1
- edc_unblinding/migrations/0010_alter_historicalunblindingrequest_device_created_and_more.py +9 -25
- edc_unblinding/migrations/0013_alter_historicalunblindingrequest_revision_and_more.py +62 -0
- edc_unblinding/models/unblinding_request.py +1 -3
- edc_unblinding/models/unblinding_review.py +1 -3
- edc_utils/age.py +1 -3
- edc_utils/date.py +1 -3
- edc_utils/paths_for_urlpatterns.py +1 -3
- edc_utils/show_urls.py +1 -3
- edc_utils/text.py +1 -2
- edc_view_utils/model_button.py +5 -13
- edc_view_utils/query_button.py +1 -3
- edc_visit_schedule/admin/subject_schedule_history_admin.py +1 -3
- edc_visit_schedule/baseline.py +1 -3
- edc_visit_schedule/migrations/0001_initial.py +3 -4
- edc_visit_schedule/migrations/0003_historicalvisitschedule_visitschedule.py +1 -3
- edc_visit_schedule/migrations/0004_auto_20190629_1800.py +1 -3
- edc_visit_schedule/migrations/0011_alter_historicalvisitschedule_device_created_and_more.py +7 -19
- edc_visit_schedule/migrations/0012_alter_subjectschedulehistory_managers_and_more.py +2 -1
- edc_visit_schedule/migrations/0015_historicalonschedule_offschedule_onschedule.py +9 -13
- edc_visit_schedule/migrations/0017_alter_onschedule_managers.py +2 -1
- edc_visit_schedule/migrations/0018_alter_historicalonschedule_revision_and_more.py +86 -0
- edc_visit_schedule/model_mixins/crf/crf_schedule_model_mixin.py +1 -1
- edc_visit_schedule/model_mixins/off_schedule_model_mixin.py +2 -6
- edc_visit_schedule/model_mixins/on_schedule_model_mixin.py +1 -3
- edc_visit_schedule/modelform_mixins/off_schedule_modelform_mixin.py +1 -3
- edc_visit_schedule/models/subject_schedule_history.py +3 -8
- edc_visit_schedule/ordered_collection.py +1 -3
- edc_visit_schedule/schedule/schedule.py +10 -20
- edc_visit_schedule/simple_model_validator.py +3 -8
- edc_visit_schedule/site_visit_schedules.py +6 -16
- edc_visit_schedule/subject_schedule.py +6 -17
- edc_visit_schedule/system_checks.py +1 -3
- edc_visit_schedule/utils.py +8 -17
- edc_visit_schedule/view_mixins.py +4 -10
- edc_visit_schedule/visit/crf.py +1 -2
- edc_visit_schedule/visit/requisition.py +1 -3
- edc_visit_schedule/visit/visit.py +6 -16
- edc_visit_schedule/visit/window_period.py +3 -3
- edc_visit_schedule/visit_schedule/visit_schedule.py +2 -5
- edc_visit_tracking/crf_date_validator.py +1 -2
- edc_visit_tracking/form_validators/visit_form_validator.py +2 -8
- edc_visit_tracking/form_validators/visit_missed_form_validator.py +3 -9
- edc_visit_tracking/migrations/0003_auto_20220913_2139.py +2 -6
- edc_visit_tracking/migrations/0004_subjectvisit_subjectvisitmissedreasons_extra_value_and_more.py +8 -16
- edc_visit_tracking/migrations/0008_alter_historicalsubjectvisit_revision_and_more.py +65 -0
- edc_visit_tracking/model_mixins/base/visit_methods_model_mixin.py +2 -6
- edc_visit_tracking/model_mixins/crfs/visit_tracking_crf_model_mixin.py +1 -3
- edc_visit_tracking/model_mixins/requisitions/visit_tracking_requisition_model_mixin.py +1 -3
- edc_visit_tracking/model_mixins/subject_visit_missed_model_mixin.py +1 -3
- edc_visit_tracking/model_mixins/visit_model_mixin/visit_model_fields_mixin.py +1 -2
- edc_visit_tracking/modeladmin_mixins/crf_model_admin_mixin.py +4 -8
- edc_visit_tracking/modeladmin_mixins/visit_model_admin_mixin.py +4 -6
- edc_visit_tracking/modelform_mixins/crf/visit_tracking_crf_modelform_mixin.py +2 -6
- edc_visit_tracking/modelform_mixins/utils.py +1 -3
- edc_visit_tracking/modelform_mixins/visit_tracking_modelform_mixin.py +1 -2
- edc_visit_tracking/models/signals.py +1 -3
- edc_visit_tracking/stubs.py +1 -3
- edc_visit_tracking/utils.py +1 -2
- edc_visit_tracking/view_utils/related_visit_button.py +1 -3
- edc_visit_tracking/visit_sequence.py +1 -3
- edc_vitals/__init__.py +2 -0
- edc_vitals/apps.py +6 -0
- edc_vitals/calculators/__init__.py +1 -0
- edc_vitals/calculators/bmi.py +70 -0
- edc_vitals/form_validators/__init__.py +5 -0
- edc_vitals/form_validators/blood_pressure_form_validator_mixin.py +40 -0
- edc_vitals/form_validators/bmi_form_validator_mixin.py +19 -0
- edc_vitals/form_validators/weight_height_with_bmi_form_validator_mixin.py +13 -0
- edc_vitals/migrations/__init__.py +0 -0
- edc_vitals/model_mixins/__init__.py +5 -0
- edc_vitals/model_mixins/blood_pressure_model_mixin.py +80 -0
- edc_vitals/model_mixins/weight_height_bmi_model_mixin.py +42 -0
- edc_vitals/models/__init__.py +10 -0
- edc_vitals/models/fields/__init__.py +7 -0
- edc_vitals/models/fields/blood_pressure.py +36 -0
- edc_vitals/models/fields/heart_rate.py +22 -0
- edc_vitals/models/fields/height.py +26 -0
- edc_vitals/models/fields/respiratory_rate.py +22 -0
- edc_vitals/models/fields/temperature.py +26 -0
- edc_vitals/models/fields/waist_circumference.py +23 -0
- edc_vitals/models/fields/weight.py +26 -0
- edc_vitals/utils.py +51 -0
- edc_vitals/validators.py +5 -0
- edc_lab_results/model_mixin_factory/__init__.py +0 -2
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -128,9 +128,7 @@ class IssueAdmin(
|
|
|
128
128
|
|
|
129
129
|
@admin.display(description="Message", ordering="short_message")
|
|
130
130
|
def error_msg(self, obj):
|
|
131
|
-
return format_html(
|
|
132
|
-
"<BR>".join(wrap(obj.short_message, 45)).replace(" ", " ")
|
|
133
|
-
)
|
|
131
|
+
return format_html("<BR>".join(wrap(obj.short_message, 45)).replace(" ", " "))
|
|
134
132
|
|
|
135
133
|
@admin.display(description="Visit", ordering="visit_code")
|
|
136
134
|
def visit(self, obj):
|
|
@@ -139,9 +137,7 @@ class IssueAdmin(
|
|
|
139
137
|
@admin.display(description="Document", ordering="verbose_name")
|
|
140
138
|
def document(self, obj):
|
|
141
139
|
if obj.panel_name:
|
|
142
|
-
return (
|
|
143
|
-
f"{obj.verbose_name.title()} {obj.panel_name.replace('_', ' ').title()}"
|
|
144
|
-
)
|
|
140
|
+
return f"{obj.verbose_name.title()} {obj.panel_name.replace('_', ' ').title()}"
|
|
145
141
|
return obj.verbose_name
|
|
146
142
|
|
|
147
143
|
def get_subject_dashboard_url_kwargs(self, obj) -> dict:
|
edc_form_runners/form_runner.py
CHANGED
|
@@ -79,9 +79,7 @@ class FormRunner:
|
|
|
79
79
|
form = self.modelform_cls(data, instance=src_obj)
|
|
80
80
|
form.is_valid()
|
|
81
81
|
errors = {
|
|
82
|
-
k: v
|
|
83
|
-
for k, v in form._errors.items()
|
|
84
|
-
if k not in self.get_exclude_formfields()
|
|
82
|
+
k: v for k, v in form._errors.items() if k not in self.get_exclude_formfields()
|
|
85
83
|
}
|
|
86
84
|
if errors:
|
|
87
85
|
for fldname, errmsg in errors.items():
|
|
@@ -112,10 +110,7 @@ class FormRunner:
|
|
|
112
110
|
)
|
|
113
111
|
|
|
114
112
|
fields = [
|
|
115
|
-
k
|
|
116
|
-
for k, v in getattr(
|
|
117
|
-
self.modeladmin_cls.form(), "fields", {}
|
|
118
|
-
).items()
|
|
113
|
+
k for k, v in getattr(self.modeladmin_cls.form(), "fields", {}).items()
|
|
119
114
|
]
|
|
120
115
|
fields = list(set(fields))
|
|
121
116
|
return fields
|
|
@@ -151,9 +146,7 @@ class FormRunner:
|
|
|
151
146
|
def unique_opts(self, src_obj: Model) -> dict[str, Any]:
|
|
152
147
|
"""Note: unique constraint includes `field_name`"""
|
|
153
148
|
model_obj_or_related_visit = src_obj
|
|
154
|
-
get_related_visit_model_attr = getattr(
|
|
155
|
-
src_obj, "related_visit_model_attr", None
|
|
156
|
-
)
|
|
149
|
+
get_related_visit_model_attr = getattr(src_obj, "related_visit_model_attr", None)
|
|
157
150
|
if (
|
|
158
151
|
get_related_visit_model_attr
|
|
159
152
|
and get_related_visit_model_attr()
|
|
@@ -185,9 +178,7 @@ class FormRunner:
|
|
|
185
178
|
|
|
186
179
|
@property
|
|
187
180
|
def src_qs(self) -> QuerySet:
|
|
188
|
-
return self.src_model_cls.objects.filter(
|
|
189
|
-
**(self.get_src_filter_options() or {})
|
|
190
|
-
)
|
|
181
|
+
return self.src_model_cls.objects.filter(**(self.get_src_filter_options() or {}))
|
|
191
182
|
|
|
192
183
|
def get_form_data(self, src_obj: Any) -> dict[str, Any]:
|
|
193
184
|
data = {
|
|
@@ -30,7 +30,5 @@ class BaseFormRunnerBySrcId:
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class FormRunnerBySrcId(BaseFormRunnerBySrcId, FormRunner):
|
|
33
|
-
def __init__(
|
|
34
|
-
self, src_id: uuid.UUID, model_name: str | None, verbose: bool | None = None
|
|
35
|
-
):
|
|
33
|
+
def __init__(self, src_id: uuid.UUID, model_name: str | None, verbose: bool | None = None):
|
|
36
34
|
super().__init__(src_id=src_id, model_name=model_name, verbose=verbose)
|
|
@@ -6,9 +6,7 @@ from .site import site_form_runners
|
|
|
6
6
|
__all__ = ["get_form_runner"]
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def get_form_runner(
|
|
10
|
-
model_name: str | None = None, verbose: bool | None = None
|
|
11
|
-
) -> FormRunner:
|
|
9
|
+
def get_form_runner(model_name: str | None = None, verbose: bool | None = None) -> FormRunner:
|
|
12
10
|
if form_runner_cls := site_form_runners.registry.get(model_name):
|
|
13
11
|
return form_runner_cls(model_name=model_name, verbose=verbose)
|
|
14
12
|
return FormRunner(model_name=model_name, verbose=verbose)
|
|
@@ -14,7 +14,7 @@ def get_form_runner_by_src_id(
|
|
|
14
14
|
verbose: bool | None = None,
|
|
15
15
|
) -> BaseFormRunnerBySrcId | FormRunnerBySrcId:
|
|
16
16
|
if form_runner_cls := site_form_runners.registry.get(model_name):
|
|
17
|
-
return type(
|
|
18
|
-
|
|
19
|
-
)
|
|
17
|
+
return type("CustomFormRunnerBySrcId", (BaseFormRunnerBySrcId, form_runner_cls), {})(
|
|
18
|
+
src_id=src_id, model_name=model_name
|
|
19
|
+
)
|
|
20
20
|
return FormRunnerBySrcId(src_id=src_id, model_name=model_name, verbose=verbose)
|
|
@@ -87,9 +87,7 @@ def get_model_names(app_labels, model_names, skip_model_names):
|
|
|
87
87
|
for app_config in django_apps.get_app_configs():
|
|
88
88
|
if app_config.name in app_labels:
|
|
89
89
|
for model_cls in app_config.get_models():
|
|
90
|
-
if not model_cls._meta.label_lower.split(".")[1].startswith(
|
|
91
|
-
"historical"
|
|
92
|
-
):
|
|
90
|
+
if not model_cls._meta.label_lower.split(".")[1].startswith("historical"):
|
|
93
91
|
model_names.append(model_cls._meta.label_lower)
|
|
94
92
|
|
|
95
93
|
return [m for m in model_names if m not in skip_model_names]
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Generated by Django 4.2.7 on 2023-11-28 19:39
|
|
2
2
|
|
|
3
3
|
import _socket
|
|
4
|
-
from django.db import migrations, models
|
|
5
4
|
import django.db.models.deletion
|
|
6
5
|
import django_audit_fields.fields.hostname_modification_field
|
|
7
6
|
import django_audit_fields.fields.userfield
|
|
8
7
|
import django_audit_fields.fields.uuid_auto_field
|
|
9
8
|
import django_audit_fields.models.audit_model_mixin
|
|
10
9
|
import django_revision.revision_field
|
|
10
|
+
from django.db import migrations, models
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Migration(migrations.Migration):
|
|
@@ -85,9 +85,7 @@ class Migration(migrations.Migration):
|
|
|
85
85
|
),
|
|
86
86
|
(
|
|
87
87
|
"device_created",
|
|
88
|
-
models.CharField(
|
|
89
|
-
blank=True, max_length=10, verbose_name="Device created"
|
|
90
|
-
),
|
|
88
|
+
models.CharField(blank=True, max_length=10, verbose_name="Device created"),
|
|
91
89
|
),
|
|
92
90
|
(
|
|
93
91
|
"device_modified",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by Django 5.2.4 on 2025-09-10 03:24
|
|
2
|
+
|
|
3
|
+
import django_revision.revision_field
|
|
4
|
+
from django.db import migrations
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("edc_form_runners", "0003_alter_issue_visit_code_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="issue",
|
|
16
|
+
name="revision",
|
|
17
|
+
field=django_revision.revision_field.RevisionField(
|
|
18
|
+
blank=True,
|
|
19
|
+
editable=False,
|
|
20
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
21
|
+
max_length=75,
|
|
22
|
+
null=True,
|
|
23
|
+
verbose_name="Revision",
|
|
24
|
+
),
|
|
25
|
+
),
|
|
26
|
+
]
|
|
@@ -23,9 +23,7 @@ def run_form_runners(
|
|
|
23
23
|
for app_config in django_apps.get_app_configs():
|
|
24
24
|
if app_config.name in app_labels:
|
|
25
25
|
for model_cls in app_config.get_models():
|
|
26
|
-
if not model_cls._meta.label_lower.split(".")[1].startswith(
|
|
27
|
-
"historical"
|
|
28
|
-
):
|
|
26
|
+
if not model_cls._meta.label_lower.split(".")[1].startswith("historical"):
|
|
29
27
|
model_names.append(model_cls._meta.label_lower)
|
|
30
28
|
if not model_names:
|
|
31
29
|
raise FormRunnerError("Nothing to do.")
|
edc_form_runners/utils.py
CHANGED
|
@@ -19,9 +19,7 @@ if TYPE_CHECKING:
|
|
|
19
19
|
|
|
20
20
|
from .models import Issue
|
|
21
21
|
|
|
22
|
-
class RelatedVisitModel(
|
|
23
|
-
SiteModelMixin, CreatesMetadataModelMixin, Base, BaseUuidModel
|
|
24
|
-
):
|
|
22
|
+
class RelatedVisitModel(SiteModelMixin, CreatesMetadataModelMixin, Base, BaseUuidModel):
|
|
25
23
|
pass
|
|
26
24
|
|
|
27
25
|
|
|
@@ -16,9 +16,7 @@ class ApplicableFieldValidator(BaseFormValidator):
|
|
|
16
16
|
msg: Optional[str] = None,
|
|
17
17
|
applicable_msg: Optional[str] = None,
|
|
18
18
|
) -> None:
|
|
19
|
-
message = {
|
|
20
|
-
field: applicable_msg or f"This field is applicable. {msg or ''}".strip()
|
|
21
|
-
}
|
|
19
|
+
message = {field: applicable_msg or f"This field is applicable. {msg or ''}".strip()}
|
|
22
20
|
self.raise_validation_error(message, APPLICABLE_ERROR)
|
|
23
21
|
|
|
24
22
|
def raise_not_applicable(
|
|
@@ -28,8 +26,7 @@ class ApplicableFieldValidator(BaseFormValidator):
|
|
|
28
26
|
not_applicable_msg: Optional[str] = None,
|
|
29
27
|
) -> None:
|
|
30
28
|
message = {
|
|
31
|
-
field: not_applicable_msg
|
|
32
|
-
or f"This field is not applicable. {msg or ''}".strip()
|
|
29
|
+
field: not_applicable_msg or f"This field is not applicable. {msg or ''}".strip()
|
|
33
30
|
}
|
|
34
31
|
self.raise_validation_error(message, NOT_APPLICABLE_ERROR)
|
|
35
32
|
|
|
@@ -120,12 +117,9 @@ class ApplicableFieldValidator(BaseFormValidator):
|
|
|
120
117
|
field_applicable_value = self.get(field_applicable)
|
|
121
118
|
|
|
122
119
|
if field_value in responses and (
|
|
123
|
-
field_applicable_value is None
|
|
124
|
-
or field_applicable_value == not_applicable
|
|
120
|
+
field_applicable_value is None or field_applicable_value == not_applicable
|
|
125
121
|
):
|
|
126
|
-
self.raise_applicable(
|
|
127
|
-
field_applicable, msg=msg, applicable_msg=applicable_msg
|
|
128
|
-
)
|
|
122
|
+
self.raise_applicable(field_applicable, msg=msg, applicable_msg=applicable_msg)
|
|
129
123
|
elif (
|
|
130
124
|
field_value not in responses
|
|
131
125
|
and field_applicable_value != not_applicable
|
|
@@ -157,10 +151,7 @@ class ApplicableFieldValidator(BaseFormValidator):
|
|
|
157
151
|
if is_instance_field:
|
|
158
152
|
self.update_cleaned_data_from_instance(field)
|
|
159
153
|
if field in self.cleaned_data and field_applicable in self.cleaned_data:
|
|
160
|
-
if (
|
|
161
|
-
self.get(field) in responses
|
|
162
|
-
and self.get(field_applicable) != not_applicable
|
|
163
|
-
):
|
|
154
|
+
if self.get(field) in responses and self.get(field_applicable) != not_applicable:
|
|
164
155
|
self.raise_not_applicable(
|
|
165
156
|
field_applicable, msg=msg, not_applicable_msg=not_applicable_msg
|
|
166
157
|
)
|
|
@@ -168,9 +159,7 @@ class ApplicableFieldValidator(BaseFormValidator):
|
|
|
168
159
|
self.get(field) not in responses
|
|
169
160
|
and self.get(field_applicable) == not_applicable
|
|
170
161
|
):
|
|
171
|
-
self.raise_applicable(
|
|
172
|
-
field_applicable, msg=msg, applicable_msg=applicable_msg
|
|
173
|
-
)
|
|
162
|
+
self.raise_applicable(field_applicable, msg=msg, applicable_msg=applicable_msg)
|
|
174
163
|
return False
|
|
175
164
|
|
|
176
165
|
def applicable_if_true(
|
|
@@ -95,9 +95,7 @@ class BaseFormValidator:
|
|
|
95
95
|
field_value = self.cleaned_data.get(field)
|
|
96
96
|
return field_value
|
|
97
97
|
|
|
98
|
-
def raise_validation_error(
|
|
99
|
-
self, message: dict[str, str] | str, error_code: str
|
|
100
|
-
) -> None:
|
|
98
|
+
def raise_validation_error(self, message: dict[str, str] | str, error_code: str) -> None:
|
|
101
99
|
if isinstance(message, str):
|
|
102
100
|
message = {NON_FIELD_ERRORS: message}
|
|
103
101
|
self._errors.update(message)
|
|
@@ -39,9 +39,7 @@ class DateRangeFieldValidator(BaseFormValidator):
|
|
|
39
39
|
msg = msg or f"Invalid. Cannot be before {date_field1} "
|
|
40
40
|
if date1 and date2:
|
|
41
41
|
if date1 > date2:
|
|
42
|
-
raise forms.ValidationError(
|
|
43
|
-
{message_on_field or date_field2: f"{msg}."}
|
|
44
|
-
)
|
|
42
|
+
raise forms.ValidationError({message_on_field or date_field2: f"{msg}."})
|
|
45
43
|
|
|
46
44
|
def date_not_after(
|
|
47
45
|
self,
|
|
@@ -111,9 +109,7 @@ class DateRangeFieldValidator(BaseFormValidator):
|
|
|
111
109
|
{datetime_field1: f"{msg}. Got {formatted_datetime(datetime2)}."}
|
|
112
110
|
)
|
|
113
111
|
|
|
114
|
-
def datetime_not_after(
|
|
115
|
-
self, datetime_field1: str, datetime_field2: str, msg=None
|
|
116
|
-
) -> None:
|
|
112
|
+
def datetime_not_after(self, datetime_field1: str, datetime_field2: str, msg=None) -> None:
|
|
117
113
|
datetime_field1 = self.cleaned_data.get(datetime_field1)
|
|
118
114
|
datetime_field2 = self.cleaned_data.get(datetime_field2)
|
|
119
115
|
msg = msg or f"Invalid. Cannot be before date of {datetime_field2} "
|
|
@@ -123,9 +119,7 @@ class DateRangeFieldValidator(BaseFormValidator):
|
|
|
123
119
|
if datetime_field1 > datetime_field2:
|
|
124
120
|
raise forms.ValidationError({datetime_field1: f"{msg}"})
|
|
125
121
|
|
|
126
|
-
def datetime_equal(
|
|
127
|
-
self, datetime_field1: str, datetime_field2: str, msg=None
|
|
128
|
-
) -> None:
|
|
122
|
+
def datetime_equal(self, datetime_field1: str, datetime_field2: str, msg=None) -> None:
|
|
129
123
|
datetime_field1 = self.cleaned_data.get(datetime_field1)
|
|
130
124
|
datetime_field2 = self.cleaned_data.get(datetime_field2)
|
|
131
125
|
msg = msg or f"Invalid. Cannot be before date of {datetime_field2} "
|
|
@@ -134,7 +128,5 @@ class DateRangeFieldValidator(BaseFormValidator):
|
|
|
134
128
|
datetime_field2 = to_utc(datetime_field2)
|
|
135
129
|
if datetime_field1 == datetime_field2:
|
|
136
130
|
raise forms.ValidationError(
|
|
137
|
-
{
|
|
138
|
-
datetime_field1: f"{msg}. Got {formatted_datetime(datetime_field2)}."
|
|
139
|
-
}
|
|
131
|
+
{datetime_field1: f"{msg}. Got {formatted_datetime(datetime_field2)}."}
|
|
140
132
|
)
|
|
@@ -40,9 +40,7 @@ class DateValidator(BaseFormValidator):
|
|
|
40
40
|
)
|
|
41
41
|
field_value = field_value or self._get_as_date(field)
|
|
42
42
|
if field_value and reference_value:
|
|
43
|
-
if not self._compare_date_to_reference_value(
|
|
44
|
-
op, field_value, reference_value
|
|
45
|
-
):
|
|
43
|
+
if not self._compare_date_to_reference_value(op, field_value, reference_value):
|
|
46
44
|
if field:
|
|
47
45
|
self.raise_validation_error({field: msg}, INVALID_ERROR)
|
|
48
46
|
else:
|
|
@@ -197,9 +195,7 @@ class DateValidator(BaseFormValidator):
|
|
|
197
195
|
"""Convenience method if comparing with report_datetime."""
|
|
198
196
|
msg = None
|
|
199
197
|
report_datetime_field = report_datetime_field or "report_datetime"
|
|
200
|
-
if self.cleaned_data.get(field) and self.cleaned_data.get(
|
|
201
|
-
report_datetime_field
|
|
202
|
-
):
|
|
198
|
+
if self.cleaned_data.get(field) and self.cleaned_data.get(report_datetime_field):
|
|
203
199
|
dte = self.cleaned_data.get(report_datetime_field).strftime(
|
|
204
200
|
convert_php_dateformat(settings.DATETIME_FORMAT)
|
|
205
201
|
)
|
|
@@ -221,9 +217,7 @@ class DateValidator(BaseFormValidator):
|
|
|
221
217
|
"""Convenience method if comparing with report_datetime."""
|
|
222
218
|
msg = None
|
|
223
219
|
report_datetime_field = report_datetime_field or "report_datetime"
|
|
224
|
-
if self.cleaned_data.get(field) and self.cleaned_data.get(
|
|
225
|
-
report_datetime_field
|
|
226
|
-
):
|
|
220
|
+
if self.cleaned_data.get(field) and self.cleaned_data.get(report_datetime_field):
|
|
227
221
|
dte = self.cleaned_data.get(report_datetime_field).strftime(
|
|
228
222
|
convert_php_dateformat(settings.DATETIME_FORMAT)
|
|
229
223
|
)
|
|
@@ -124,9 +124,7 @@ class ManyToManyFieldValidator(BaseFormValidator):
|
|
|
124
124
|
"""
|
|
125
125
|
code: Optional[str] = None
|
|
126
126
|
message: dict = {}
|
|
127
|
-
if self.cleaned_data.get(field) == response and not self.cleaned_data.get(
|
|
128
|
-
m2m_field
|
|
129
|
-
):
|
|
127
|
+
if self.cleaned_data.get(field) == response and not self.cleaned_data.get(m2m_field):
|
|
130
128
|
message = {m2m_field: "This field is required"}
|
|
131
129
|
code = REQUIRED_ERROR
|
|
132
130
|
elif (
|
|
@@ -47,9 +47,7 @@ class OtherSpecifyFieldValidator(BaseFormValidator):
|
|
|
47
47
|
and not cleaned_data.get(other_specify_field)
|
|
48
48
|
):
|
|
49
49
|
ref = "" if not ref else f" ref: {ref}"
|
|
50
|
-
message = {
|
|
51
|
-
other_specify_field: required_msg or f"This field is required.{ref}"
|
|
52
|
-
}
|
|
50
|
+
message = {other_specify_field: required_msg or f"This field is required.{ref}"}
|
|
53
51
|
self._errors.update(message)
|
|
54
52
|
self._error_codes.append(REQUIRED_ERROR)
|
|
55
53
|
raise ValidationError(message, code=REQUIRED_ERROR)
|
|
@@ -60,8 +58,7 @@ class OtherSpecifyFieldValidator(BaseFormValidator):
|
|
|
60
58
|
):
|
|
61
59
|
ref = "" if not ref else f" ref: {ref}"
|
|
62
60
|
message = {
|
|
63
|
-
other_specify_field: not_required_msg
|
|
64
|
-
or f"This field is not required.{ref}"
|
|
61
|
+
other_specify_field: not_required_msg or f"This field is not required.{ref}"
|
|
65
62
|
}
|
|
66
63
|
self._errors.update(message)
|
|
67
64
|
self._error_codes.append(NOT_REQUIRED_ERROR)
|
|
@@ -69,8 +66,7 @@ class OtherSpecifyFieldValidator(BaseFormValidator):
|
|
|
69
66
|
elif field_value is None and cleaned_data.get(other_specify_field):
|
|
70
67
|
ref = "" if not ref else f" ref: {ref}"
|
|
71
68
|
message = {
|
|
72
|
-
other_specify_field: not_required_msg
|
|
73
|
-
or f"This field is not required.{ref}"
|
|
69
|
+
other_specify_field: not_required_msg or f"This field is not required.{ref}"
|
|
74
70
|
}
|
|
75
71
|
self._errors.update(message)
|
|
76
72
|
self._error_codes.append(NOT_REQUIRED_ERROR)
|
|
@@ -28,9 +28,7 @@ class RangeFieldValidator(BaseFormValidator):
|
|
|
28
28
|
if value is None and allow_none:
|
|
29
29
|
pass
|
|
30
30
|
elif value is None and not allow_none:
|
|
31
|
-
self.raise_validation_error(
|
|
32
|
-
{field: "This field is required."}, REQUIRED_ERROR
|
|
33
|
-
)
|
|
31
|
+
self.raise_validation_error({field: "This field is required."}, REQUIRED_ERROR)
|
|
34
32
|
elif r.match(str(value)):
|
|
35
33
|
lower_op = "<" if not lower_inclusive else "<="
|
|
36
34
|
upper_op = "<" if not upper_inclusive else "<="
|
|
@@ -23,9 +23,7 @@ class RequiredFieldValidator(BaseFormValidator):
|
|
|
23
23
|
self, field: str, msg: Optional[str] = None, inline_set: Optional[str] = None
|
|
24
24
|
) -> None:
|
|
25
25
|
if inline_set:
|
|
26
|
-
default_errmsg = _(
|
|
27
|
-
"Based on your responses, inline information is required."
|
|
28
|
-
)
|
|
26
|
+
default_errmsg = _("Based on your responses, inline information is required.")
|
|
29
27
|
message = {"__all__": (msg or default_errmsg).strip()}
|
|
30
28
|
else:
|
|
31
29
|
errmsg = _("This field is required")
|
|
@@ -37,9 +35,7 @@ class RequiredFieldValidator(BaseFormValidator):
|
|
|
37
35
|
self, field: str, msg: Optional[str] = None, inline_set: Optional[str] = None
|
|
38
36
|
) -> None:
|
|
39
37
|
if inline_set:
|
|
40
|
-
default_errmsg = _(
|
|
41
|
-
"Based on your responses, inline information is not required."
|
|
42
|
-
)
|
|
38
|
+
default_errmsg = _("Based on your responses, inline information is not required.")
|
|
43
39
|
message = {"__all__": (msg or default_errmsg).strip()}
|
|
44
40
|
else:
|
|
45
41
|
errmsg = _("This field is not required")
|
|
@@ -113,10 +109,7 @@ class RequiredFieldValidator(BaseFormValidator):
|
|
|
113
109
|
field_value not in responses
|
|
114
110
|
and (
|
|
115
111
|
field_required_has_value
|
|
116
|
-
and (
|
|
117
|
-
self.get(field_required, inline_set=inline_set)
|
|
118
|
-
!= NOT_APPLICABLE
|
|
119
|
-
)
|
|
112
|
+
and (self.get(field_required, inline_set=inline_set) != NOT_APPLICABLE)
|
|
120
113
|
)
|
|
121
114
|
):
|
|
122
115
|
self.raise_not_required(
|
|
@@ -252,11 +245,7 @@ class RequiredFieldValidator(BaseFormValidator):
|
|
|
252
245
|
self.update_cleaned_data_from_instance(field)
|
|
253
246
|
self._inspect_params(*responses, field=field, field_required=field_required)
|
|
254
247
|
if field in self.cleaned_data and field_required in self.cleaned_data:
|
|
255
|
-
if (
|
|
256
|
-
DWTA in responses
|
|
257
|
-
and optional_if_dwta
|
|
258
|
-
and self.cleaned_data.get(field) == DWTA
|
|
259
|
-
):
|
|
248
|
+
if DWTA in responses and optional_if_dwta and self.cleaned_data.get(field) == DWTA:
|
|
260
249
|
pass
|
|
261
250
|
elif self.cleaned_data.get(field) in responses and (
|
|
262
251
|
self.cleaned_data.get(field_required)
|
|
@@ -304,9 +293,7 @@ class RequiredFieldValidator(BaseFormValidator):
|
|
|
304
293
|
errmsg = _("`field` cannot be `None`")
|
|
305
294
|
raise InvalidModelFormFieldValidator(f"{errmsg}.")
|
|
306
295
|
elif not responses:
|
|
307
|
-
errmsg = _(
|
|
308
|
-
f"At least one valid response for field '{field}' must be provided."
|
|
309
|
-
)
|
|
296
|
+
errmsg = _(f"At least one valid response for field '{field}' must be provided.")
|
|
310
297
|
raise InvalidModelFormFieldValidator(errmsg)
|
|
311
298
|
elif not field_required:
|
|
312
299
|
raise InvalidModelFormFieldValidator('"field_required" cannot be None.')
|
edc_glucose/__init__.py
ADDED
|
File without changes
|
edc_glucose/apps.py
ADDED
edc_glucose/constants.py
ADDED
edc_glucose/fieldsets.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
glucose_fieldset_tuple: tuple[str, dict[str, tuple]] = (
|
|
2
|
+
"Blood Glucose Measurement",
|
|
3
|
+
{
|
|
4
|
+
"fields": (
|
|
5
|
+
"glucose_performed",
|
|
6
|
+
"glucose_fasting",
|
|
7
|
+
"glucose_fasting_duration_str",
|
|
8
|
+
"glucose_date",
|
|
9
|
+
"glucose_value",
|
|
10
|
+
"glucose_quantifier",
|
|
11
|
+
"glucose_units",
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
from .fasting_form_validator import FastingFormValidatorMixin
|
|
2
|
+
from .fbg_form_validator_mixin import FbgFormValidatorMixin
|
|
3
|
+
from .fbg_ogtt_form_validator_mixin import FbgOgttFormValidatorMixin
|
|
4
|
+
from .glucose_form_validator import GlucoseFormValidator
|
|
5
|
+
from .glucose_form_validator_mixin import GlucoseFormValidatorMixin
|
|
6
|
+
from .ogtt_form_validator_mixin import OgttFormValidatorMixin
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from edc_constants.constants import YES
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class FastingFormValidatorMixin:
|
|
7
|
+
def validate_fasting_required_fields(self, fasting_prefix: str | None = None):
|
|
8
|
+
"""Uses fields `fasting`,`fasting_duration_str`"""
|
|
9
|
+
fasting_prefix = fasting_prefix or "fasting"
|
|
10
|
+
self.required_if(
|
|
11
|
+
YES, field=fasting_prefix, field_required=f"{fasting_prefix}_duration_str"
|
|
12
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from edc_form_validators import FormValidator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class FbgFormValidatorMixin:
|
|
5
|
+
"""Declare with FormValidatorMixin, modelform"""
|
|
6
|
+
|
|
7
|
+
def validate_fbg_required_fields(self: FormValidator, fbg_prefix: str):
|
|
8
|
+
"""Uses fields `fbg_value`, `fbg_datetime`, `fbg_units`.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
:param fbg_prefix: e.g. fbg, fbg2, etc
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
self.date_is_after_or_raise(
|
|
15
|
+
field=f"{fbg_prefix}_datetime",
|
|
16
|
+
reference_field=self.report_datetime_field_attr,
|
|
17
|
+
inclusive=True,
|
|
18
|
+
)
|
|
19
|
+
self.required_if_true(
|
|
20
|
+
self.cleaned_data.get(f"{fbg_prefix}_datetime"),
|
|
21
|
+
field_required=f"{fbg_prefix}_value",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
self.required_if_true(
|
|
25
|
+
self.cleaned_data.get(f"{fbg_prefix}_value"),
|
|
26
|
+
field_required=f"{fbg_prefix}_units",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
self.required_if_true(
|
|
30
|
+
self.cleaned_data.get(f"{fbg_prefix}_value"),
|
|
31
|
+
field_required=f"{fbg_prefix}_datetime",
|
|
32
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from django import forms
|
|
4
|
+
|
|
5
|
+
from ..utils import validate_glucose_as_millimoles_per_liter
|
|
6
|
+
from .fbg_form_validator_mixin import FbgFormValidatorMixin
|
|
7
|
+
from .ogtt_form_validator_mixin import OgttFormValidatorMixin
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FbgOgttFormValidatorMixin(FbgFormValidatorMixin, OgttFormValidatorMixin):
|
|
11
|
+
def validate_glucose_testing_matrix(
|
|
12
|
+
self,
|
|
13
|
+
ogtt_prefix: str | None = None,
|
|
14
|
+
fbg_prefix: str | None = None,
|
|
15
|
+
include_fbg: bool | None = None,
|
|
16
|
+
) -> None:
|
|
17
|
+
ogtt_prefix = ogtt_prefix or "ogtt"
|
|
18
|
+
fbg_prefix = fbg_prefix or "fbg"
|
|
19
|
+
|
|
20
|
+
include_fbg = True if include_fbg is None else include_fbg
|
|
21
|
+
if include_fbg:
|
|
22
|
+
self.validate_fbg_required_fields(fbg_prefix)
|
|
23
|
+
validate_glucose_as_millimoles_per_liter(fbg_prefix, self.cleaned_data)
|
|
24
|
+
self.validate_ogtt_required_fields(ogtt_prefix=ogtt_prefix)
|
|
25
|
+
validate_glucose_as_millimoles_per_liter(ogtt_prefix, self.cleaned_data)
|
|
26
|
+
self.validate_ogtt_dates(ogtt_prefix=ogtt_prefix)
|
|
27
|
+
self.validate_fbg_before_ogtt(ogtt_prefix=ogtt_prefix, fbg_prefix=fbg_prefix)
|
|
28
|
+
self.validate_ogtt_time_interval()
|
|
29
|
+
|
|
30
|
+
def validate_fbg_before_ogtt(
|
|
31
|
+
self, ogtt_prefix: str | None = None, fbg_prefix: str | None = None
|
|
32
|
+
):
|
|
33
|
+
"""Validate the FBG is performed before the OGTT"""
|
|
34
|
+
ogtt_prefix = ogtt_prefix or "ogtt"
|
|
35
|
+
fbg_prefix = fbg_prefix or "fbg"
|
|
36
|
+
fbg_dte = self.cleaned_data.get(f"{fbg_prefix}_datetime")
|
|
37
|
+
ogtt_base_dte = self.cleaned_data.get(f"{ogtt_prefix}_base_datetime")
|
|
38
|
+
if fbg_dte and ogtt_base_dte:
|
|
39
|
+
total_seconds = (ogtt_base_dte - fbg_dte).total_seconds()
|
|
40
|
+
if total_seconds <= 1:
|
|
41
|
+
raise forms.ValidationError(
|
|
42
|
+
{
|
|
43
|
+
f"{ogtt_prefix}_base_datetime": (
|
|
44
|
+
"Invalid date. Expected to be after time FBG level was measured"
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from edc_dx_review.utils import (
|
|
2
|
+
raise_if_clinical_review_does_not_exist,
|
|
3
|
+
raise_if_initial_review_does_not_exist,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
from edc_constants.constants import DM
|
|
7
|
+
from edc_crf.crf_form_validator_mixins import CrfFormValidatorMixin
|
|
8
|
+
from edc_form_validators import FormValidator
|
|
9
|
+
from edc_visit_schedule.utils import raise_if_baseline
|
|
10
|
+
|
|
11
|
+
from .glucose_form_validator_mixin import GlucoseFormValidatorMixin
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GlucoseFormValidator(
|
|
15
|
+
GlucoseFormValidatorMixin,
|
|
16
|
+
CrfFormValidatorMixin,
|
|
17
|
+
FormValidator,
|
|
18
|
+
):
|
|
19
|
+
"""Declared as an example of the clean method to use with
|
|
20
|
+
the mixin.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
required_at_baseline = True
|
|
24
|
+
require_diagnosis = False
|
|
25
|
+
require_clinical_review_crf = True
|
|
26
|
+
prefix = "glucose"
|
|
27
|
+
|
|
28
|
+
def clean(self):
|
|
29
|
+
if self.cleaned_data.get("subject_visit"):
|
|
30
|
+
if not self.required_at_baseline:
|
|
31
|
+
raise_if_baseline(self.cleaned_data.get("subject_visit"))
|
|
32
|
+
self.raise_if_clinical_review_does_not_exist()
|
|
33
|
+
if self.require_diagnosis:
|
|
34
|
+
raise_if_initial_review_does_not_exist(
|
|
35
|
+
self.cleaned_data.get("subject_visit"), DM
|
|
36
|
+
)
|
|
37
|
+
self.validate_glucose_test()
|
|
38
|
+
|
|
39
|
+
def raise_if_clinical_review_does_not_exist(self) -> None:
|
|
40
|
+
if self.require_clinical_review_crf:
|
|
41
|
+
return raise_if_clinical_review_does_not_exist(
|
|
42
|
+
self.cleaned_data.get("subject_visit")
|
|
43
|
+
)
|
|
44
|
+
return None
|