clinicedc 2.0.5__py3-none-any.whl → 2.0.7__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.5.dist-info → clinicedc-2.0.7.dist-info}/METADATA +2 -2
- {clinicedc-2.0.5.dist-info → clinicedc-2.0.7.dist-info}/RECORD +387 -336
- edc_action_item/action.py +1 -1
- edc_action_item/action_item_notification.py +2 -2
- edc_action_item/create_action_item.py +1 -1
- edc_action_item/decorators.py +1 -1
- edc_action_item/migrations/0001_initial.py +21 -22
- edc_action_item/migrations/0006_auto_20180707_1659.py +4 -4
- edc_action_item/migrations/0008_auto_20180809_0303.py +4 -4
- edc_action_item/migrations/0015_auto_20190114_0250.py +4 -4
- edc_action_item/migrations/0017_auto_20190305_0123.py +11 -30
- edc_action_item/migrations/0030_edcpermissions.py +3 -2
- edc_action_item/migrations/0039_alter_actionitem_auto_created_comment_and_more.py +398 -0
- edc_action_item/migrations/0040_alter_actionitem_report_datetime_and_more.py +34 -0
- edc_action_item/models/action_item.py +9 -4
- edc_action_item/models/action_model_mixin.py +4 -4
- edc_action_item/models/reference.py +2 -2
- edc_action_item/post_migrate_signals.py +1 -1
- edc_action_item/send_email.py +0 -85
- edc_adherence/migrations/0005_alter_nonadherencereasons_extra_value_and_more.py +36 -0
- edc_adherence/model_mixins.py +1 -1
- edc_adverse_event/migrations/0001_initial.py +5 -4
- edc_adverse_event/migrations/0002_auto_20190802_0059.py +3 -2
- edc_adverse_event/migrations/0008_auto_20220825_0451.py +3 -2
- edc_adverse_event/migrations/0009_auto_20220907_0157.py +3 -2
- edc_adverse_event/migrations/0016_alter_aeactionclassification_device_created_and_more.py +285 -0
- edc_adverse_event/model_mixins/ae_followup/ae_followup_fields_model_mixin.py +2 -2
- edc_adverse_event/model_mixins/ae_initial/ae_initial_fields_model_mixin.py +6 -5
- edc_adverse_event/model_mixins/ae_special_interest/aesi_fields_model_mixin.py +2 -2
- edc_adverse_event/model_mixins/ae_susar/ae_susar_fields_model_mixin.py +2 -2
- edc_adverse_event/model_mixins/ae_tmg/ae_tmg_fields_model_mixin.py +15 -11
- edc_adverse_event/model_mixins/death_report/death_report_model_mixin.py +5 -4
- edc_adverse_event/model_mixins/death_report/death_report_tmg_model_mixin.py +6 -3
- edc_adverse_event/model_mixins/death_report/simple_death_report_model_mixin.py +2 -2
- edc_adverse_event/model_mixins/hospitaization/hospitalization_model_mixin.py +4 -3
- edc_adverse_event/modeladmin_mixins/death_report_admin_mixin.py +3 -3
- edc_adverse_event/models/signals.py +7 -7
- edc_adverse_event/templatetags/edc_adverse_event_extras.py +5 -4
- edc_adverse_event/view_mixins/ae/ae_listboard_view_mixin.py +3 -5
- edc_adverse_event/view_mixins/ae/death_report_listboard_view_mixin.py +6 -8
- edc_adverse_event/view_mixins/tmg/tmg_ae_listboard_view_mixin.py +2 -2
- edc_adverse_event/views/tmg/summary_listboard_view.py +3 -2
- edc_appointment/admin/appointment_admin.py +2 -2
- edc_appointment/admin/list_filters.py +2 -2
- edc_appointment/form_validators/appointment_form_validator.py +108 -82
- edc_appointment/migrations/0003_auto_20161127_2226.py +5 -6
- edc_appointment/migrations/0006_auto_20170106_2118.py +5 -5
- edc_appointment/migrations/0018_auto_20190305_0123.py +5 -12
- edc_appointment/migrations/0050_alter_appointment_appt_type_and_more.py +220 -0
- edc_appointment/model_mixins/appointment_fields_model_mixin.py +1 -2
- edc_appointment/model_mixins/window_period_model_mixin.py +6 -7
- edc_appointment/models/signals.py +44 -35
- edc_appointment/view_utils/appointment_button.py +2 -2
- edc_auth/admin/user_admin.py +1 -1
- edc_auth/migrations/0001_squashed_0033_alter_userprofile_is_multisite_viewer.py +5 -5
- edc_auth/migrations/0012_auto_20191026_0034.py +3 -2
- edc_auth/migrations/0013_auto_20191026_0055.py +3 -2
- edc_auth/migrations/0025_permissions.py +3 -2
- edc_auth/migrations/0035_alter_edcpermissions_device_created_and_more.py +85 -0
- edc_auth/post_migrate_signals.py +1 -1
- edc_consent/actions.py +4 -5
- edc_consent/migrations/0001_initial.py +3 -2
- edc_consent/migrations/0006_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_consent/model_mixins/consent_extension_model_mixin.py +4 -5
- edc_consent/model_mixins/requires_consent_fields_model_mixin.py +2 -2
- edc_consent/utils.py +1 -1
- edc_crf/migrations/0001_initial.py +3 -2
- edc_crf/migrations/0009_alter_crfstatus_device_created_and_more.py +54 -0
- edc_dashboard/migrations/0001_initial.py +3 -2
- edc_dashboard/migrations/0006_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_dashboard/templatetags/edc_dashboard_extras.py +3 -2
- edc_data_manager/action_items.py +4 -6
- edc_data_manager/admin/actions.py +5 -5
- edc_data_manager/handlers/handlers.py +6 -7
- edc_data_manager/migrations/0001_initial.py +19 -19
- edc_data_manager/migrations/0025_edcpermissions.py +3 -2
- edc_data_manager/migrations/0040_alter_datadictionary_device_created_and_more.py +327 -0
- edc_data_manager/migrations/0041_alter_dataquery_dm_user_and_more.py +164 -0
- edc_data_manager/models/data_query.py +5 -5
- edc_data_manager/models/model_mixins.py +8 -8
- edc_data_manager/rule/rule_runner.py +4 -3
- edc_document_status/model_mixins.py +1 -1
- edc_egfr/egfr.py +11 -7
- edc_egfr/model_mixins/egfr_model_mixin.py +3 -7
- edc_export/admin/data_request_admin.py +2 -2
- edc_export/archive_exporter.py +4 -3
- edc_export/files_archiver.py +3 -2
- edc_export/migrations/0001_initial.py +26 -26
- edc_export/migrations/0004_auto_20190305_0123.py +25 -72
- edc_export/migrations/0013_edcpermissions.py +3 -2
- edc_export/migrations/0022_alter_datarequest_description_and_more.py +611 -0
- edc_export/migrations/0023_alter_datarequesthistory_archive_filename_and_more.py +29 -0
- edc_export/model_exporter/file_history_updater.py +10 -10
- edc_export/model_exporter/model_exporter.py +13 -14
- edc_export/model_exporter/object_history_helpers.py +2 -2
- edc_export/models/data_request_history.py +4 -4
- edc_export/utils.py +10 -15
- edc_facility/facility.py +10 -15
- edc_facility/import_holidays.py +13 -13
- edc_facility/migrations/0005_healthfacility_healthfacilitytypes_and_more.py +8 -7
- edc_facility/migrations/0016_alter_healthfacility_device_created_and_more.py +139 -0
- edc_facility/migrations/0017_alter_healthfacility_gps_and_more.py +54 -0
- edc_facility/model_mixins.py +5 -5
- edc_form_runners/form_runner.py +3 -5
- edc_form_runners/migrations/0001_initial.py +3 -2
- edc_form_runners/migrations/0005_alter_issue_device_created_and_more.py +49 -0
- edc_identifier/migrations/0001_squashed_0018_auto_20180128_1054.py +3 -3
- edc_identifier/migrations/0002_auto_20190305_0123.py +3 -6
- edc_identifier/migrations/0006_auto_20161127_2226.py +15 -15
- edc_identifier/migrations/0007_auto_20161204_2227.py +3 -3
- edc_identifier/migrations/0009_auto_20161221_2323.py +3 -5
- edc_identifier/migrations/0010_auto_20170112_0602.py +17 -17
- edc_identifier/migrations/0011_alter_identifiermodel_device_created_and_more.py +79 -0
- edc_identifier/model_mixins.py +1 -1
- edc_identifier/models.py +9 -9
- edc_identifier/simple_identifier.py +1 -3
- edc_identifier/subject_identifier.py +3 -2
- edc_lab/migrations/0001_initial.py +29 -29
- edc_lab/migrations/0008_auto_20170921_0719.py +3 -3
- edc_lab/migrations/0010_auto_20171127_1541.py +15 -15
- edc_lab/migrations/0012_auto_20180114_1438.py +3 -3
- edc_lab/migrations/0019_auto_20190305_0123.py +43 -127
- edc_lab/migrations/0036_alter_aliquot_comment_alter_aliquot_device_created_and_more.py +1139 -0
- edc_lab/migrations/0037_alter_historicalorder_order_datetime_and_more.py +31 -0
- edc_lab/model_mixins/aliquot/aliquot_identifier_model_mixin.py +2 -2
- edc_lab/model_mixins/aliquot/aliquot_model_mixin.py +2 -2
- edc_lab/model_mixins/panel_model_mixin.py +18 -7
- edc_lab/model_mixins/requisition/crf_with_requisition_model_mixin.py +2 -4
- edc_lab/model_mixins/requisition/requisition_model_mixin.py +7 -8
- edc_lab/model_mixins/requisition/requisition_verify_model_mixin.py +1 -1
- edc_lab/model_mixins/result/result_item_model_mixin.py +4 -4
- edc_lab/model_mixins/shipping/manifest_model_mixin.py +4 -5
- edc_lab/model_mixins/shipping/verify_model_mixin.py +4 -6
- edc_lab/models/box.py +1 -1
- edc_lab/models/box_item.py +6 -7
- edc_lab/models/manifest/manifest.py +1 -1
- edc_lab/models/manifest/manifest_item.py +6 -6
- edc_lab/models/manifest/shipper.py +3 -4
- edc_lab/models/order.py +6 -4
- edc_lab/models/panel.py +4 -4
- edc_lab/models/result.py +2 -2
- edc_lab/models/result_item.py +2 -2
- edc_lab_dashboard/migrations/0001_initial.py +3 -2
- edc_lab_dashboard/migrations/0005_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_lab_dashboard/views/action_views/receive_view.py +2 -2
- edc_lab_dashboard/views/action_views/verify_box_item_view.py +2 -2
- edc_lab_results/model_mixins/blood_result_model_mixin.py +7 -7
- edc_lab_results/model_mixins/fbg_model_mixin.py +3 -3
- edc_lab_results/model_mixins/glucose_model_mixin.py +3 -3
- edc_lab_results/model_mixins/hba1c_model_mixin.py +3 -3
- edc_label/migrations/0001_initial.py +3 -2
- edc_label/migrations/0007_alter_zpllabeltemplates_device_created_and_more.py +49 -0
- edc_list_data/list_model_maker.py +2 -2
- edc_list_data/load_list_data.py +11 -14
- edc_list_data/model_mixins.py +12 -4
- edc_list_data/preload_data.py +3 -3
- edc_listboard/migrations/0001_initial.py +3 -2
- edc_listboard/migrations/0007_alter_listboard_device_created_and_more.py +49 -0
- edc_locator/migrations/0001_initial.py +7 -7
- edc_locator/migrations/0018_auto_20190305_0123.py +5 -12
- edc_locator/migrations/0040_alter_historicalsubjectlocator_action_identifier_and_more.py +187 -0
- edc_locator/migrations/0041_alter_historicalsubjectlocator_report_datetime_and_more.py +27 -0
- edc_locator/model_mixins/locator_model_mixin.py +2 -2
- edc_locator/model_mixins/subject_contact_fields_mixin.py +1 -1
- edc_locator/modeladmin_mixins.py +5 -4
- edc_ltfu/model_mixins.py +7 -5
- edc_metadata/metadata_rules/decorators.py +1 -1
- edc_metadata/migrations/0002_auto_20161127_2226.py +5 -5
- edc_metadata/migrations/0005_auto_20170112_0602.py +5 -5
- edc_metadata/migrations/0011_auto_20190305_0123.py +5 -12
- edc_metadata/migrations/0031_alter_crfmetadata_device_created_and_more.py +120 -0
- edc_metadata/model_mixins/updates/updates_crf_metadata_model_mixin.py +1 -1
- edc_metadata/model_mixins/updates/updates_requisition_metadata_model_mixin.py +1 -1
- edc_metadata/models/crf_metadata.py +5 -5
- edc_metadata/models/crf_metadata_model_mixin.py +4 -5
- edc_metadata/models/requisition_metadata.py +6 -6
- edc_metadata/views/refresh_metadata_actions_view.py +3 -3
- edc_model/models/address_mixin.py +6 -6
- edc_model/models/fields/initials_field.py +2 -1
- edc_model/models/historical_records.py +2 -9
- edc_model/models/url_model_mixin.py +2 -2
- edc_model/validators/date.py +7 -8
- edc_model_admin/list_filters/future_date_list_filter.py +3 -3
- edc_model_admin/list_filters/past_date_list_filter.py +3 -3
- edc_model_admin/mixins/model_admin_protect_pii_mixin.py +4 -5
- edc_model_fields/fields/other_charfield.py +2 -2
- edc_navbar/migrations/0004_auto_20220825_0451.py +3 -2
- edc_navbar/migrations/0009_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_notification/migrations/0001_initial.py +3 -3
- edc_notification/migrations/0004_auto_20190305_0123.py +3 -6
- edc_notification/migrations/0011_alter_notification_device_created_and_more.py +59 -0
- edc_notification/models/notification.py +1 -1
- edc_notification/notification/notification.py +12 -12
- edc_offstudy/migrations/0001_initial.py +4 -4
- edc_offstudy/migrations/0002_auto_20180921_0434.py +4 -4
- edc_offstudy/migrations/0005_auto_20190305_0123.py +5 -12
- edc_offstudy/migrations/0023_alter_historicalsubjectoffstudy_action_identifier_and_more.py +188 -0
- edc_offstudy/migrations/0024_alter_historicalsubjectoffstudy_offstudy_datetime_and_more.py +43 -0
- edc_offstudy/model_mixins/offstudy_model_mixin.py +3 -2
- edc_pdutils/df_exporters/csv_exporter.py +33 -37
- edc_pdutils/df_exporters/csv_model_exporter.py +2 -1
- edc_pdutils/migrations/0001_initial.py +8 -8
- edc_pharmacy/admin/prescription/rx_refill_admin.py +4 -3
- edc_pharmacy/admin/reports/stock_availability_admin.py +5 -6
- edc_pharmacy/migrations/0001_initial.py +64 -63
- edc_pharmacy/migrations/0015_auto_20220913_2139.py +26 -26
- edc_pharmacy/migrations/0024_allocation_assignment_containerunits_dispense_and_more.py +81 -86
- edc_pharmacy/migrations/0037_remove_historicalstock_confirmed_at_site_by_and_more.py +5 -5
- edc_pharmacy/migrations/0039_remove_dispense_registered_subject_and_more.py +7 -8
- edc_pharmacy/migrations/0049_remove_stocktransferconfirmation_stock_and_more.py +12 -12
- edc_pharmacy/migrations/0050_remove_stocktransferconfirmation2_location_and_more.py +5 -5
- edc_pharmacy/migrations/0051_alter_historicalstocktransferconfirmationitem_options_and_more.py +3 -4
- edc_pharmacy/migrations/0053_alter_location_managers_alter_historicalstock_lot_and_more.py +3 -3
- edc_pharmacy/migrations/0057_scanduplicates.py +3 -3
- edc_pharmacy/migrations/0060_alter_container_max_per_subject_and_more.py +13 -15
- edc_pharmacy/migrations/0068_stockout.py +2 -3
- edc_pharmacy/migrations/0076_historicalstockadjustment_stockadjustment.py +5 -5
- edc_pharmacy/migrations/0077_historicalstockadjustment_adjustment_datetime_and_more.py +3 -4
- edc_pharmacy/migrations/0081_historicalconfirmation_confirmation.py +8 -8
- edc_pharmacy/migrations/0084_confirmationatsiteitem_and_more.py +0 -2
- edc_pharmacy/migrations/0089_alter_allocation_allocated_by_and_more.py +3284 -0
- edc_pharmacy/migrations/0090_alter_allocation_allocation_datetime_and_more.py +227 -0
- edc_pharmacy/model_mixins/study_medication_refill_model_mixin.py +2 -2
- edc_pharmacy/models/medication/medication.py +3 -3
- edc_pharmacy/models/model_mixins.py +10 -11
- edc_pharmacy/models/prescription/rx.py +13 -12
- edc_pharmacy/models/prescription/rx_refill.py +0 -1
- edc_pharmacy/models/stock/allocation.py +3 -3
- edc_pharmacy/models/stock/confirmation.py +3 -3
- edc_pharmacy/models/stock/confirmation_at_site.py +3 -2
- edc_pharmacy/models/stock/confirmation_at_site_item.py +3 -4
- edc_pharmacy/models/stock/dispense.py +5 -6
- edc_pharmacy/models/stock/dispense_item.py +2 -2
- edc_pharmacy/models/stock/location.py +3 -4
- edc_pharmacy/models/stock/lot.py +6 -7
- edc_pharmacy/models/stock/order.py +1 -1
- edc_pharmacy/models/stock/receive.py +3 -3
- edc_pharmacy/models/stock/receive_item.py +4 -4
- edc_pharmacy/models/stock/repack_request.py +2 -2
- edc_pharmacy/models/stock/stock.py +12 -18
- edc_pharmacy/models/stock/stock_adjustment.py +4 -4
- edc_pharmacy/models/stock/stock_request.py +2 -2
- edc_pharmacy/models/stock/stock_request_item.py +2 -2
- edc_pharmacy/models/stock/stock_transfer.py +3 -3
- edc_pharmacy/models/stock/stock_transfer_item.py +2 -2
- edc_pharmacy/models/stock/storage_bin.py +3 -4
- edc_pharmacy/models/stock/storage_bin_item.py +2 -2
- edc_pharmacy/models/stock/supplier.py +3 -4
- edc_pharmacy/models/storage/box.py +2 -2
- edc_pharmacy/models/storage/items/container_model_mixin.py +3 -4
- edc_pharmacy/models/storage/items/pill_bottle_model_mixin.py +2 -2
- edc_pharmacy/models/storage/items/subject_pill_bottle.py +1 -1
- edc_pharmacy/models/storage/room.py +2 -2
- edc_pharmacy/models/storage/shelf.py +2 -2
- edc_pharmacy/models/storage/utils.py +1 -1
- edc_pharmacy/utils/allocate_stock.py +2 -3
- edc_pharmacy/utils/confirm_stock.py +2 -3
- edc_pharmacy/utils/confirm_stock_at_site.py +3 -4
- edc_pharmacy/utils/dispense.py +3 -4
- edc_pharmacy/utils/process_repack_request.py +4 -5
- edc_pharmacy/utils/stock_request/bulk_create_stock_request_items.py +2 -3
- edc_pharmacy/utils/transfer_stock.py +2 -3
- edc_pharmacy/views/add_to_storage_bin_view.py +2 -2
- edc_pharmacy/views/allocate_to_subject_view.py +2 -2
- edc_pharmacy/views/dispense_view.py +2 -2
- edc_pharmacy/views/move_to_storage_bin_view.py +2 -3
- edc_pharmacy/views/print_labels_view.py +2 -2
- edc_protocol/research_protocol_config.py +2 -3
- edc_protocol_incident/migrations/0001_initial.py +7 -7
- edc_protocol_incident/migrations/0001_squashed_0015_auto_20220927_0401.py +13 -13
- edc_protocol_incident/migrations/0005_protocolincident_historicalprotocolincident_and_more.py +7 -7
- edc_protocol_incident/migrations/0024_alter_actionsrequired_extra_value_and_more.py +625 -0
- edc_protocol_incident/migrations/0025_alter_historicalprotocoldeviationviolation_report_datetime_and_more.py +42 -0
- edc_protocol_incident/model_mixins/protocol_deviation_violation_model_mixin.py +18 -11
- edc_protocol_incident/model_mixins/protocol_incident_model_mixin.py +26 -11
- edc_pylabels/actions.py +3 -5
- edc_pylabels/migrations/0002_alter_label_options_label_created_and_more.py +3 -7
- edc_pylabels/migrations/0005_labelconfiguration_delete_label_and_more.py +3 -3
- edc_pylabels/migrations/0013_alter_labelconfiguration_device_created_and_more.py +49 -0
- edc_qareports/migrations/0001_initial.py +4 -5
- edc_qareports/migrations/0005_edcpermissions.py +3 -3
- edc_qareports/migrations/0006_qareportlog.py +2 -3
- edc_qareports/migrations/0019_alter_edcpermissions_device_created_and_more.py +102 -0
- edc_qareports/migrations/0020_alter_note_report_datetime_and_more.py +24 -0
- edc_qareports/model_mixins/note_model_mixin.py +7 -4
- edc_qareports/model_mixins/on_study_missing_values_model_mixin.py +4 -4
- edc_qareports/model_mixins/qa_report_model_mixin.py +2 -3
- edc_qareports/models/note.py +4 -4
- edc_qareports/models/qa_reports_log.py +2 -3
- edc_randomization/decorators.py +1 -1
- edc_randomization/migrations/0001_initial.py +3 -2
- edc_randomization/migrations/0002_historicalrandomizationlist.py +3 -2
- edc_randomization/migrations/0009_edcpermissions.py +3 -2
- edc_randomization/migrations/0014_alter_edcpermissions_device_created_and_more.py +141 -0
- edc_randomization/model_mixins.py +9 -9
- edc_randomization/utils.py +2 -2
- edc_refusal/migrations/0001_initial.py +4 -4
- edc_refusal/migrations/0002_historicalsubjectrefusal.py +4 -4
- edc_refusal/migrations/0012_alter_historicalsubjectrefusal_comment_and_more.py +122 -0
- edc_refusal/migrations/0013_alter_historicalsubjectrefusal_report_datetime_and_more.py +28 -0
- edc_refusal/model_mixins.py +3 -3
- edc_registration/migrations/0002_auto_20161127_2226.py +3 -4
- edc_registration/migrations/0005_auto_20170111_1809.py +4 -2
- edc_registration/migrations/0016_historicalregisteredsubject.py +3 -2
- edc_registration/migrations/0017_auto_20190305_0123.py +5 -12
- edc_registration/migrations/0033_alter_historicalregisteredsubject_additional_key_and_more.py +302 -0
- edc_registration/model_mixins/updates_or_creates_registered_subject_model_mixin.py +2 -3
- edc_registration/models/registered_subject.py +27 -26
- edc_reportable/age_evaluator.py +4 -2
- edc_reportable/formula.py +5 -5
- edc_reportable/migrations/0001_initial.py +7 -7
- edc_reportable/migrations/0003_referencerangecollection_grade1_and_more.py +3 -3
- edc_reportable/migrations/0004_alter_referencerangecollection_grade3_and_more.py +5 -5
- edc_reportable/migrations/0006_alter_gradingdata_revision_and_more.py +5 -6
- edc_reportable/migrations/0007_alter_gradingdata_age_phrase_and_more.py +509 -0
- edc_reportable/models/normal_data.py +4 -5
- edc_reportable/models/reference_model_mixins.py +10 -11
- edc_reportable/models/reference_range_collection.py +12 -13
- edc_reportable/post_migrate_signals.py +1 -1
- edc_reportable/utils/convert_units.py +11 -45
- edc_reportable/utils/get_normal_data_or_raise.py +2 -2
- edc_reportable/utils/load_data.py +4 -4
- edc_reportable/utils/update_grading_data.py +5 -5
- edc_review_dashboard/migrations/0001_initial.py +3 -2
- edc_review_dashboard/migrations/0006_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_screening/age_evaluator.py +3 -3
- edc_screening/migrations/0001_initial.py +3 -2
- edc_screening/migrations/0005_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_screening/model_mixins/eligibility_model_mixin.py +3 -4
- edc_screening/model_mixins/screening_fields_model_mixin.py +6 -8
- edc_search/model_mixins.py +2 -3
- edc_search/search_slug.py +9 -8
- edc_search/updater.py +2 -2
- edc_sites/migrations/0007_edcpermissions.py +3 -2
- edc_sites/migrations/0010_alter_edcpermissions_device_created_and_more.py +69 -0
- edc_sites/model_mixins/site_model_mixin.py +2 -2
- edc_sites/site.py +5 -5
- edc_sites/system_checks.py +1 -1
- edc_subject_dashboard/migrations/0001_initial.py +3 -2
- edc_subject_dashboard/migrations/0005_alter_edcpermissions_device_created_and_more.py +49 -0
- edc_subject_dashboard/requisition_report.py +6 -4
- edc_subject_dashboard/requisition_verifier.py +6 -6
- edc_subject_dashboard/templatetags/edc_subject_dashboard_extras.py +2 -2
- edc_subject_dashboard/view_mixins/subject_visit_view_mixin.py +7 -8
- edc_subject_dashboard/view_utils/subject_consent_listboard_button.py +3 -2
- edc_subject_dashboard/view_utils/timepoint_status_button.py +2 -2
- edc_timepoint/model_mixins.py +22 -20
- edc_transfer/model_mixins.py +4 -4
- edc_transfer/modeladmin_mixins.py +1 -1
- edc_unblinding/migrations/0001_initial.py +13 -13
- edc_unblinding/migrations/0014_alter_historicalunblindingrequest_action_identifier_and_more.py +291 -0
- edc_unblinding/migrations/0015_alter_historicalunblindingrequest_report_datetime_and_more.py +45 -0
- edc_unblinding/models/unblinding_request.py +2 -2
- edc_unblinding/models/unblinding_review.py +3 -3
- edc_utils/age.py +10 -16
- edc_visit_schedule/migrations/0001_initial.py +3 -3
- edc_visit_schedule/migrations/0002_auto_20190305_0123.py +3 -6
- edc_visit_schedule/migrations/0003_historicalvisitschedule_visitschedule.py +5 -4
- edc_visit_schedule/migrations/0015_historicalonschedule_offschedule_onschedule.py +10 -10
- edc_visit_schedule/migrations/0019_alter_historicalonschedule_device_created_and_more.py +229 -0
- edc_visit_schedule/migrations/0020_alter_historicalonschedule_onschedule_datetime_and_more.py +65 -0
- edc_visit_schedule/model_mixins/off_schedule_model_mixin.py +5 -4
- edc_visit_schedule/model_mixins/on_schedule_model_mixin.py +5 -4
- edc_visit_schedule/model_mixins/visit_schedule/visit_code_fields_model_mixin.py +1 -1
- edc_visit_schedule/models/subject_schedule_history.py +6 -6
- edc_visit_schedule/schedule/visit_collection.py +1 -1
- edc_visit_schedule/subject_schedule.py +5 -4
- edc_visit_schedule/view_mixins.py +2 -3
- edc_visit_schedule/visit/visit.py +3 -2
- edc_visit_tracking/migrations/0004_subjectvisit_subjectvisitmissedreasons_extra_value_and_more.py +13 -13
- edc_visit_tracking/migrations/0009_alter_historicalsubjectvisit_comments_and_more.py +450 -0
- edc_visit_tracking/migrations/0010_alter_historicalsubjectvisit_report_datetime_and_more.py +68 -0
- edc_visit_tracking/model_mixins/base/visit_methods_model_mixin.py +3 -3
- edc_visit_tracking/model_mixins/crfs/visit_tracking_crf_model_mixin.py +2 -2
- edc_visit_tracking/model_mixins/requisitions/visit_tracking_requisition_model_mixin.py +2 -2
- edc_visit_tracking/model_mixins/subject_visit_missed_model_mixin.py +2 -2
- edc_visit_tracking/model_mixins/visit_model_mixin/caretaker_fields_mixin.py +2 -3
- edc_visit_tracking/model_mixins/visit_model_mixin/previous_visit_model_mixin.py +1 -1
- edc_visit_tracking/model_mixins/visit_model_mixin/visit_model_fields_mixin.py +8 -11
- edc_visit_tracking/model_mixins/visit_model_mixin/visit_model_mixin.py +1 -1
- edc_visit_tracking/models/signals.py +1 -1
- edc_visit_tracking/models/subject_visit.py +1 -1
- edc_vitals/calculators/bmi.py +7 -5
- edc_vitals/form_validators/blood_pressure_form_validator_mixin.py +3 -1
- edc_vitals/utils.py +1 -1
- {clinicedc-2.0.5.dist-info → clinicedc-2.0.7.dist-info}/WHEEL +0 -0
- {clinicedc-2.0.5.dist-info → clinicedc-2.0.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from decimal import Decimal
|
|
2
2
|
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.utils import timezone
|
|
4
5
|
from sequences import get_next_value
|
|
5
6
|
|
|
6
7
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
7
|
-
from edc_utils import get_utcnow
|
|
8
8
|
|
|
9
9
|
from ...exceptions import InvalidContainer, ReceiveError, ReceiveItemError
|
|
10
10
|
from .container import Container
|
|
@@ -26,7 +26,7 @@ class ReceiveItem(BaseUuidModel):
|
|
|
26
26
|
help_text="A sequential unique identifier set by the EDC",
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
receive_item_datetime = models.DateTimeField(default=
|
|
29
|
+
receive_item_datetime = models.DateTimeField(default=timezone.now)
|
|
30
30
|
|
|
31
31
|
receive = models.ForeignKey(Receive, on_delete=models.PROTECT, null=True, blank=False)
|
|
32
32
|
|
|
@@ -49,7 +49,7 @@ class ReceiveItem(BaseUuidModel):
|
|
|
49
49
|
)
|
|
50
50
|
|
|
51
51
|
name = models.CharField(
|
|
52
|
-
max_length=200,
|
|
52
|
+
max_length=200, default="", blank=True, help_text="Leave blank to use default"
|
|
53
53
|
)
|
|
54
54
|
|
|
55
55
|
qty = models.DecimalField(
|
|
@@ -93,7 +93,7 @@ class ReceiveItem(BaseUuidModel):
|
|
|
93
93
|
raise ReceiveItemError("OrderItem may not be null.")
|
|
94
94
|
if not self.lot:
|
|
95
95
|
raise ReceiveItemError("Lot may not be null.")
|
|
96
|
-
if self.container.qty > Decimal(1.0):
|
|
96
|
+
if self.container.qty > Decimal("1.0"):
|
|
97
97
|
self.unit_qty = self.qty * self.container.qty
|
|
98
98
|
else:
|
|
99
99
|
self.unit_qty = self.qty
|
|
@@ -2,10 +2,10 @@ from decimal import Decimal
|
|
|
2
2
|
|
|
3
3
|
from django.core.validators import MinValueValidator
|
|
4
4
|
from django.db import models
|
|
5
|
+
from django.utils import timezone
|
|
5
6
|
from sequences import get_next_value
|
|
6
7
|
|
|
7
8
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
8
|
-
from edc_utils import get_utcnow
|
|
9
9
|
|
|
10
10
|
from ...exceptions import RepackRequestError
|
|
11
11
|
from ...utils import get_related_or_none
|
|
@@ -34,7 +34,7 @@ class RepackRequest(BaseUuidModel):
|
|
|
34
34
|
help_text="A sequential unique identifier set by the EDC",
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
-
repack_datetime = models.DateTimeField(default=
|
|
37
|
+
repack_datetime = models.DateTimeField(default=timezone.now)
|
|
38
38
|
|
|
39
39
|
from_stock = models.ForeignKey(
|
|
40
40
|
"edc_pharmacy.stock",
|
|
@@ -5,10 +5,10 @@ from decimal import Decimal
|
|
|
5
5
|
from django.core.validators import MaxValueValidator, MinValueValidator
|
|
6
6
|
from django.db import models
|
|
7
7
|
from django.db.models import PROTECT
|
|
8
|
+
from django.utils import timezone
|
|
8
9
|
from sequences import get_next_value
|
|
9
10
|
|
|
10
11
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
11
|
-
from edc_utils import get_utcnow
|
|
12
12
|
|
|
13
13
|
from ...choices import STOCK_STATUS
|
|
14
14
|
from ...constants import ALLOCATED, AVAILABLE, ZERO_ITEM
|
|
@@ -48,7 +48,7 @@ class Stock(BaseUuidModel):
|
|
|
48
48
|
)
|
|
49
49
|
|
|
50
50
|
stock_datetime = models.DateTimeField(
|
|
51
|
-
default=
|
|
51
|
+
default=timezone.now, help_text="date stock record created"
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
receive_item = models.ForeignKey(
|
|
@@ -75,7 +75,7 @@ class Stock(BaseUuidModel):
|
|
|
75
75
|
)
|
|
76
76
|
confirmed_datetime = models.DateTimeField(null=True, blank=True)
|
|
77
77
|
|
|
78
|
-
confirmed_by = models.CharField(max_length=150,
|
|
78
|
+
confirmed_by = models.CharField(max_length=150, default="", blank=True)
|
|
79
79
|
|
|
80
80
|
allocation = models.OneToOneField(
|
|
81
81
|
Allocation,
|
|
@@ -100,7 +100,7 @@ class Stock(BaseUuidModel):
|
|
|
100
100
|
blank=False,
|
|
101
101
|
decimal_places=2,
|
|
102
102
|
max_digits=20,
|
|
103
|
-
default=Decimal(0.0),
|
|
103
|
+
default=Decimal("0.0"),
|
|
104
104
|
help_text="Difference of qty_in and qty_out",
|
|
105
105
|
)
|
|
106
106
|
|
|
@@ -109,7 +109,7 @@ class Stock(BaseUuidModel):
|
|
|
109
109
|
blank=False,
|
|
110
110
|
decimal_places=2,
|
|
111
111
|
max_digits=20,
|
|
112
|
-
default=Decimal(0.0),
|
|
112
|
+
default=Decimal("0.0"),
|
|
113
113
|
validators=[MinValueValidator(0), MaxValueValidator(1)],
|
|
114
114
|
help_text="Container qty, e.g. 1 bucket, 1 bottle, etc",
|
|
115
115
|
)
|
|
@@ -117,7 +117,7 @@ class Stock(BaseUuidModel):
|
|
|
117
117
|
qty_out = models.DecimalField(
|
|
118
118
|
decimal_places=2,
|
|
119
119
|
max_digits=20,
|
|
120
|
-
default=Decimal(0.0),
|
|
120
|
+
default=Decimal("0.0"),
|
|
121
121
|
validators=[MinValueValidator(0), MaxValueValidator(1)],
|
|
122
122
|
help_text="Container qty, e.g. 1 bucket, 1 bottle, etc",
|
|
123
123
|
)
|
|
@@ -125,7 +125,7 @@ class Stock(BaseUuidModel):
|
|
|
125
125
|
unit_qty_in = models.DecimalField(
|
|
126
126
|
decimal_places=2,
|
|
127
127
|
max_digits=20,
|
|
128
|
-
default=Decimal(0.0),
|
|
128
|
+
default=Decimal("0.0"),
|
|
129
129
|
validators=[MinValueValidator(0)],
|
|
130
130
|
help_text="Number of units in this container, e.g. 128 tablets. See post-save signal",
|
|
131
131
|
)
|
|
@@ -133,22 +133,18 @@ class Stock(BaseUuidModel):
|
|
|
133
133
|
unit_qty_out = models.DecimalField(
|
|
134
134
|
decimal_places=2,
|
|
135
135
|
max_digits=20,
|
|
136
|
-
default=Decimal(0.0),
|
|
136
|
+
default=Decimal("0.0"),
|
|
137
137
|
validators=[MinValueValidator(0)],
|
|
138
138
|
help_text="Number of units from this container, e.g. 128 tablets",
|
|
139
139
|
)
|
|
140
140
|
|
|
141
141
|
status = models.CharField(max_length=25, choices=STOCK_STATUS, default=AVAILABLE)
|
|
142
142
|
|
|
143
|
-
description = models.CharField(max_length=100,
|
|
144
|
-
|
|
145
|
-
# transferred = models.BooleanField(default=False)
|
|
146
|
-
|
|
147
|
-
# confirmed_at_site = models.BooleanField(default=False)
|
|
143
|
+
description = models.CharField(max_length=100, default="", blank=True)
|
|
148
144
|
|
|
149
145
|
stored_at_site = models.BooleanField(default=False)
|
|
150
146
|
|
|
151
|
-
subject_identifier = models.CharField(max_length=50,
|
|
147
|
+
subject_identifier = models.CharField(max_length=50, default="", blank=True)
|
|
152
148
|
|
|
153
149
|
objects = StockManager()
|
|
154
150
|
|
|
@@ -173,13 +169,11 @@ class Stock(BaseUuidModel):
|
|
|
173
169
|
super().save(*args, **kwargs)
|
|
174
170
|
|
|
175
171
|
def update_transferred(self) -> bool:
|
|
176
|
-
|
|
172
|
+
return (
|
|
177
173
|
self.allocation
|
|
178
174
|
and self.allocation.stock_request_item.stock_request.location == self.location
|
|
179
175
|
and self.container.may_request_as
|
|
180
|
-
)
|
|
181
|
-
return True
|
|
182
|
-
return False
|
|
176
|
+
)
|
|
183
177
|
|
|
184
178
|
def verify_assignment_or_raise(
|
|
185
179
|
self, stock: models.ForeignKey[Stock] | None = None
|
|
@@ -3,9 +3,9 @@ from decimal import Decimal
|
|
|
3
3
|
from django.core.validators import MinValueValidator
|
|
4
4
|
from django.db import models
|
|
5
5
|
from django.db.models import Sum
|
|
6
|
+
from django.utils import timezone
|
|
6
7
|
|
|
7
8
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
8
|
-
from edc_utils import get_utcnow
|
|
9
9
|
|
|
10
10
|
from .stock import Stock
|
|
11
11
|
|
|
@@ -22,19 +22,19 @@ class StockAdjustment(BaseUuidModel):
|
|
|
22
22
|
null=True,
|
|
23
23
|
)
|
|
24
24
|
|
|
25
|
-
adjustment_datetime = models.DateTimeField(default=
|
|
25
|
+
adjustment_datetime = models.DateTimeField(default=timezone.now)
|
|
26
26
|
|
|
27
27
|
unit_qty_in_old = models.DecimalField(
|
|
28
28
|
decimal_places=2,
|
|
29
29
|
max_digits=20,
|
|
30
|
-
default=Decimal(0.0),
|
|
30
|
+
default=Decimal("0.0"),
|
|
31
31
|
validators=[MinValueValidator(0)],
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
unit_qty_in_new = models.DecimalField(
|
|
35
35
|
decimal_places=2,
|
|
36
36
|
max_digits=20,
|
|
37
|
-
default=Decimal(0.0),
|
|
37
|
+
default=Decimal("0.0"),
|
|
38
38
|
validators=[MinValueValidator(0)],
|
|
39
39
|
)
|
|
40
40
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from django.db import models
|
|
2
|
+
from django.utils import timezone
|
|
2
3
|
from sequences import get_next_value
|
|
3
4
|
|
|
4
5
|
from edc_constants.constants import CANCELLED, CLOSED, OPEN
|
|
5
6
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
6
7
|
from edc_registration.models import RegisteredSubject
|
|
7
|
-
from edc_utils import get_utcnow
|
|
8
8
|
|
|
9
9
|
from ...exceptions import InvalidContainer, StockRequestError
|
|
10
10
|
from ..medication import Formulation
|
|
@@ -31,7 +31,7 @@ class StockRequest(BaseUuidModel):
|
|
|
31
31
|
help_text="A sequential unique identifier set by the EDC",
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
request_datetime = models.DateTimeField(default=
|
|
34
|
+
request_datetime = models.DateTimeField(default=timezone.now)
|
|
35
35
|
|
|
36
36
|
start_datetime = models.DateTimeField(
|
|
37
37
|
default=None,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from django.db import models
|
|
2
|
+
from django.utils import timezone
|
|
2
3
|
from sequences import get_next_value
|
|
3
4
|
|
|
4
5
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
5
6
|
from edc_randomization.site_randomizers import site_randomizers
|
|
6
7
|
from edc_registration.models import RegisteredSubject
|
|
7
|
-
from edc_utils import get_utcnow
|
|
8
8
|
from edc_visit_schedule.model_mixins import VisitCodeFieldsModelMixin
|
|
9
9
|
|
|
10
10
|
from ...exceptions import StockRequestItemError
|
|
@@ -28,7 +28,7 @@ class StockRequestItem(VisitCodeFieldsModelMixin, BaseUuidModel):
|
|
|
28
28
|
help_text="A sequential unique identifier set by the EDC",
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
request_item_datetime = models.DateTimeField(default=
|
|
31
|
+
request_item_datetime = models.DateTimeField(default=timezone.now)
|
|
32
32
|
|
|
33
33
|
stock_request = models.ForeignKey(
|
|
34
34
|
StockRequest,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from django.db import models
|
|
2
|
+
from django.utils import timezone
|
|
2
3
|
from sequences import get_next_value
|
|
3
4
|
|
|
4
5
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
5
|
-
from edc_utils import get_utcnow
|
|
6
6
|
|
|
7
7
|
from ...exceptions import StockTransferError
|
|
8
8
|
from .location import Location
|
|
@@ -25,7 +25,7 @@ class StockTransfer(BaseUuidModel):
|
|
|
25
25
|
help_text="A sequential unique identifier set by the EDC",
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
transfer_datetime = models.DateTimeField(default=
|
|
28
|
+
transfer_datetime = models.DateTimeField(default=timezone.now)
|
|
29
29
|
|
|
30
30
|
from_location = models.ForeignKey(
|
|
31
31
|
Location,
|
|
@@ -82,7 +82,7 @@ class StockTransfer(BaseUuidModel):
|
|
|
82
82
|
|
|
83
83
|
@property
|
|
84
84
|
def export_datetime(self):
|
|
85
|
-
return
|
|
85
|
+
return timezone.now()
|
|
86
86
|
|
|
87
87
|
@property
|
|
88
88
|
def site(self):
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from django.db import models
|
|
2
|
+
from django.utils import timezone
|
|
2
3
|
from sequences import get_next_value
|
|
3
4
|
|
|
4
5
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
5
|
-
from edc_utils import get_utcnow
|
|
6
6
|
|
|
7
7
|
from ...exceptions import StockTransferError
|
|
8
8
|
from .stock import Stock
|
|
@@ -26,7 +26,7 @@ class StockTransferItem(BaseUuidModel):
|
|
|
26
26
|
help_text="A sequential unique identifier set by the EDC",
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
transfer_item_datetime = models.DateTimeField(default=
|
|
29
|
+
transfer_item_datetime = models.DateTimeField(default=timezone.now)
|
|
30
30
|
|
|
31
31
|
stock_transfer = models.ForeignKey(StockTransfer, on_delete=models.PROTECT)
|
|
32
32
|
|
|
@@ -3,17 +3,16 @@ from __future__ import annotations
|
|
|
3
3
|
from django.core.validators import MinValueValidator
|
|
4
4
|
from django.db import models
|
|
5
5
|
from django.db.models import PROTECT
|
|
6
|
+
from django.utils import timezone
|
|
6
7
|
from sequences import get_next_value
|
|
7
8
|
|
|
8
9
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
9
10
|
from edc_sites.model_mixins import SiteModelMixin
|
|
10
|
-
from edc_utils import get_utcnow
|
|
11
11
|
|
|
12
12
|
from .location import Location
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class StorageBin(SiteModelMixin, BaseUuidModel):
|
|
16
|
-
|
|
17
16
|
bin_identifier = models.CharField(
|
|
18
17
|
max_length=36,
|
|
19
18
|
unique=True,
|
|
@@ -22,7 +21,7 @@ class StorageBin(SiteModelMixin, BaseUuidModel):
|
|
|
22
21
|
help_text="A sequential unique identifier set by the EDC",
|
|
23
22
|
)
|
|
24
23
|
|
|
25
|
-
bin_datetime = models.DateTimeField(default=
|
|
24
|
+
bin_datetime = models.DateTimeField(default=timezone.now)
|
|
26
25
|
|
|
27
26
|
name = models.CharField(
|
|
28
27
|
max_length=10,
|
|
@@ -38,7 +37,7 @@ class StorageBin(SiteModelMixin, BaseUuidModel):
|
|
|
38
37
|
|
|
39
38
|
in_use = models.BooleanField(default=True)
|
|
40
39
|
|
|
41
|
-
description = models.CharField(max_length=100,
|
|
40
|
+
description = models.CharField(max_length=100, default="", blank=True)
|
|
42
41
|
|
|
43
42
|
history = HistoricalRecords()
|
|
44
43
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.utils import timezone
|
|
4
5
|
from sequences import get_next_value
|
|
5
6
|
|
|
6
7
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
7
8
|
from edc_sites.model_mixins import SiteModelMixin
|
|
8
|
-
from edc_utils import get_utcnow
|
|
9
9
|
|
|
10
10
|
from .storage_bin import StorageBin
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ class StorageBinItem(SiteModelMixin, BaseUuidModel):
|
|
|
31
31
|
},
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
item_datetime = models.DateTimeField(default=
|
|
34
|
+
item_datetime = models.DateTimeField(default=timezone.now)
|
|
35
35
|
|
|
36
36
|
history = HistoricalRecords()
|
|
37
37
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from django.db import models
|
|
2
|
+
from django.utils import timezone
|
|
2
3
|
from sequences import get_next_value
|
|
3
4
|
|
|
4
5
|
from edc_model.models import BaseUuidModel, HistoricalRecords
|
|
5
|
-
from edc_utils import get_utcnow
|
|
6
6
|
|
|
7
7
|
from ..model_mixins import AddressModelMixin, ContactModelMixin
|
|
8
8
|
|
|
@@ -12,14 +12,13 @@ class Manager(models.Manager):
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class Supplier(AddressModelMixin, ContactModelMixin, BaseUuidModel):
|
|
15
|
-
|
|
16
15
|
supplier_identifier = models.CharField(max_length=36, unique=True, null=True, blank=True)
|
|
17
16
|
|
|
18
17
|
name = models.CharField(max_length=255, unique=True)
|
|
19
18
|
|
|
20
|
-
contact = models.CharField(max_length=255,
|
|
19
|
+
contact = models.CharField(max_length=255, default="", blank=True)
|
|
21
20
|
|
|
22
|
-
supplier_datetime = models.DateTimeField(default=
|
|
21
|
+
supplier_datetime = models.DateTimeField(default=timezone.now)
|
|
23
22
|
|
|
24
23
|
objects = Manager()
|
|
25
24
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from uuid import uuid4
|
|
2
2
|
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.utils import timezone
|
|
4
5
|
|
|
5
6
|
from edc_model.models import BaseUuidModel
|
|
6
|
-
from edc_utils import get_utcnow
|
|
7
7
|
|
|
8
8
|
from .shelf import Shelf
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ from .shelf import Shelf
|
|
|
11
11
|
class Box(BaseUuidModel):
|
|
12
12
|
box_identifier = models.CharField(max_length=36, default=uuid4, unique=True)
|
|
13
13
|
|
|
14
|
-
box_datetime = models.DateTimeField(default=
|
|
14
|
+
box_datetime = models.DateTimeField(default=timezone.now)
|
|
15
15
|
|
|
16
16
|
name = models.CharField(max_length=25, unique=True)
|
|
17
17
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
from uuid import uuid4
|
|
2
2
|
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.utils import timezone
|
|
4
5
|
|
|
5
|
-
from
|
|
6
|
-
|
|
6
|
+
from ...stock import ContainerType
|
|
7
7
|
from ..box import Box
|
|
8
|
-
from ..container_type import ContainerType
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class ContainerModelMixin(models.Model):
|
|
12
11
|
container_identifier = models.CharField(max_length=36, default=uuid4, unique=True)
|
|
13
12
|
|
|
14
|
-
container_datetime = models.DateTimeField(default=
|
|
13
|
+
container_datetime = models.DateTimeField(default=timezone.now)
|
|
15
14
|
|
|
16
15
|
name = models.CharField(max_length=25, unique=True)
|
|
17
16
|
|
|
@@ -2,7 +2,8 @@ from django.db import models
|
|
|
2
2
|
|
|
3
3
|
from edc_model.models import BaseUuidModel
|
|
4
4
|
|
|
5
|
-
from ...medication import Formulation
|
|
5
|
+
from ...medication import Formulation
|
|
6
|
+
from ...stock import Lot
|
|
6
7
|
from .container_model_mixin import ContainerModelMixin
|
|
7
8
|
|
|
8
9
|
|
|
@@ -11,7 +12,6 @@ class PillBottleError(Exception):
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class PillBottleModelMixin(ContainerModelMixin, BaseUuidModel):
|
|
14
|
-
|
|
15
15
|
formulation = models.ForeignKey(Formulation, on_delete=models.PROTECT, blank=True)
|
|
16
16
|
|
|
17
17
|
lot = models.ForeignKey(Lot, on_delete=models.PROTECT)
|
|
@@ -7,7 +7,7 @@ from .pill_bottle_model_mixin import PillBottleModelMixin
|
|
|
7
7
|
class SubjectPillBottle(PillBottleModelMixin):
|
|
8
8
|
rando_sid = models.CharField(max_length=25)
|
|
9
9
|
|
|
10
|
-
subject_identifier = models.CharField(max_length=50,
|
|
10
|
+
subject_identifier = models.CharField(max_length=50, default="")
|
|
11
11
|
|
|
12
12
|
source_container = models.ForeignKey(
|
|
13
13
|
PillBottle, on_delete=models.PROTECT, blank=True, null=True
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from uuid import uuid4
|
|
2
2
|
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.utils import timezone
|
|
4
5
|
|
|
5
6
|
from edc_model.models import BaseUuidModel
|
|
6
|
-
from edc_utils import get_utcnow
|
|
7
7
|
|
|
8
8
|
from ..stock import Location
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ from ..stock import Location
|
|
|
11
11
|
class Room(BaseUuidModel):
|
|
12
12
|
room_identifier = models.CharField(max_length=36, default=uuid4, unique=True)
|
|
13
13
|
|
|
14
|
-
room_datetime = models.DateTimeField(default=
|
|
14
|
+
room_datetime = models.DateTimeField(default=timezone.now)
|
|
15
15
|
|
|
16
16
|
name = models.CharField(max_length=25, unique=True)
|
|
17
17
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from uuid import uuid4
|
|
2
2
|
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.utils import timezone
|
|
4
5
|
|
|
5
6
|
from edc_model.models import BaseUuidModel
|
|
6
|
-
from edc_utils import get_utcnow
|
|
7
7
|
|
|
8
8
|
from .room import Room
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ from .room import Room
|
|
|
11
11
|
class Shelf(BaseUuidModel):
|
|
12
12
|
shelf_identifier = models.CharField(max_length=36, default=uuid4, unique=True)
|
|
13
13
|
|
|
14
|
-
shelf_datetime = models.DateTimeField(default=
|
|
14
|
+
shelf_datetime = models.DateTimeField(default=timezone.now)
|
|
15
15
|
|
|
16
16
|
name = models.CharField(max_length=25, unique=True)
|
|
17
17
|
|
|
@@ -6,8 +6,7 @@ from typing import TYPE_CHECKING
|
|
|
6
6
|
from django.apps import apps as django_apps
|
|
7
7
|
from django.core.exceptions import ObjectDoesNotExist
|
|
8
8
|
from django.db import transaction
|
|
9
|
-
|
|
10
|
-
from edc_utils import get_utcnow
|
|
9
|
+
from django.utils import timezone
|
|
11
10
|
|
|
12
11
|
from ..exceptions import AllocationError
|
|
13
12
|
|
|
@@ -69,7 +68,7 @@ def allocate_stock(
|
|
|
69
68
|
allocation = allocation_model_cls.objects.create(
|
|
70
69
|
stock_request_item=stock_request_item,
|
|
71
70
|
registered_subject=rs_obj,
|
|
72
|
-
allocation_datetime=
|
|
71
|
+
allocation_datetime=timezone.now(),
|
|
73
72
|
allocated_by=allocated_by,
|
|
74
73
|
user_created=user_created,
|
|
75
74
|
created=created,
|
|
@@ -4,8 +4,7 @@ from typing import TYPE_CHECKING
|
|
|
4
4
|
|
|
5
5
|
from django.apps import apps as django_apps
|
|
6
6
|
from django.core.exceptions import ObjectDoesNotExist
|
|
7
|
-
|
|
8
|
-
from edc_utils import get_utcnow
|
|
7
|
+
from django.utils import timezone
|
|
9
8
|
|
|
10
9
|
if TYPE_CHECKING:
|
|
11
10
|
from ..models import Confirmation, Receive, RepackRequest, Stock
|
|
@@ -47,7 +46,7 @@ def confirm_stock(
|
|
|
47
46
|
except ObjectDoesNotExist:
|
|
48
47
|
confirmation_model_cls.objects.create(
|
|
49
48
|
stock=stock,
|
|
50
|
-
confirmed_datetime=
|
|
49
|
+
confirmed_datetime=timezone.now(),
|
|
51
50
|
confirmed_by=confirmed_by or user_created,
|
|
52
51
|
)
|
|
53
52
|
confirmed.append(stock.code)
|
|
@@ -6,8 +6,7 @@ from django.apps import apps as django_apps
|
|
|
6
6
|
from django.contrib import messages
|
|
7
7
|
from django.core.exceptions import ObjectDoesNotExist
|
|
8
8
|
from django.core.handlers.wsgi import WSGIRequest
|
|
9
|
-
|
|
10
|
-
from edc_utils import get_utcnow
|
|
9
|
+
from django.utils import timezone
|
|
11
10
|
|
|
12
11
|
from ..exceptions import ConfirmAtSiteError
|
|
13
12
|
|
|
@@ -76,10 +75,10 @@ def confirm_stock_at_site(
|
|
|
76
75
|
obj = confirmation_at_site_item_model_cls(
|
|
77
76
|
confirmation_at_site=confirmation_at_site,
|
|
78
77
|
stock=stock,
|
|
79
|
-
confirmed_datetime=
|
|
78
|
+
confirmed_datetime=timezone.now(),
|
|
80
79
|
confirmed_by=confirmed_by,
|
|
81
80
|
user_created=confirmed_by,
|
|
82
|
-
created=
|
|
81
|
+
created=timezone.now(),
|
|
83
82
|
)
|
|
84
83
|
try:
|
|
85
84
|
obj.save()
|
edc_pharmacy/utils/dispense.py
CHANGED
|
@@ -7,8 +7,7 @@ from django.contrib import messages
|
|
|
7
7
|
from django.core.exceptions import ObjectDoesNotExist
|
|
8
8
|
from django.core.handlers.wsgi import WSGIRequest
|
|
9
9
|
from django.db.models import QuerySet
|
|
10
|
-
|
|
11
|
-
from edc_utils import get_utcnow
|
|
10
|
+
from django.utils import timezone
|
|
12
11
|
|
|
13
12
|
if TYPE_CHECKING:
|
|
14
13
|
from ..models import Dispense, DispenseItem, Location, Stock
|
|
@@ -33,7 +32,7 @@ def dispense(
|
|
|
33
32
|
messages.add_message(
|
|
34
33
|
request,
|
|
35
34
|
messages.ERROR,
|
|
36
|
-
|
|
35
|
+
f"Stock not allocated to subject. Got {stock.code}. Dispensing cancelled.",
|
|
37
36
|
)
|
|
38
37
|
assignment_mismatch = True
|
|
39
38
|
break
|
|
@@ -50,7 +49,7 @@ def dispense(
|
|
|
50
49
|
dispense=dispense_obj,
|
|
51
50
|
stock=stock,
|
|
52
51
|
user_created=request.user.username,
|
|
53
|
-
created=
|
|
52
|
+
created=timezone.now(),
|
|
54
53
|
)
|
|
55
54
|
else:
|
|
56
55
|
messages.add_message(
|
|
@@ -4,8 +4,7 @@ from uuid import UUID
|
|
|
4
4
|
|
|
5
5
|
from celery import shared_task
|
|
6
6
|
from django.apps import apps as django_apps
|
|
7
|
-
|
|
8
|
-
from edc_utils import get_utcnow
|
|
7
|
+
from django.utils import timezone
|
|
9
8
|
|
|
10
9
|
from ..exceptions import InsufficientStockError, RepackError
|
|
11
10
|
|
|
@@ -29,7 +28,7 @@ def process_repack_request(repack_request_id: UUID | None = None, username: str
|
|
|
29
28
|
if not getattr(repack_request.from_stock, "confirmation", None):
|
|
30
29
|
raise RepackError("Source stock item not confirmed")
|
|
31
30
|
stock_model_cls = repack_request.from_stock.__class__
|
|
32
|
-
for
|
|
31
|
+
for _ in range(0, int(number_to_process)):
|
|
33
32
|
try:
|
|
34
33
|
stock_model_cls.objects.create(
|
|
35
34
|
receive_item=None,
|
|
@@ -42,7 +41,7 @@ def process_repack_request(repack_request_id: UUID | None = None, username: str
|
|
|
42
41
|
repack_request=repack_request,
|
|
43
42
|
lot=repack_request.from_stock.lot,
|
|
44
43
|
user_created=username,
|
|
45
|
-
created=
|
|
44
|
+
created=timezone.now(),
|
|
46
45
|
)
|
|
47
46
|
except InsufficientStockError:
|
|
48
47
|
break
|
|
@@ -50,7 +49,7 @@ def process_repack_request(repack_request_id: UUID | None = None, username: str
|
|
|
50
49
|
repack_request=repack_request
|
|
51
50
|
).count()
|
|
52
51
|
repack_request.user_modified = username
|
|
53
|
-
repack_request.modified =
|
|
52
|
+
repack_request.modified = timezone.now()
|
|
54
53
|
repack_request.save(
|
|
55
54
|
update_fields=[
|
|
56
55
|
"requested_qty",
|
|
@@ -6,10 +6,9 @@ from typing import TYPE_CHECKING
|
|
|
6
6
|
import pandas as pd
|
|
7
7
|
from celery import shared_task
|
|
8
8
|
from django.apps import apps as django_apps
|
|
9
|
+
from django.utils import timezone
|
|
9
10
|
from sequences import get_next_value
|
|
10
11
|
|
|
11
|
-
from edc_utils import get_utcnow
|
|
12
|
-
|
|
13
12
|
if TYPE_CHECKING:
|
|
14
13
|
from uuid import UUID
|
|
15
14
|
|
|
@@ -29,7 +28,7 @@ def bulk_create_stock_request_items(
|
|
|
29
28
|
|
|
30
29
|
stock_request = stock_request_model_cls.objects.get(pk=stock_request_pk)
|
|
31
30
|
df_nostock = pd.DataFrame(nostock_as_dict)
|
|
32
|
-
now =
|
|
31
|
+
now = timezone.now()
|
|
33
32
|
data = []
|
|
34
33
|
for i, row in df_nostock[df_nostock.stock_qty == 0].iterrows():
|
|
35
34
|
registered_subject = registered_subject_model_cls.objects.get(
|
|
@@ -6,8 +6,7 @@ from django.apps import apps as django_apps
|
|
|
6
6
|
from django.core.exceptions import ObjectDoesNotExist
|
|
7
7
|
from django.core.handlers.wsgi import WSGIRequest
|
|
8
8
|
from django.db import transaction
|
|
9
|
-
|
|
10
|
-
from edc_utils import get_utcnow
|
|
9
|
+
from django.utils import timezone
|
|
11
10
|
|
|
12
11
|
if TYPE_CHECKING:
|
|
13
12
|
from ..models import StockTransfer
|
|
@@ -35,7 +34,7 @@ def transfer_stock(
|
|
|
35
34
|
stock=stock,
|
|
36
35
|
stock_transfer=stock_transfer,
|
|
37
36
|
user_created=request.user.username,
|
|
38
|
-
created=
|
|
37
|
+
created=timezone.now(),
|
|
39
38
|
)
|
|
40
39
|
stock.location = stock_transfer.to_location
|
|
41
40
|
stock.save()
|