clinicedc 2.0.1__py3-none-any.whl → 2.0.3__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.1.dist-info → clinicedc-2.0.3.dist-info}/METADATA +15 -22
- {clinicedc-2.0.1.dist-info → clinicedc-2.0.3.dist-info}/RECORD +854 -787
- {clinicedc-2.0.1.dist-info → clinicedc-2.0.3.dist-info}/WHEEL +1 -1
- edc_action_item/action.py +10 -30
- 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 +6 -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/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 +5 -15
- 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/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_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/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/model_mixins/appointment_methods_model_mixin.py +1 -5
- edc_appointment/model_mixins/appointment_model_mixin.py +2 -8
- 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/auth_updater/group_updater.py +3 -9
- 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/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 +2 -6
- 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 +2 -7
- edc_consent/migrations/0001_initial.py +1 -1
- edc_consent/migrations/0002_alter_edcpermissions_device_created_and_more.py +3 -7
- edc_consent/model_mixins/consent_extension_model_mixin.py +1 -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 +3 -8
- edc_consent/modelform_mixins/requires_consent_modelform_mixin.py +1 -3
- edc_consent/models/signals.py +2 -6
- edc_consent/site_consents.py +5 -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 +2 -6
- edc_crf/crf_form_validator_mixins.py +2 -6
- edc_crf/migrations/0004_alter_crfstatus_device_created_and_more.py +3 -7
- 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/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/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/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/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/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_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/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/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 +4 -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/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/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/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/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/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/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/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_item_admin.py +5 -15
- 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 +3 -9
- 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 +5 -14
- 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/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 +3 -9
- 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/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/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/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 +2 -6
- 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/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 +2 -6
- 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_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/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/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 +8 -19
- 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 +1 -3
- 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/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/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/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_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/single_site/get_languages.py +1 -3
- edc_sites/site.py +4 -11
- edc_sites/system_checks.py +1 -4
- edc_sites/utils/add_or_update_django_sites.py +1 -3
- 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/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/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/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 +6 -17
- edc_visit_schedule/simple_model_validator.py +3 -8
- edc_visit_schedule/site_visit_schedules.py +5 -15
- edc_visit_schedule/subject_schedule.py +4 -16
- 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/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.1.dist-info → clinicedc-2.0.3.dist-info}/licenses/LICENSE +0 -0
edc_pdf_reports/utils.py
CHANGED
|
@@ -33,9 +33,7 @@ def write_queryset_to_secure_pdf(
|
|
|
33
33
|
"""
|
|
34
34
|
merger = PdfWriter()
|
|
35
35
|
for model_obj in queryset:
|
|
36
|
-
buffer = write_model_to_insecure_pdf(
|
|
37
|
-
model_obj, request=request, **extra_context
|
|
38
|
-
)
|
|
36
|
+
buffer = write_model_to_insecure_pdf(model_obj, request=request, **extra_context)
|
|
39
37
|
merger.append(fileobj=buffer)
|
|
40
38
|
buffer.close()
|
|
41
39
|
merged_buffer = BytesIO()
|
|
@@ -42,9 +42,7 @@ class PdfIntermediateView(EdcViewMixin, EdcProtocolViewMixin, TemplateView):
|
|
|
42
42
|
def get(self, request: WSGIRequest, *args, **kwargs):
|
|
43
43
|
if not self.model_pks:
|
|
44
44
|
self.model_pks = [kwargs.get("pk")]
|
|
45
|
-
request.session[self.session_key] = json.dumps(
|
|
46
|
-
[str(pk) for pk in self.model_pks]
|
|
47
|
-
)
|
|
45
|
+
request.session[self.session_key] = json.dumps([str(pk) for pk in self.model_pks])
|
|
48
46
|
return super().get(request, *args, **kwargs)
|
|
49
47
|
|
|
50
48
|
def get_context_data(self, app_label: str = None, model_name: str = None, **kwargs):
|
|
@@ -51,9 +51,7 @@ class PrintPdfReportView(ContextMixin, View):
|
|
|
51
51
|
else:
|
|
52
52
|
password = kwargs.get("phrase") or slugify(mempass.mkpassword(2))
|
|
53
53
|
app_label, model_name = kwargs.get("app_label"), kwargs.get("model_name")
|
|
54
|
-
qs = django_apps.get_model(app_label, model_name).objects.filter(
|
|
55
|
-
pk__in=model_pks
|
|
56
|
-
)
|
|
54
|
+
qs = django_apps.get_model(app_label, model_name).objects.filter(pk__in=model_pks)
|
|
57
55
|
buffer = write_queryset_to_secure_pdf(
|
|
58
56
|
queryset=qs, password=password, request=self.request
|
|
59
57
|
)
|
|
@@ -74,9 +72,7 @@ class PrintPdfReportView(ContextMixin, View):
|
|
|
74
72
|
else:
|
|
75
73
|
report_filename = pdf_report_cls.get_generic_report_filename()
|
|
76
74
|
if not report_filename:
|
|
77
|
-
raise ValueError(
|
|
78
|
-
"Cannot create file without a filename. Got report_filename=None"
|
|
79
|
-
)
|
|
75
|
+
raise ValueError("Cannot create file without a filename. Got report_filename=None")
|
|
80
76
|
return report_filename
|
|
81
77
|
|
|
82
78
|
def message_user(self, report_filename=None, password=None) -> None:
|
edc_pdutils/actions.py
CHANGED
|
@@ -12,23 +12,15 @@ def export_to_csv(modeladmin, request, queryset):
|
|
|
12
12
|
if queryset.count() == 0:
|
|
13
13
|
messages.info(request, "Nothing to do.")
|
|
14
14
|
elif has_encrypted_fields(queryset.model):
|
|
15
|
-
messages.warning(
|
|
16
|
-
request, "Unable to export. Report may contain confidential data"
|
|
17
|
-
)
|
|
15
|
+
messages.warning(request, "Unable to export. Report may contain confidential data")
|
|
18
16
|
else:
|
|
19
17
|
filename = f"{modeladmin.model._meta.label_lower.replace('.', '_')}.csv"
|
|
20
18
|
buffer = StringIO()
|
|
21
19
|
queryset.to_dataframe().to_csv(buffer, index=False)
|
|
22
20
|
buffer.seek(0)
|
|
23
|
-
response = FileResponse(
|
|
24
|
-
buffer.read(), as_attachment=True, content_type="text/csv"
|
|
25
|
-
)
|
|
21
|
+
response = FileResponse(buffer.read(), as_attachment=True, content_type="text/csv")
|
|
26
22
|
response["Content-Disposition"] = f'filename="{filename}"'
|
|
27
|
-
title = getattr(
|
|
28
|
-
|
|
29
|
-
)
|
|
30
|
-
messages.success(
|
|
31
|
-
request, f"Exported {title} to CSV. Check your browser's downloads"
|
|
32
|
-
)
|
|
23
|
+
title = getattr(modeladmin, "change_list_title", modeladmin.model._meta.verbose_name)
|
|
24
|
+
messages.success(request, f"Exported {title} to CSV. Check your browser's downloads")
|
|
33
25
|
return response
|
|
34
26
|
return None
|
edc_pdutils/choices.py
CHANGED
edc_pdutils/database.py
CHANGED
|
@@ -87,9 +87,7 @@ class Database:
|
|
|
87
87
|
columns = {col: col.lower() for col in list(df.columns)}
|
|
88
88
|
df.rename(columns=columns, inplace=True)
|
|
89
89
|
for col in uuid_columns:
|
|
90
|
-
df[col] = df.apply(
|
|
91
|
-
lambda row: str(UUID(row[col])) if row[col] else np.nan, axis=1
|
|
92
|
-
)
|
|
90
|
+
df[col] = df.apply(lambda row: str(UUID(row[col])) if row[col] else np.nan, axis=1)
|
|
93
91
|
return df
|
|
94
92
|
|
|
95
93
|
def show_tables(self, app_label: str = None) -> pd.DataFrame:
|
|
@@ -13,9 +13,7 @@ class CsvCrfInlineTablesExporter(CsvCrfTablesExporter):
|
|
|
13
13
|
exclude_inline_tables = None
|
|
14
14
|
|
|
15
15
|
def __init__(self, exclude_inline_tables=None, **kwargs):
|
|
16
|
-
self.exclude_inline_tables =
|
|
17
|
-
exclude_inline_tables or self.exclude_inline_tables or []
|
|
18
|
-
)
|
|
16
|
+
self.exclude_inline_tables = exclude_inline_tables or self.exclude_inline_tables or []
|
|
19
17
|
super().__init__(**kwargs)
|
|
20
18
|
|
|
21
19
|
def to_csv(self, export_folder=None, **kwargs):
|
|
@@ -23,9 +21,7 @@ class CsvCrfInlineTablesExporter(CsvCrfTablesExporter):
|
|
|
23
21
|
self.exported_paths = {}
|
|
24
22
|
export_folder = export_folder or self.export_folder
|
|
25
23
|
for table_name in self.table_names:
|
|
26
|
-
df_table = self.to_df(
|
|
27
|
-
table_name=table_name, exclude_system_columns=True, **kwargs
|
|
28
|
-
)
|
|
24
|
+
df_table = self.to_df(table_name=table_name, exclude_system_columns=True, **kwargs)
|
|
29
25
|
for row in self.get_inline_table_names(table_name).itertuples():
|
|
30
26
|
if row.table_name not in self.exclude_inline_tables:
|
|
31
27
|
df_inline = self.to_inline_df(table_name=row.table_name, **kwargs)
|
|
@@ -49,13 +45,9 @@ class CsvCrfInlineTablesExporter(CsvCrfTablesExporter):
|
|
|
49
45
|
def get_inline_table_names(self, table_name=None):
|
|
50
46
|
return self.db.show_inline_tables(referenced_table_name=table_name)
|
|
51
47
|
|
|
52
|
-
def merge_with_inline(
|
|
53
|
-
self, df_table=None, df_inline=None, left_on=None, right_on=None
|
|
54
|
-
):
|
|
48
|
+
def merge_with_inline(self, df_table=None, df_inline=None, left_on=None, right_on=None):
|
|
55
49
|
"""Merge main table and its inline."""
|
|
56
|
-
df_table = df_table[
|
|
57
|
-
[col for col in df_table.columns if col not in SYSTEM_COLUMNS]
|
|
58
|
-
]
|
|
50
|
+
df_table = df_table[[col for col in df_table.columns if col not in SYSTEM_COLUMNS]]
|
|
59
51
|
df = pd.merge(
|
|
60
52
|
df_table,
|
|
61
53
|
df_inline,
|
|
@@ -76,9 +76,7 @@ class CsvExporter:
|
|
|
76
76
|
if not self.export_folder:
|
|
77
77
|
raise ExporterExportFolder("Invalid export folder. Got None")
|
|
78
78
|
if not os.path.exists(self.export_folder):
|
|
79
|
-
raise ExporterExportFolder(
|
|
80
|
-
f"Invalid export folder. Got {self.export_folder}"
|
|
81
|
-
)
|
|
79
|
+
raise ExporterExportFolder(f"Invalid export folder. Got {self.export_folder}")
|
|
82
80
|
if self.model_name:
|
|
83
81
|
try:
|
|
84
82
|
self.model_cls = django_apps.get_model(self.model_name)
|
|
@@ -138,9 +136,7 @@ class CsvExporter:
|
|
|
138
136
|
sys.stdout.write(f"(?) {self.model_name} empty \n")
|
|
139
137
|
return Exported(path, self.model_name, record_count)
|
|
140
138
|
|
|
141
|
-
def to_csv(
|
|
142
|
-
self, dataframe: pd.DataFrame = None, export_folder: str = None
|
|
143
|
-
) -> Exported:
|
|
139
|
+
def to_csv(self, dataframe: pd.DataFrame = None, export_folder: str = None) -> Exported:
|
|
144
140
|
"""Returns the full path of the written CSV file if the
|
|
145
141
|
dataframe is exported otherwise None.
|
|
146
142
|
|
|
@@ -218,19 +214,14 @@ class CsvExporter:
|
|
|
218
214
|
suffix = ""
|
|
219
215
|
else:
|
|
220
216
|
suffix = f"_{get_utcnow().strftime(timestamp_format)}"
|
|
221
|
-
prefix = (
|
|
222
|
-
(self.model_name or self.data_label).replace("-", "_").replace(".", "_")
|
|
223
|
-
)
|
|
217
|
+
prefix = (self.model_name or self.data_label).replace("-", "_").replace(".", "_")
|
|
224
218
|
filename = f"{prefix}{suffix}"
|
|
225
219
|
return filename
|
|
226
220
|
|
|
227
221
|
def stata_variable_labels(self, dataframe: pd.DataFrame) -> dict[str, str]:
|
|
228
222
|
variable_labels = dict(id="primary key")
|
|
229
223
|
variable_labels.update(
|
|
230
|
-
{
|
|
231
|
-
obj.field_name: obj.prompt[:79]
|
|
232
|
-
for obj in self.data_dictionary_qs(dataframe)
|
|
233
|
-
}
|
|
224
|
+
{obj.field_name: obj.prompt[:79] for obj in self.data_dictionary_qs(dataframe)}
|
|
234
225
|
)
|
|
235
226
|
return variable_labels
|
|
236
227
|
|
|
@@ -243,9 +234,7 @@ class CsvExporter:
|
|
|
243
234
|
if field_cls.choices:
|
|
244
235
|
responses = []
|
|
245
236
|
for tpl in field_cls.choices:
|
|
246
|
-
if mapped_choice := site_values_mappings.get_by_choices(
|
|
247
|
-
tpl
|
|
248
|
-
):
|
|
237
|
+
if mapped_choice := site_values_mappings.get_by_choices(tpl):
|
|
249
238
|
responses.append([mapped_choice[0], mapped_choice[1]])
|
|
250
239
|
else:
|
|
251
240
|
responses.append([tpl[0], tpl[1]])
|
|
@@ -256,9 +245,7 @@ class CsvExporter:
|
|
|
256
245
|
for stored, displayed in responses:
|
|
257
246
|
labels.append(f'"{stored}" "{displayed}"')
|
|
258
247
|
commands.append(f'label define {fname}l {" ".join(labels)}')
|
|
259
|
-
commands.append(
|
|
260
|
-
f"encode {fname}, generate({fname}_encoded) {fname}l"
|
|
261
|
-
)
|
|
248
|
+
commands.append(f"encode {fname}, generate({fname}_encoded) {fname}l")
|
|
262
249
|
commands.append(f"ren {fname} {fname}_edc")
|
|
263
250
|
commands.append(f"ren {fname}_encoded {fname}")
|
|
264
251
|
commands.append("")
|
|
@@ -268,9 +255,7 @@ class CsvExporter:
|
|
|
268
255
|
return commands
|
|
269
256
|
|
|
270
257
|
def data_dictionary_qs(self, dataframe: pd.DataFrame) -> QuerySet:
|
|
271
|
-
data_dictionary_model_cls = django_apps.get_model(
|
|
272
|
-
"edc_data_manager.DataDictionary"
|
|
273
|
-
)
|
|
258
|
+
data_dictionary_model_cls = django_apps.get_model("edc_data_manager.DataDictionary")
|
|
274
259
|
return data_dictionary_model_cls.objects.filter(
|
|
275
260
|
model=self.model_name, field_name__in=list(dataframe.columns)
|
|
276
261
|
)
|
|
@@ -27,9 +27,7 @@ class CrfDfHandler(DfHandler):
|
|
|
27
27
|
def __init__(self, exclude_system_columns=None, **kwargs):
|
|
28
28
|
self._df_visit_and_related = pd.DataFrame()
|
|
29
29
|
self.crf_dialect = self.crf_dialect_cls(self)
|
|
30
|
-
self.exclude_system_columns =
|
|
31
|
-
exclude_system_columns or self.exclude_system_columns
|
|
32
|
-
)
|
|
30
|
+
self.exclude_system_columns = exclude_system_columns or self.exclude_system_columns
|
|
33
31
|
super().__init__(**kwargs)
|
|
34
32
|
|
|
35
33
|
def prepare_dataframe(self, **kwargs):
|
|
@@ -66,9 +64,7 @@ class CrfDfHandler(DfHandler):
|
|
|
66
64
|
else:
|
|
67
65
|
if [col for col in columns if col in self.action_item_columns]:
|
|
68
66
|
# "action_item" columns, move to the end
|
|
69
|
-
columns = [
|
|
70
|
-
col for col in columns if col not in self.action_item_columns
|
|
71
|
-
]
|
|
67
|
+
columns = [col for col in columns if col not in self.action_item_columns]
|
|
72
68
|
columns.extend(self.action_item_columns)
|
|
73
69
|
# "system" columns, move to the end
|
|
74
70
|
columns = [col for col in columns if col not in self.system_columns]
|
|
@@ -81,8 +77,6 @@ class CrfDfHandler(DfHandler):
|
|
|
81
77
|
SQL statement.
|
|
82
78
|
"""
|
|
83
79
|
if self._df_visit_and_related.empty:
|
|
84
|
-
sql, params = getattr(
|
|
85
|
-
self.crf_dialect, self.dialect_select_visit_and_related
|
|
86
|
-
)
|
|
80
|
+
sql, params = getattr(self.crf_dialect, self.dialect_select_visit_and_related)
|
|
87
81
|
self._df_visit_and_related = self.db.read_sql(sql, params=params)
|
|
88
82
|
return self._df_visit_and_related
|
|
@@ -35,9 +35,7 @@ class DfHandler:
|
|
|
35
35
|
cols = list(self.dataframe.columns)
|
|
36
36
|
diff = set([x for x in cols if cols.count(x) > 1])
|
|
37
37
|
if len(diff) > 0:
|
|
38
|
-
raise DfHandlerDuplicateColumn(
|
|
39
|
-
f"Duplicate column detected. Got {list(diff)}"
|
|
40
|
-
)
|
|
38
|
+
raise DfHandlerDuplicateColumn(f"Duplicate column detected. Got {list(diff)}")
|
|
41
39
|
|
|
42
40
|
self.prepare_dataframe()
|
|
43
41
|
self.finish_dataframe()
|
|
@@ -18,9 +18,7 @@ class RegisteredSubjectDfHandler(DfHandler):
|
|
|
18
18
|
def __init__(self, exclude_system_columns=None, **kwargs):
|
|
19
19
|
self._df_registered_subject = pd.DataFrame()
|
|
20
20
|
self.rs_dialect = self.rs_dialect_cls(self)
|
|
21
|
-
self.exclude_system_columns =
|
|
22
|
-
exclude_system_columns or self.exclude_system_columns
|
|
23
|
-
)
|
|
21
|
+
self.exclude_system_columns = exclude_system_columns or self.exclude_system_columns
|
|
24
22
|
super().__init__(**kwargs)
|
|
25
23
|
|
|
26
24
|
def prepare_dataframe(self, **kwargs):
|
|
@@ -201,18 +201,14 @@ class Command(BaseCommand):
|
|
|
201
201
|
if not export_format or export_format == "csv":
|
|
202
202
|
exporter.to_csv(dataframe=m.dataframe)
|
|
203
203
|
elif export_format == "stata":
|
|
204
|
-
exporter.to_stata(
|
|
205
|
-
dataframe=m.dataframe, dta_version=stata_dta_version
|
|
206
|
-
)
|
|
204
|
+
exporter.to_stata(dataframe=m.dataframe, dta_version=stata_dta_version)
|
|
207
205
|
print(f" * {model_name}")
|
|
208
206
|
|
|
209
207
|
def validate_user_perms_or_raise(self) -> None:
|
|
210
208
|
username = input("Username:")
|
|
211
209
|
passwd = getpass.getpass("Password for " + username + ":")
|
|
212
210
|
try:
|
|
213
|
-
user = User.objects.get(
|
|
214
|
-
username=username, is_superuser=False, is_active=True
|
|
215
|
-
)
|
|
211
|
+
user = User.objects.get(username=username, is_superuser=False, is_active=True)
|
|
216
212
|
except ObjectDoesNotExist:
|
|
217
213
|
raise CommandError("Invalid username or password.")
|
|
218
214
|
if not user.check_password(passwd):
|
|
@@ -4,13 +4,14 @@ import _socket
|
|
|
4
4
|
import django.db.models.deletion
|
|
5
5
|
import django_audit_fields.fields.uuid_auto_field
|
|
6
6
|
import django_revision.revision_field
|
|
7
|
-
import edc_model_fields.fields.hostname_modification_field
|
|
8
|
-
import edc_model_fields.fields.userfield
|
|
9
|
-
import edc_utils
|
|
10
7
|
import simple_history.models
|
|
11
8
|
from django.conf import settings
|
|
12
9
|
from django.db import migrations, models
|
|
13
10
|
|
|
11
|
+
import edc_model_fields.fields.hostname_modification_field
|
|
12
|
+
import edc_model_fields.fields.userfield
|
|
13
|
+
import edc_utils
|
|
14
|
+
|
|
14
15
|
|
|
15
16
|
class Migration(migrations.Migration):
|
|
16
17
|
initial = True
|
|
@@ -92,9 +93,7 @@ class Migration(migrations.Migration):
|
|
|
92
93
|
("decrypt", models.BooleanField(default=False)),
|
|
93
94
|
(
|
|
94
95
|
"export_format",
|
|
95
|
-
models.CharField(
|
|
96
|
-
choices=[("CSV", "CSV")], default="CSV", max_length=25
|
|
97
|
-
),
|
|
96
|
+
models.CharField(choices=[("CSV", "CSV")], default="CSV", max_length=25),
|
|
98
97
|
),
|
|
99
98
|
(
|
|
100
99
|
"models",
|
|
@@ -265,9 +264,7 @@ class Migration(migrations.Migration):
|
|
|
265
264
|
("decrypt", models.BooleanField(default=False)),
|
|
266
265
|
(
|
|
267
266
|
"export_format",
|
|
268
|
-
models.CharField(
|
|
269
|
-
choices=[("CSV", "CSV")], default="CSV", max_length=25
|
|
270
|
-
),
|
|
267
|
+
models.CharField(choices=[("CSV", "CSV")], default="CSV", max_length=25),
|
|
271
268
|
),
|
|
272
269
|
(
|
|
273
270
|
"models",
|
edc_pdutils/site.py
CHANGED
|
@@ -54,15 +54,11 @@ class Site:
|
|
|
54
54
|
except KeyError:
|
|
55
55
|
pass
|
|
56
56
|
try:
|
|
57
|
-
handler_cls = self.registry[
|
|
58
|
-
self.model_reference_registry.get(key.split(".")[0])
|
|
59
|
-
]
|
|
57
|
+
handler_cls = self.registry[self.model_reference_registry.get(key.split(".")[0])]
|
|
60
58
|
except KeyError:
|
|
61
59
|
pass
|
|
62
60
|
if not handler_cls:
|
|
63
|
-
keys = list(self.registry.keys()) + list(
|
|
64
|
-
self.model_reference_registry.keys()
|
|
65
|
-
)
|
|
61
|
+
keys = list(self.registry.keys()) + list(self.model_reference_registry.keys())
|
|
66
62
|
raise SiteDataframeHandlerNotFound(
|
|
67
63
|
f"Cannot find dataframe hander. Got {key}. " f"Expected one of {keys}."
|
|
68
64
|
)
|
|
@@ -62,9 +62,7 @@ class SiteValuesMappings:
|
|
|
62
62
|
raise IndexError(f"{str(e)} Got {choice[1]}")
|
|
63
63
|
return tuple(values_mapping)
|
|
64
64
|
|
|
65
|
-
def get_by_choices(
|
|
66
|
-
self, tpl: tuple[tuple[str, Any]]
|
|
67
|
-
) -> tuple[tuple[int, str]] | None:
|
|
65
|
+
def get_by_choices(self, tpl: tuple[tuple[str, Any]]) -> tuple[tuple[int, str]] | None:
|
|
68
66
|
for data in self.registry.values():
|
|
69
67
|
if data[0] == tpl:
|
|
70
68
|
return data[1]
|
|
@@ -85,15 +83,11 @@ class SiteValuesMappings:
|
|
|
85
83
|
try:
|
|
86
84
|
before_import_registry = deepcopy(site_values_mappings.registry)
|
|
87
85
|
import_module(f"{app}.{module_name}")
|
|
88
|
-
writer(
|
|
89
|
-
f" - registered values mapping '{module_name}' from '{app}'\n"
|
|
90
|
-
)
|
|
86
|
+
writer(f" - registered values mapping '{module_name}' from '{app}'\n")
|
|
91
87
|
except ImportError as e:
|
|
92
88
|
site_values_mappings.registry = before_import_registry
|
|
93
89
|
if module_has_submodule(mod, module_name):
|
|
94
|
-
raise SiteValuesMappingError(
|
|
95
|
-
f"{str(e)}. See {app}.{module_name}"
|
|
96
|
-
)
|
|
90
|
+
raise SiteValuesMappingError(f"{str(e)}. See {app}.{module_name}")
|
|
97
91
|
except ImportError:
|
|
98
92
|
pass
|
|
99
93
|
|
edc_pdutils/tables/aliquot.py
CHANGED
|
@@ -28,9 +28,7 @@ class Aliquot(Table):
|
|
|
28
28
|
self.dataframe["aliquot_datetime"] = self.helper.to_local_datetime(
|
|
29
29
|
self.dataframe["aliquot_datetime"]
|
|
30
30
|
)
|
|
31
|
-
self.dataframe["aliquot_date"] = self.dataframe[
|
|
32
|
-
"aliquot_datetime"
|
|
33
|
-
].dt.normalize()
|
|
31
|
+
self.dataframe["aliquot_date"] = self.dataframe["aliquot_datetime"].dt.normalize()
|
|
34
32
|
|
|
35
33
|
# drop sys and other unwanted columns
|
|
36
34
|
base_cols = copy(SYSTEM_COLUMNS)
|
|
@@ -83,12 +81,7 @@ class Aliquot(Table):
|
|
|
83
81
|
|
|
84
82
|
def fix_parent_identifier(self, value):
|
|
85
83
|
if value:
|
|
86
|
-
value = (
|
|
87
|
-
value.replace("(", "")
|
|
88
|
-
.replace(")", "")
|
|
89
|
-
.replace("'", "")
|
|
90
|
-
.replace(",", "")
|
|
91
|
-
)
|
|
84
|
+
value = value.replace("(", "").replace(")", "").replace("'", "").replace(",", "")
|
|
92
85
|
return value
|
|
93
86
|
|
|
94
87
|
def missing_requisition(self, df_requisition=None):
|
edc_pdutils/tables/consent.py
CHANGED
|
@@ -13,9 +13,7 @@ class Consent(Table):
|
|
|
13
13
|
]
|
|
14
14
|
|
|
15
15
|
def prepare(self, **kwargs):
|
|
16
|
-
self.dataframe["dob"] = self.helper.date_to_local_datetime(
|
|
17
|
-
self.dataframe["dob"]
|
|
18
|
-
)
|
|
16
|
+
self.dataframe["dob"] = self.helper.date_to_local_datetime(self.dataframe["dob"])
|
|
19
17
|
self.dataframe["consent_datetime"] = self.helper.to_local_datetime(
|
|
20
18
|
self.dataframe["consent_datetime"]
|
|
21
19
|
)
|
|
@@ -29,9 +27,7 @@ class Consent(Table):
|
|
|
29
27
|
self.dataframe["duplicate"] = self.dataframe.duplicated(self.dataframe)
|
|
30
28
|
if len(self.dataframe[self.dataframe["duplicate"]]) > 0:
|
|
31
29
|
self.dataframe = self.deduplicate()
|
|
32
|
-
self.dataframe["consent_date"] = self.dataframe[
|
|
33
|
-
"consent_datetime"
|
|
34
|
-
].dt.normalize()
|
|
30
|
+
self.dataframe["consent_date"] = self.dataframe["consent_datetime"].dt.normalize()
|
|
35
31
|
self.columns.append("consent_date")
|
|
36
32
|
|
|
37
33
|
def deduplicate(self):
|
edc_pdutils/tables/crf.py
CHANGED
|
@@ -28,21 +28,13 @@ class Crf(Table):
|
|
|
28
28
|
self.dataframe["received_datetime"] = self.helper.to_local_datetime(
|
|
29
29
|
self.dataframe["received_datetime"]
|
|
30
30
|
)
|
|
31
|
-
self.dataframe["received"] = self.dataframe["received"].map(
|
|
32
|
-
yes_no, na_action="ignore"
|
|
33
|
-
)
|
|
31
|
+
self.dataframe["received"] = self.dataframe["received"].map(yes_no, na_action="ignore")
|
|
34
32
|
self.dataframe["processed"] = self.dataframe["processed"].map(
|
|
35
33
|
yes_no, na_action="ignore"
|
|
36
34
|
)
|
|
37
|
-
self.dataframe["packed"] = self.dataframe["packed"].map(
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
self.dataframe["shipped"] = self.dataframe["shipped"].map(
|
|
41
|
-
yes_no, na_action="ignore"
|
|
42
|
-
)
|
|
43
|
-
self.dataframe = pd.merge(
|
|
44
|
-
self.dataframe, df_visit, on="subject_visit_id", how="left"
|
|
45
|
-
)
|
|
35
|
+
self.dataframe["packed"] = self.dataframe["packed"].map(yes_no, na_action="ignore")
|
|
36
|
+
self.dataframe["shipped"] = self.dataframe["shipped"].map(yes_no, na_action="ignore")
|
|
37
|
+
self.dataframe = pd.merge(self.dataframe, df_visit, on="subject_visit_id", how="left")
|
|
46
38
|
self.dataframe = self.dataframe.drop(["subject_visit_id"], axis=1)
|
|
47
39
|
# fix reason_not_drawn
|
|
48
40
|
is_blank = (self.dataframe.reason_not_drawn.notnull()) & (
|
|
@@ -30,21 +30,13 @@ class Requisition(Table):
|
|
|
30
30
|
self.dataframe["received_datetime"] = self.helper.to_local_datetime(
|
|
31
31
|
self.dataframe["received_datetime"]
|
|
32
32
|
)
|
|
33
|
-
self.dataframe["received"] = self.dataframe["received"].map(
|
|
34
|
-
yes_no, na_action="ignore"
|
|
35
|
-
)
|
|
33
|
+
self.dataframe["received"] = self.dataframe["received"].map(yes_no, na_action="ignore")
|
|
36
34
|
self.dataframe["processed"] = self.dataframe["processed"].map(
|
|
37
35
|
yes_no, na_action="ignore"
|
|
38
36
|
)
|
|
39
|
-
self.dataframe["packed"] = self.dataframe["packed"].map(
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
self.dataframe["shipped"] = self.dataframe["shipped"].map(
|
|
43
|
-
yes_no, na_action="ignore"
|
|
44
|
-
)
|
|
45
|
-
self.dataframe = pd.merge(
|
|
46
|
-
self.dataframe, df_visit, on="subject_visit_id", how="left"
|
|
47
|
-
)
|
|
37
|
+
self.dataframe["packed"] = self.dataframe["packed"].map(yes_no, na_action="ignore")
|
|
38
|
+
self.dataframe["shipped"] = self.dataframe["shipped"].map(yes_no, na_action="ignore")
|
|
39
|
+
self.dataframe = pd.merge(self.dataframe, df_visit, on="subject_visit_id", how="left")
|
|
48
40
|
self.dataframe = self.dataframe.drop(["subject_visit_id"], axis=1)
|
|
49
41
|
# fix reason_not_drawn
|
|
50
42
|
is_blank = (self.dataframe.reason_not_drawn.notnull()) & (
|
edc_pdutils/tables/visit.py
CHANGED
|
@@ -26,9 +26,7 @@ class Visit(Table):
|
|
|
26
26
|
self.dataframe["visit_datetime"] = self.dataframe["visit_datetime"].astype(
|
|
27
27
|
"datetime64[ns]"
|
|
28
28
|
)
|
|
29
|
-
self.dataframe["visit_date"] = self.dataframe["visit_date"].astype(
|
|
30
|
-
"datetime64[ns]"
|
|
31
|
-
)
|
|
29
|
+
self.dataframe["visit_date"] = self.dataframe["visit_date"].astype("datetime64[ns]")
|
|
32
30
|
self.dataframe["consent_datetime"] = self.dataframe["consent_datetime"].astype(
|
|
33
31
|
"datetime64[ns]"
|
|
34
32
|
)
|
|
@@ -20,17 +20,11 @@ def convert_dates_from_model(
|
|
|
20
20
|
if field_cls.name in source_df.columns:
|
|
21
21
|
date_cols.append(field_cls.name)
|
|
22
22
|
if date_cols:
|
|
23
|
-
source_df[date_cols] = source_df[date_cols].apply(
|
|
24
|
-
pd.to_datetime, errors="coerce"
|
|
25
|
-
)
|
|
23
|
+
source_df[date_cols] = source_df[date_cols].apply(pd.to_datetime, errors="coerce")
|
|
26
24
|
if normalize:
|
|
27
|
-
source_df[date_cols] = source_df[date_cols].apply(
|
|
28
|
-
lambda x: x.dt.normalize()
|
|
29
|
-
)
|
|
25
|
+
source_df[date_cols] = source_df[date_cols].apply(lambda x: x.dt.normalize())
|
|
30
26
|
if localize:
|
|
31
27
|
source_df[date_cols] = source_df[date_cols].apply(
|
|
32
|
-
lambda x: (
|
|
33
|
-
x.dt.tz_localize(None) if x.dtype == "datetime64[ns, UTC]" else x
|
|
34
|
-
)
|
|
28
|
+
lambda x: (x.dt.tz_localize(None) if x.dtype == "datetime64[ns, UTC]" else x)
|
|
35
29
|
)
|
|
36
30
|
return source_df
|
|
@@ -9,7 +9,5 @@ def convert_numerics_from_model(source_df: pd.DataFrame, model_cls) -> pd.DataFr
|
|
|
9
9
|
if field_cls.get_internal_type() in numeric_datatypes:
|
|
10
10
|
numeric_cols.append(field_cls.name)
|
|
11
11
|
if numeric_cols:
|
|
12
|
-
source_df[numeric_cols] = source_df[numeric_cols].apply(
|
|
13
|
-
pd.to_numeric, errors="coerce"
|
|
14
|
-
)
|
|
12
|
+
source_df[numeric_cols] = source_df[numeric_cols].apply(pd.to_numeric, errors="coerce")
|
|
15
13
|
return source_df
|
|
@@ -9,7 +9,5 @@ def convert_timedelta_from_model(source_df: pd.DataFrame, model_cls) -> pd.DataF
|
|
|
9
9
|
if field_cls.get_internal_type() in timedelta_datatypes:
|
|
10
10
|
date_cols.append(field_cls.name)
|
|
11
11
|
if date_cols:
|
|
12
|
-
source_df[date_cols] = source_df[date_cols].apply(
|
|
13
|
-
pd.to_timedelta, errors="coerce"
|
|
14
|
-
)
|
|
12
|
+
source_df[date_cols] = source_df[date_cols].apply(pd.to_timedelta, errors="coerce")
|
|
15
13
|
return source_df
|
|
@@ -17,9 +17,7 @@ def missing_subject_identifiers(
|
|
|
17
17
|
subject_identifiers=[a list of subject identifiers])
|
|
18
18
|
"""
|
|
19
19
|
# convert list of subject identifiers to a dataframe
|
|
20
|
-
df_subject_identifiers = pd.DataFrame(
|
|
21
|
-
subject_identifiers, columns=["subject_identifier"]
|
|
22
|
-
)
|
|
20
|
+
df_subject_identifiers = pd.DataFrame(subject_identifiers, columns=["subject_identifier"])
|
|
23
21
|
df_subject_identifiers["identifier"] = df_subject_identifiers["subject_identifier"]
|
|
24
22
|
df_subject_identifiers = df_subject_identifiers.set_index("subject_identifier")
|
|
25
23
|
if verbose:
|
|
@@ -12,9 +12,7 @@ from ...models import Receive, RepackRequest, Stock
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@admin.display(description="Confirm repacked and labeled stock")
|
|
15
|
-
def confirm_repacked_stock_action(
|
|
16
|
-
modeladmin, request, queryset: QuerySet[RepackRequest]
|
|
17
|
-
):
|
|
15
|
+
def confirm_repacked_stock_action(modeladmin, request, queryset: QuerySet[RepackRequest]):
|
|
18
16
|
if queryset.count() > 1 or queryset.count() == 0:
|
|
19
17
|
messages.add_message(
|
|
20
18
|
request,
|
|
@@ -27,9 +25,7 @@ def confirm_repacked_stock_action(
|
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
@admin.display(description="Confirm received and labeled stock")
|
|
30
|
-
def confirm_received_stock_action(
|
|
31
|
-
modeladmin, request, queryset: QuerySet[RepackRequest]
|
|
32
|
-
):
|
|
28
|
+
def confirm_received_stock_action(modeladmin, request, queryset: QuerySet[RepackRequest]):
|
|
33
29
|
if queryset.count() > 1 or queryset.count() == 0:
|
|
34
30
|
messages.add_message(
|
|
35
31
|
request,
|
|
@@ -23,9 +23,7 @@ def delete_order_items_action(modeladmin, request, queryset: QuerySet[OrderItem]
|
|
|
23
23
|
messages.add_message(
|
|
24
24
|
request,
|
|
25
25
|
messages.SUCCESS,
|
|
26
|
-
gettext(
|
|
27
|
-
f"Successfully deleted {success_count} {OrderItem._meta.verbose_name}."
|
|
28
|
-
),
|
|
26
|
+
gettext(f"Successfully deleted {success_count} {OrderItem._meta.verbose_name}."),
|
|
29
27
|
)
|
|
30
28
|
if failed_count > 0:
|
|
31
29
|
messages.add_message(
|
|
@@ -20,9 +20,7 @@ def delete_receive_items_action(modeladmin, request, queryset: QuerySet[ReceiveI
|
|
|
20
20
|
messages.add_message(
|
|
21
21
|
request,
|
|
22
22
|
messages.SUCCESS,
|
|
23
|
-
gettext(
|
|
24
|
-
f"Successfully deleted {success_count} {ReceiveItem._meta.verbose_name}."
|
|
25
|
-
),
|
|
23
|
+
gettext(f"Successfully deleted {success_count} {ReceiveItem._meta.verbose_name}."),
|
|
26
24
|
)
|
|
27
25
|
if failed_count > 0:
|
|
28
26
|
messages.add_message(
|
|
@@ -13,8 +13,6 @@ def print_stock_report_action(modeladmin, request, queryset):
|
|
|
13
13
|
if queryset.count() > 1:
|
|
14
14
|
session_uuid = str(uuid4())
|
|
15
15
|
request.session[session_uuid] = list(queryset.values_list("pk", flat=True))
|
|
16
|
-
url = reverse(
|
|
17
|
-
"edc_pharmacy:stock_report", kwargs={"session_uuid": session_uuid}
|
|
18
|
-
)
|
|
16
|
+
url = reverse("edc_pharmacy:stock_report", kwargs={"session_uuid": session_uuid})
|
|
19
17
|
return HttpResponseRedirect(url)
|
|
20
18
|
return None
|