meta-edc 1.1.8__py3-none-any.whl → 1.1.12__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 meta-edc might be problematic. Click here for more details.
- meta_ae/action_items.py +2 -1
- meta_ae/admin/__init__.py +11 -0
- meta_ae/admin/ae_susar_admin.py +1 -1
- meta_ae/admin/death_report_admin.py +1 -1
- meta_ae/admin/modeladmin_mixins.py +10 -12
- meta_ae/baker_recipes.py +3 -3
- meta_ae/forms/__init__.py +13 -0
- meta_ae/forms/modelform_mixins.py +2 -2
- meta_ae/migrations/0001_initial.py +27 -27
- meta_ae/migrations/0006_aelocalreview_aesponsorreview.py +5 -5
- meta_ae/migrations/0022_historicalhospitalization_hospitalization.py +5 -13
- meta_ae/migrations/0023_alter_aefollowup_action_identifier_and_more.py +2017 -0
- meta_ae/model_mixins/__init__.py +2 -0
- meta_ae/model_mixins/ae_review_model_mixin.py +6 -6
- meta_ae/model_mixins/death_report_model_mixin.py +3 -3
- meta_ae/models/__init__.py +13 -0
- meta_ae/models/hospitalization.py +3 -3
- meta_ae/pdf_reports/__init__.py +2 -0
- meta_analytics/.DS_Store +0 -0
- meta_analytics/dataframes/__init__.py +24 -0
- meta_analytics/dataframes/get_eos_df.py +1 -2
- meta_analytics/dataframes/get_glucose_df.py +6 -7
- meta_analytics/dataframes/get_glucose_fbg_df.py +2 -3
- meta_analytics/dataframes/get_glucose_fbg_ogtt_df.py +1 -2
- meta_analytics/dataframes/get_last_imp_visits_df.py +5 -6
- meta_analytics/dataframes/glucose_endpoints/__init__.py +2 -0
- meta_analytics/dataframes/glucose_endpoints/endpoint_by_date.py +13 -20
- meta_analytics/dataframes/glucose_endpoints/glucose_endpoints_by_date.py +9 -10
- meta_analytics/dataframes/screening/__init__.py +2 -0
- meta_analytics/dataframes/screening/get_glucose_tested_only_df.py +1 -2
- meta_analytics/dataframes/screening/get_screening_df.py +6 -10
- meta_analytics/dataframes/utils.py +3 -8
- meta_analytics/get_tables.py +1 -2
- meta_analytics/tables/__init__.py +2 -0
- meta_consent/action_items.py +2 -1
- meta_consent/admin/__init__.py +6 -0
- meta_consent/admin/actions/__init__.py +2 -0
- meta_consent/admin/actions/create_missing_prescriptions.py +1 -1
- meta_consent/admin/list_filters.py +2 -2
- meta_consent/admin/modeladmin_mixins.py +3 -4
- meta_consent/admin/subject_consent_v1_ext_admin.py +2 -2
- meta_consent/baker_recipes.py +7 -8
- meta_consent/form_validators/__init__.py +2 -0
- meta_consent/forms/__init__.py +7 -0
- meta_consent/forms/subject_consent_v1_ext_form.py +2 -3
- meta_consent/forms/subject_reconsent_form.py +4 -4
- meta_consent/management/commands/create_missing_prescriptions.py +4 -2
- meta_consent/migrations/0001_initial.py +9 -9
- meta_consent/migrations/0024_historicalsubjectconsentv1.py +3 -8
- meta_consent/migrations/0026_historicalsubjectconsentv1ext_subjectconsentv1ext.py +5 -14
- meta_consent/migrations/0032_alter_historicalsubjectconsent_device_created_and_more.py +678 -0
- meta_consent/models/__init__.py +9 -0
- meta_consent/models/model_mixins.py +1 -2
- meta_consent/models/signals.py +9 -10
- meta_consent/models/subject_consent.py +1 -1
- meta_consent/models/subject_reconsent.py +3 -3
- meta_dashboard/patterns.py +1 -1
- meta_dashboard/templatetags/meta_dashboard_extras.py +1 -1
- meta_dashboard/view_utils/__init__.py +7 -0
- meta_dashboard/view_utils/subject_screening_button.py +9 -16
- meta_dashboard/views/__init__.py +8 -0
- meta_dashboard/views/ae/__init__.py +2 -0
- meta_dashboard/views/ae/ae_listboard_view.py +1 -1
- meta_dashboard/views/ae/death_report_listboard_view.py +1 -1
- meta_dashboard/views/screening/__init__.py +2 -0
- meta_dashboard/views/subject/__init__.py +2 -0
- meta_dashboard/views/subject/dashboard/__init__.py +2 -0
- meta_dashboard/views/subject/dashboard/dashboard_view.py +1 -1
- meta_dashboard/views/subject/listboard/__init__.py +2 -0
- meta_edc/__init__.py +5 -9
- meta_edc/celery.py +1 -1
- meta_edc/celery_live.py +1 -1
- meta_edc/celery_uat.py +1 -1
- meta_edc/management/commands/update_forms_reference.py +10 -12
- meta_edc/settings/debug.py +5 -4
- meta_edc/settings/defaults.py +18 -3
- meta_edc/settings/live.py +3 -1
- meta_edc/settings/logging.py +9 -4
- meta_edc/settings/minimal.py +4 -5
- meta_edc/settings/uat.py +3 -1
- meta_edc/views/__init__.py +2 -0
- meta_edc-1.1.12.dist-info/METADATA +174 -0
- {meta_edc-1.1.8.dist-info → meta_edc-1.1.12.dist-info}/RECORD +413 -526
- meta_edc-1.1.12.dist-info/WHEEL +4 -0
- meta_lists/migrations/0020_alter_abnormalfootappearanceobservations_extra_value_and_more.py +404 -0
- meta_pharmacy/admin/__init__.py +5 -0
- meta_pharmacy/admin/substitutions_admin.py +2 -2
- meta_pharmacy/forms/__init__.py +2 -0
- meta_pharmacy/forms/substitutions_form.py +6 -4
- meta_pharmacy/labels/__init__.py +4 -2
- meta_pharmacy/labels/draw_label_for_subject_with_barcode.py +1 -2
- meta_pharmacy/labels/draw_label_with_test_data.py +2 -2
- meta_pharmacy/labels/label_data.py +1 -2
- meta_pharmacy/labels/print_sheets.py +4 -6
- meta_pharmacy/migrations/0002_initial.py +7 -20
- meta_pharmacy/migrations/0003_auto_20240909_2335.py +3 -2
- meta_pharmacy/migrations/0006_lotnumber_label.py +5 -14
- meta_pharmacy/migrations/0008_remove_lotnumber_medication_and_more.py +5 -6
- meta_pharmacy/migrations/0010_alter_historicallabeldata_device_created_and_more.py +382 -0
- meta_pharmacy/models/__init__.py +7 -0
- meta_pharmacy/models/label_data.py +4 -5
- meta_pharmacy/models/substitutions.py +3 -3
- meta_pharmacy/prepare_meta_pharmacy.py +1 -1
- meta_pharmacy/utils/__init__.py +2 -0
- meta_pharmacy/utils/update_initial_pharmacy_data.py +1 -1
- meta_prn/admin/__init__.py +16 -0
- meta_prn/admin/dm_referral_admin.py +2 -1
- meta_prn/admin/end_of_study_admin.py +6 -7
- meta_prn/admin/loss_to_followup_admin.py +3 -2
- meta_prn/admin/off_study_medication_admin.py +5 -6
- meta_prn/admin/offschedule_admin.py +5 -6
- meta_prn/admin/offschedule_dm_referral_admin.py +6 -6
- meta_prn/admin/offschedule_postnatal_admin.py +7 -7
- meta_prn/admin/offschedule_pregnancy_admin.py +8 -7
- meta_prn/admin/onschedule_admin.py +7 -8
- meta_prn/admin/onschedule_dm_referral_admin.py +6 -7
- meta_prn/admin/pregnancy_notification_admin.py +5 -6
- meta_prn/admin/protocol_incident_admin.py +1 -1
- meta_prn/admin/subject_transfer_admin.py +1 -1
- meta_prn/baker_recipes.py +4 -4
- meta_prn/form_validators/__init__.py +5 -0
- meta_prn/form_validators/end_of_study.py +2 -2
- meta_prn/forms/__init__.py +13 -0
- meta_prn/migrations/0001_initial.py +25 -25
- meta_prn/migrations/0017_auto_20220307_1929.py +5 -5
- meta_prn/migrations/0018_auto_20220309_2106.py +9 -9
- meta_prn/migrations/0021_auto_20220316_2147.py +13 -13
- meta_prn/migrations/0022_auto_20220318_0133.py +9 -9
- meta_prn/migrations/0032_historicalegfrnotification_egfrnotification.py +5 -13
- meta_prn/migrations/0038_alter_endofstudy_delivery_date_and_more.py +5 -13
- meta_prn/migrations/0041_endofstudy_transfer_date_and_more.py +5 -13
- meta_prn/migrations/0057_historicalonscheduledmreferral_and_more.py +13 -38
- meta_prn/migrations/0067_alter_offschedule_managers_and_more.py +2557 -0
- meta_prn/models/__init__.py +20 -0
- meta_prn/models/offschedule.py +4 -4
- meta_prn/models/protocol_incident.py +1 -1
- meta_prn/models/subject_transfer.py +8 -0
- meta_rando/migrations/0001_initial.py +5 -5
- meta_rando/migrations/0006_alter_historicalrandomizationlist_allocated_user_and_more.py +130 -0
- meta_reports/__init__.py +2 -0
- meta_reports/admin/__init__.py +16 -0
- meta_reports/admin/dbviews/__init__.py +13 -0
- meta_reports/admin/dbviews/glucose_summary_admin.py +6 -6
- meta_reports/admin/dbviews/imp_substitutions_admin.py +12 -11
- meta_reports/admin/dbviews/missing_screening_ogtt_admin/__init__.py +5 -0
- meta_reports/admin/dbviews/missing_screening_ogtt_admin/note_model_admin.py +27 -3
- meta_reports/admin/dbviews/missing_screening_ogtt_admin/unmanaged_model_admin.py +6 -6
- meta_reports/admin/dbviews/on_study_missing_lab_values_admin/__init__.py +2 -0
- meta_reports/admin/dbviews/on_study_missing_lab_values_admin/unmanaged_model_admin.py +0 -3
- meta_reports/admin/dbviews/on_study_missing_values_admin/__init__.py +2 -0
- meta_reports/admin/dbviews/patient_history_missing_baseline_cd4_admin.py +8 -8
- meta_reports/admin/dbviews/unattended_three_in_row2_admin.py +6 -6
- meta_reports/admin/dbviews/unattended_three_in_row_admin.py +5 -5
- meta_reports/admin/dbviews/unattended_two_in_row_admin.py +5 -5
- meta_reports/admin/endpoints_admin.py +1 -1
- meta_reports/admin/last_imp_refill_admin.py +9 -9
- meta_reports/admin/list_filters.py +2 -2
- meta_reports/admin/modeladmin_mixins.py +9 -16
- meta_reports/death_report.py +1 -1
- meta_reports/forms/__init__.py +2 -0
- meta_reports/forms/missing_ogtt_note_form.py +2 -3
- meta_reports/management/commands/generate_endpoints.py +5 -4
- meta_reports/migrations/0035_historicalmissingogttnote_missingogttnote.py +5 -14
- meta_reports/migrations/0059_alter_endpoints_created_and_more.py +161 -0
- meta_reports/models/__init__.py +17 -0
- meta_reports/models/dbviews/__init__.py +14 -0
- meta_reports/models/dbviews/glucose_summary/__init__.py +2 -0
- meta_reports/models/dbviews/glucose_summary/unmanaged_model.py +4 -5
- meta_reports/models/dbviews/imp_substitutions/__init__.py +2 -0
- meta_reports/models/dbviews/imp_substitutions/view_definition.py +1 -1
- meta_reports/models/dbviews/missing_screening_ogtt/__init__.py +2 -0
- meta_reports/models/dbviews/missing_screening_ogtt/note_model.py +1 -1
- meta_reports/models/dbviews/missing_screening_ogtt/unmanaged_model.py +4 -3
- meta_reports/models/dbviews/on_study_missing_lab_values/__init__.py +2 -0
- meta_reports/models/dbviews/on_study_missing_lab_values/qa_cases.py +13 -11
- meta_reports/models/dbviews/on_study_missing_values/__init__.py +2 -0
- meta_reports/models/dbviews/on_study_missing_values/qa_cases.py +18 -0
- meta_reports/models/dbviews/patient_history_missing_baseline_cd4/__init__.py +2 -0
- meta_reports/models/dbviews/unattended_three_in_row/__init__.py +2 -0
- meta_reports/models/dbviews/unattended_three_in_row2/__init__.py +2 -0
- meta_reports/models/dbviews/unattended_two_in_row/__init__.py +2 -0
- meta_reports/models/endpoints.py +4 -4
- meta_reports/models/last_imp_refill.py +2 -3
- meta_reports/pdf_report.py +2 -2
- meta_reports/tasks.py +1 -1
- meta_screening/admin/__init__.py +8 -0
- meta_screening/admin/fieldsets.py +13 -14
- meta_screening/admin/list_filters.py +6 -4
- meta_screening/admin/screening_part_one_admin.py +1 -2
- meta_screening/admin/screening_part_three_admin.py +2 -3
- meta_screening/admin/screening_part_two_admin.py +7 -10
- meta_screening/admin/subject_refusal_admin.py +5 -3
- meta_screening/admin/subject_screening_admin.py +4 -4
- meta_screening/baker_recipes.py +9 -9
- meta_screening/eligibility/__init__.py +9 -0
- meta_screening/eligibility/eligibility.py +7 -7
- meta_screening/eligibility/eligibility_part_three/__init__.py +2 -0
- meta_screening/eligibility/eligibility_part_three/base_eligibility_part_three.py +8 -8
- meta_screening/eligibility/eligibility_part_three/eligibility_part_three_phase_three.py +13 -14
- meta_screening/form_validators/__init__.py +8 -0
- meta_screening/forms/__init__.py +20 -0
- meta_screening/forms/field_lists.py +16 -17
- meta_screening/forms/screening_part_one_form.py +2 -2
- meta_screening/forms/screening_part_three_form.py +5 -3
- meta_screening/forms/screening_part_two_form.py +1 -5
- meta_screening/forms/subject_refusal_form.py +0 -4
- meta_screening/forms/subject_screening_form.py +0 -4
- meta_screening/migrations/0001_initial.py +15 -15
- meta_screening/migrations/0010_auto_20191106_0828.py +5 -5
- meta_screening/migrations/0068_alter_historicalscreeningpartone_acute_condition_and_more.py +1579 -0
- meta_screening/model_mixins/__init__.py +8 -0
- meta_screening/model_mixins/eligibility_model_mixin.py +5 -3
- meta_screening/model_mixins/part_one_fields_model_mixin.py +5 -9
- meta_screening/model_mixins/part_three_fields_model_mixin.py +5 -6
- meta_screening/model_mixins/part_two_fields_model_mixin.py +18 -16
- meta_screening/models/__init__.py +9 -0
- meta_screening/models/icp_referral.py +5 -5
- meta_screening/models/signals.py +10 -11
- meta_screening/models/subject_refusal.py +1 -1
- meta_screening/models/subject_screening.py +1 -3
- meta_subject/action_items.py +13 -15
- meta_subject/admin/__init__.py +39 -0
- meta_subject/admin/birth_outcome_admin.py +4 -8
- meta_subject/admin/blood_results/__init__.py +9 -0
- meta_subject/admin/blood_results/blood_results_fbc_admin.py +1 -1
- meta_subject/admin/blood_results/blood_results_hba1c_admin.py +1 -1
- meta_subject/admin/blood_results/blood_results_ins_admin.py +1 -1
- meta_subject/admin/blood_results/blood_results_lft_admin.py +1 -1
- meta_subject/admin/blood_results/blood_results_lipids_admin.py +1 -1
- meta_subject/admin/blood_results/blood_results_rft_admin.py +3 -5
- meta_subject/admin/complications_glycemia_admin.py +1 -1
- meta_subject/admin/delivery_admin.py +7 -10
- meta_subject/admin/diabetes/__init__.py +2 -0
- meta_subject/admin/diabetes/dm_endpoint_admin.py +2 -2
- meta_subject/admin/diabetes/dm_followup_admin.py +3 -2
- meta_subject/admin/egfr_drop_notification_admin.py +1 -1
- meta_subject/admin/followup_examination_admin.py +10 -9
- meta_subject/admin/followup_vitals_admin.py +4 -5
- meta_subject/admin/glucose_admin.py +2 -4
- meta_subject/admin/glucose_fbg_admin.py +1 -3
- meta_subject/admin/health_economics/__init__.py +2 -0
- meta_subject/admin/health_economics/health_economics_simple_admin.py +1 -1
- meta_subject/admin/health_economics/health_economics_update_admin.py +1 -1
- meta_subject/admin/hepatitis_test_admin.py +1 -1
- meta_subject/admin/list_filters.py +1 -1
- meta_subject/admin/mnsi_admin.py +7 -5
- meta_subject/admin/other_arv_regimens_admin.py +3 -3
- meta_subject/admin/patient_history_admin.py +4 -4
- meta_subject/admin/physical_exam_admin.py +1 -1
- meta_subject/admin/pregnancy_update_admin.py +1 -1
- meta_subject/admin/study_medication_admin.py +8 -15
- meta_subject/admin/subject_requisition_admin.py +1 -1
- meta_subject/admin/subject_visit_admin.py +1 -1
- meta_subject/admin/subject_visit_missed_admin.py +1 -1
- meta_subject/admin/urine_dipstick_test_admin.py +1 -1
- meta_subject/admin/urine_pregnancy_admin.py +1 -1
- meta_subject/baker_recipes.py +15 -15
- meta_subject/form_validators/__init__.py +11 -0
- meta_subject/form_validators/delivery_form_validator.py +2 -3
- meta_subject/form_validators/dm_endpoint_form_validator.py +1 -1
- meta_subject/form_validators/dm_followup_form_validator.py +7 -6
- meta_subject/form_validators/glucose_form_validator.py +3 -5
- meta_subject/forms/__init__.py +41 -0
- meta_subject/forms/blood_results/__init__.py +9 -0
- meta_subject/forms/blood_results/blood_results_rft_form.py +1 -2
- meta_subject/forms/diabetes/__init__.py +2 -0
- meta_subject/forms/diabetes/dm_followup_form.py +2 -2
- meta_subject/forms/followup_vitals_form.py +3 -8
- meta_subject/forms/health_economics/__init__.py +2 -0
- meta_subject/forms/next_appointment_form.py +2 -3
- meta_subject/forms/slider_widget.py +1 -1
- meta_subject/forms/study_medication_form.py +11 -8
- meta_subject/management/commands/create_missing_refills.py +3 -3
- meta_subject/management/commands/create_missing_rx.py +1 -1
- meta_subject/management/commands/missed.py +20 -23
- meta_subject/metadata_rules/__init__.py +2 -0
- meta_subject/metadata_rules/predicates.py +25 -32
- meta_subject/migrations/0001_initial.py +61 -61
- meta_subject/migrations/0002_auto_20191021_0353.py +5 -5
- meta_subject/migrations/0012_auto_20200118_2334.py +5 -5
- meta_subject/migrations/0014_auto_20200120_1622.py +5 -5
- meta_subject/migrations/0018_coronakap_historicalcoronakap.py +5 -5
- meta_subject/migrations/0033_auto_20200516_2356.py +5 -5
- meta_subject/migrations/0038_auto_20200520_0020.py +5 -5
- meta_subject/migrations/0040_auto_20200527_2155.py +1 -1
- meta_subject/migrations/0045_auto_20200530_1801.py +1 -1
- meta_subject/migrations/0051_auto_20200617_2117.py +5 -5
- meta_subject/migrations/0063_auto_20210715_0337.py +5 -5
- meta_subject/migrations/0066_auto_20210721_0335.py +9 -9
- meta_subject/migrations/0067_auto_20210726_0340.py +5 -5
- meta_subject/migrations/0068_auto_20210728_1809.py +5 -5
- meta_subject/migrations/0072_auto_20210805_1545.py +7 -7
- meta_subject/migrations/0073_auto_20210809_0055.py +5 -5
- meta_subject/migrations/0077_auto_20210809_2323.py +3 -3
- meta_subject/migrations/0082_auto_20210823_1612.py +3 -3
- meta_subject/migrations/0083_auto_20210823_1620.py +3 -3
- meta_subject/migrations/0088_auto_20210924_0027.py +5 -5
- meta_subject/migrations/0090_auto_20210924_0424.py +5 -5
- meta_subject/migrations/0093_auto_20211117_0352.py +5 -5
- meta_subject/migrations/0095_auto_20220128_1719.py +5 -5
- meta_subject/migrations/0098_auto_20220309_2106.py +5 -5
- meta_subject/migrations/0101_auto_20220316_2147.py +13 -13
- meta_subject/migrations/0115_historicalegfrnotification_egfrnotification.py +5 -13
- meta_subject/migrations/0164_dmreferralfollowup_historicaldmreferralfollowup.py +5 -5
- meta_subject/migrations/0172_remove_historicalbloodresultsglu_action_item_and_more.py +1 -2
- meta_subject/migrations/0177_alter_bloodresultslft_alp_value_and_more.py +1 -2
- meta_subject/migrations/0178_historicalhealtheconomicsupdate_and_more.py +5 -14
- meta_subject/migrations/0186_healtheconomicsupdate_singleton_field_and_more.py +1 -2
- meta_subject/migrations/0187_dmdiagnosis_historicaldmdiagnosis_dmdxresult_and_more.py +5 -14
- meta_subject/migrations/0188_historicaldmdxresult_dmdxresult.py +5 -14
- meta_subject/migrations/0209_remove_historicaldmdxresult_dm_diagnosis_and_more.py +1 -2
- meta_subject/migrations/0216_historicalnextappointment_nextappointment.py +5 -6
- meta_subject/migrations/0220_historicalbloodresultsgludummy_bloodresultsgludummy.py +5 -14
- meta_subject/migrations/0227_alter_followupvitals_waist_circumference_comment_and_more.py +97 -0
- meta_subject/migrations/0228_bloodresultshba1c_hba1c_datetime_and_more.py +9297 -0
- meta_subject/model_mixins/__init__.py +8 -0
- meta_subject/model_mixins/search_slug_model_mixin.py +1 -2
- meta_subject/model_mixins/vitals_fields_model_mixin.py +1 -1
- meta_subject/models/__init__.py +48 -0
- meta_subject/models/birth_outcomes.py +3 -3
- meta_subject/models/blood_results/__init__.py +11 -0
- meta_subject/models/delivery.py +3 -3
- meta_subject/models/diabetes/__init__.py +2 -0
- meta_subject/models/diabetes/dm_endpoint.py +4 -4
- meta_subject/models/diabetes/dm_followup.py +3 -4
- meta_subject/models/diet_and_lifestyle.py +2 -2
- meta_subject/models/followup_examination.py +11 -11
- meta_subject/models/glucose.py +4 -4
- meta_subject/models/glucose_fbg.py +2 -3
- meta_subject/models/health_economics/__init__.py +2 -0
- meta_subject/models/health_economics/health_economics.py +7 -7
- meta_subject/models/health_economics/health_economics_update.py +2 -1
- meta_subject/models/hepatitis_test.py +2 -2
- meta_subject/models/other_arv_regimens_detail.py +1 -1
- meta_subject/models/patient_history.py +5 -6
- meta_subject/models/physical_exam.py +2 -2
- meta_subject/models/pregnancy_update.py +1 -1
- meta_subject/models/signals.py +14 -12
- meta_subject/models/subject_visit.py +1 -1
- meta_subject/models/urine_dipstick_test.py +1 -1
- meta_subject/models/urine_pregnancy.py +1 -1
- meta_visit_schedule/visit_schedules/__init__.py +2 -0
- meta_visit_schedule/visit_schedules/phase_three/__init__.py +2 -0
- meta_visit_schedule/visit_schedules/phase_three/schedule.py +2 -2
- meta_visit_schedule/visit_schedules/phase_three/schedule_dm_referral.py +1 -2
- meta_visit_schedule/visit_schedules/phase_three/schedule_pregnancy.py +1 -2
- meta_ae/tests/holidays.csv +0 -15
- meta_ae/tests/tests/test_actions.py +0 -126
- meta_ae/tests/urls.py +0 -10
- meta_analytics/dataframes/glucose_endpoints/utils.py +0 -0
- meta_analytics/notebooks/anu.ipynb +0 -95
- meta_analytics/notebooks/appointment_planning.ipynb +0 -329
- meta_analytics/notebooks/arvs.ipynb +0 -103
- meta_analytics/notebooks/cleaning/__init__.py +0 -0
- meta_analytics/notebooks/cleaning/consent_v1_ext.ipynb +0 -227
- meta_analytics/notebooks/cleaning/offschedule_eos.ipynb +0 -353
- meta_analytics/notebooks/dsmc/renal_dysfunction.ipynb +0 -435
- meta_analytics/notebooks/endpoints/meta_endpoints_by_date.ipynb +0 -656
- meta_analytics/notebooks/followup_examination.ipynb +0 -141
- meta_analytics/notebooks/hba1c.ipynb +0 -136
- meta_analytics/notebooks/hiv_regimens.ipynb +0 -429
- meta_analytics/notebooks/incidence.ipynb +0 -232
- meta_analytics/notebooks/liver.ipynb +0 -389
- meta_analytics/notebooks/magreth.ipynb +0 -645
- meta_analytics/notebooks/monitoring_report.ipynb +0 -1834
- meta_analytics/notebooks/pharmacy.ipynb +0 -1061
- meta_analytics/notebooks/pharmacy_stock_202410.ipynb +0 -306
- meta_analytics/notebooks/qa.ipynb +0 -273
- meta_analytics/notebooks/steering.ipynb +0 -61
- meta_analytics/notebooks/undiagnosed/meta3_screening_consort_chart.ipynb +0 -1176
- meta_analytics/notebooks/undiagnosed/meta3_screening_undiagnosed.ipynb +0 -519
- meta_analytics/notebooks/undiagnosed/meta_screening_table2.ipynb +0 -964
- meta_analytics/notebooks/undiagnosed/screen_undiagnosed_or.ipynb +0 -296
- meta_analytics/notebooks/undiagnosed/screening.ipynb +0 -273
- meta_analytics/notebooks/undiagnosed/screening2.ipynb +0 -958
- meta_analytics/notebooks/undiagnosed/screening_undiagnosed_20241002.ipynb +0 -958
- meta_analytics/notebooks/ven.ipynb +0 -191
- meta_analytics/notebooks/vitals.ipynb +0 -263
- meta_analytics/tests/__init__.py +0 -0
- meta_analytics/tests/test_endpoints_by_date.py +0 -94
- meta_consent/tests/__init__.py +0 -0
- meta_consent/tests/holidays.csv +0 -15
- meta_consent/tests/tests/__init__.py +0 -0
- meta_consent/tests/tests/test_form_validators.py +0 -110
- meta_consent/tests/tests/test_subject_consent.py +0 -10
- meta_consent/tests/urls.py +0 -17
- meta_dashboard/tests/__init__.py +0 -0
- meta_dashboard/tests/admin.py +0 -22
- meta_dashboard/tests/holidays.csv +0 -15
- meta_dashboard/tests/tests/__init__.py +0 -0
- meta_dashboard/tests/urls.py +0 -55
- meta_edc/tests/__init__.py +0 -0
- meta_edc/tests/tests/__init__.py +0 -0
- meta_edc/tests/tests/test_endpoints.py +0 -555
- meta_edc-1.1.8.dist-info/METADATA +0 -767
- meta_edc-1.1.8.dist-info/WHEEL +0 -5
- meta_edc-1.1.8.dist-info/licenses/AUTHORS.rst +0 -8
- meta_edc-1.1.8.dist-info/top_level.txt +0 -20
- meta_labs/tests/__init__.py +0 -0
- meta_labs/tests/test_labs.py +0 -27
- meta_labs/tests/test_reportables.py +0 -70
- meta_labs/tests/urls.py +0 -4
- meta_lists/tests/__init__.py +0 -0
- meta_lists/tests/test_lists.py +0 -8
- meta_pharmacy/notebooks/pharmacy.ipynb +0 -41
- meta_prn/tests/__init__.py +0 -0
- meta_prn/tests/tests/__init__.py +0 -0
- meta_prn/tests/tests/test_actions.py +0 -97
- meta_prn/tests/tests/test_dm_referral.py +0 -203
- meta_prn/tests/tests/test_eos_events.py +0 -134
- meta_prn/tests/tests/test_manager_order.py +0 -14
- meta_prn/tests/tests/test_pregnancy_notification.py +0 -93
- meta_prn/tests/urls.py +0 -10
- meta_rando/tests/__init__.py +0 -0
- meta_rando/tests/tests/__init__.py +0 -0
- meta_rando/tests/tests/test_randomizers.py +0 -57
- meta_reports/tests/__init__.py +0 -0
- meta_reports/tests/test_reports.py +0 -35
- meta_reports/tests/test_sql_gen.py +0 -5
- meta_reports/tests/urls.py +0 -4
- meta_screening/offline_models.py +0 -3
- meta_screening/tests/__init__.py +0 -0
- meta_screening/tests/holidays.csv +0 -15
- meta_screening/tests/meta_test_case_mixin.py +0 -234
- meta_screening/tests/options.py +0 -127
- meta_screening/tests/tests/__init__.py +0 -0
- meta_screening/tests/tests/test_forms.py +0 -404
- meta_screening/tests/tests/test_screening_part_one.py +0 -108
- meta_screening/tests/tests/test_screening_part_three.py +0 -433
- meta_screening/tests/tests/test_screening_part_two.py +0 -84
- meta_sites/tests/__init__.py +0 -0
- meta_sites/tests/test_sites.py +0 -12
- meta_sites/tests/urls.py +0 -4
- meta_stats/__init__.py +0 -0
- meta_stats/incidence.py +0 -16
- meta_stats/models.py +0 -0
- meta_stats/tests/__init__.py +0 -0
- meta_stats/tests/tests/__init__.py +0 -0
- meta_stats/tests/tests/test_incidence.py +0 -10
- meta_subject/tests/__init__.py +0 -0
- meta_subject/tests/holidays.csv +0 -15
- meta_subject/tests/tests/__init__.py +0 -0
- meta_subject/tests/tests/test_egfr.py +0 -234
- meta_subject/tests/tests/test_fixes.py +0 -64
- meta_subject/tests/tests/test_followup.py +0 -52
- meta_subject/tests/tests/test_manager_order.py +0 -11
- meta_subject/tests/tests/test_medication_adherence.py +0 -79
- meta_subject/tests/tests/test_metadata_rules.py +0 -135
- meta_subject/tests/tests/test_mnsi.py +0 -341
- meta_subject/tests/tests/test_next_appointment.py +0 -231
- meta_subject/tests/tests/test_patient_history_form.py +0 -74
- meta_subject/tests/tests/test_physical_exam.py +0 -84
- meta_subject/tests/tests/test_sf12.py +0 -161
- meta_subject/tests/tests/test_study_medication.py +0 -229
- meta_subject/tests/urls.py +0 -24
- meta_visit_schedule/tests/__init__.py +0 -0
- meta_visit_schedule/tests/tests/__init__.py +0 -0
- meta_visit_schedule/tests/tests/test_schedule.py +0 -181
- meta_visit_schedule/tests/urls.py +0 -4
- tests/__init__.py +0 -0
- tests/etc/randomization_list.csv +0 -241
- tests/etc/randomization_list_phase_three.csv +0 -241
- tests/etc/user-aes-local.key +0 -0
- tests/etc/user-aes-restricted.key +0 -1
- tests/etc/user-rsa-local-private.pem +0 -27
- tests/etc/user-rsa-local-public.pem +0 -9
- tests/etc/user-rsa-restricted-private.pem +0 -27
- tests/etc/user-rsa-restricted-public.pem +0 -9
- tests/etc/user-salt-local.key +0 -0
- tests/etc/user-salt-restricted.key +0 -0
- tests/holidays.csv +0 -15
- tests/test_settings.py +0 -185
- {meta_edc-1.1.8.dist-info → meta_edc-1.1.12.dist-info}/licenses/LICENSE +0 -0
- /meta_ae/tests/__init__.py → /meta_subject/management/__init__py.py +0 -0
- /meta_ae/tests/tests/__init__.py → /meta_subject/management/commands/__init__py.py +0 -0
|
@@ -17,7 +17,7 @@ class UrinePregnancy(CrfWithActionModelMixin, edc_models.BaseUuidModel):
|
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
not_performed_reason = models.CharField(
|
|
20
|
-
verbose_name="If NO, provide reason", max_length=150,
|
|
20
|
+
verbose_name="If NO, provide reason", max_length=150, default="", blank=True
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
assay_date = models.DateField(verbose_name="Urine βhCG date", blank=True, null=True)
|
|
@@ -47,10 +47,10 @@ from .crfs import (
|
|
|
47
47
|
crfs_48m,
|
|
48
48
|
crfs_d1,
|
|
49
49
|
crfs_missed,
|
|
50
|
+
crfs_w2,
|
|
50
51
|
)
|
|
51
52
|
from .crfs import crfs_prn as default_crfs_prn
|
|
52
53
|
from .crfs import crfs_unscheduled as default_crfs_unscheduled
|
|
53
|
-
from .crfs import crfs_w2
|
|
54
54
|
from .requisitions import (
|
|
55
55
|
requisitions_1m,
|
|
56
56
|
requisitions_3m,
|
|
@@ -70,10 +70,10 @@ from .requisitions import (
|
|
|
70
70
|
requisitions_45m,
|
|
71
71
|
requisitions_48m,
|
|
72
72
|
requisitions_d1,
|
|
73
|
+
requisitions_w2,
|
|
73
74
|
)
|
|
74
75
|
from .requisitions import requisitions_prn as default_requisitions_prn
|
|
75
76
|
from .requisitions import requisitions_unscheduled as default_requisitions_unscheduled
|
|
76
|
-
from .requisitions import requisitions_w2
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
class Visit(BaseVisit):
|
|
@@ -6,8 +6,7 @@ from edc_visit_schedule.visit import Crf, CrfCollection, Visit
|
|
|
6
6
|
from meta_consent.consents import consent_v1
|
|
7
7
|
|
|
8
8
|
from ...constants import DM_BASELINE, DM_FOLLOWUP, SCHEDULE_DM_REFERRAL
|
|
9
|
-
from .crfs import crfs_missed
|
|
10
|
-
from .crfs import crfs_prn
|
|
9
|
+
from .crfs import crfs_missed, crfs_prn
|
|
11
10
|
from .crfs import crfs_prn as default_crfs_prn
|
|
12
11
|
|
|
13
12
|
crfs_baseline = CrfCollection(
|
|
@@ -6,8 +6,7 @@ from edc_visit_schedule.visit import Visit
|
|
|
6
6
|
from meta_consent.consents import consent_v1
|
|
7
7
|
|
|
8
8
|
from ...constants import DELIVERY, SCHEDULE_PREGNANCY
|
|
9
|
-
from .crfs import crfs_missed
|
|
10
|
-
from .crfs import crfs_prn
|
|
9
|
+
from .crfs import crfs_missed, crfs_prn
|
|
11
10
|
from .crfs import crfs_prn as default_crfs_prn
|
|
12
11
|
from .crfs_pregnancy import crfs_pregnancy
|
|
13
12
|
|
meta_ae/tests/holidays.csv
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
2019-01-01,New Year's Day,tanzania
|
|
2
|
-
2019-01-12,Zanzibar Revolution Day,tanzania
|
|
3
|
-
2019-04-07,The Sheikh Abeid Amani Karume Day,tanzania
|
|
4
|
-
2019-04-17,Easter Monday,tanzania
|
|
5
|
-
2019-04-26,Union Day,tanzania
|
|
6
|
-
2019-05-01,Labour Day,tanzania
|
|
7
|
-
2019-06-26,Eid al-Fitr,tanzania
|
|
8
|
-
2019-07-07,Saba Saba Day,tanzania
|
|
9
|
-
2019-07-14,Good Friday,tanzania
|
|
10
|
-
2019-08-08,Nane Nane Day,tanzania
|
|
11
|
-
2019-10-14,Nyerere Day,tanzania
|
|
12
|
-
2019-12-01,Mawlid Day,tanzania
|
|
13
|
-
2019-12-09,Independence Day,tanzania
|
|
14
|
-
2019-12-25,Christmas Day,tanzania
|
|
15
|
-
2019-12-26,Boxing Day,tanzania
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
from django.core.exceptions import ObjectDoesNotExist
|
|
2
|
-
from django.test import TestCase, override_settings
|
|
3
|
-
from edc_action_item.models import ActionItem
|
|
4
|
-
from edc_adverse_event.constants import (
|
|
5
|
-
AE_FOLLOWUP_ACTION,
|
|
6
|
-
AE_TMG_ACTION,
|
|
7
|
-
DEATH_REPORT_ACTION,
|
|
8
|
-
DEATH_REPORT_TMG_ACTION,
|
|
9
|
-
)
|
|
10
|
-
from edc_constants.constants import CLOSED, GRADE4, GRADE5, NEW
|
|
11
|
-
from model_bakery import baker
|
|
12
|
-
|
|
13
|
-
from meta_screening.tests.meta_test_case_mixin import MetaTestCaseMixin
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class TestActions(MetaTestCaseMixin, TestCase):
|
|
17
|
-
def test_ae_initial_creates_action(self):
|
|
18
|
-
subject_screening = self.get_subject_screening()
|
|
19
|
-
subject_consent = self.get_subject_consent(subject_screening)
|
|
20
|
-
ae_initial = baker.make_recipe(
|
|
21
|
-
"meta_ae.aeinitial", subject_identifier=subject_consent.subject_identifier
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
try:
|
|
25
|
-
action_item = ActionItem.objects.get(
|
|
26
|
-
action_identifier=ae_initial.action_identifier
|
|
27
|
-
)
|
|
28
|
-
except ObjectDoesNotExist:
|
|
29
|
-
self.fail("ObjectDoesNotExist unexpectedly raised.")
|
|
30
|
-
else:
|
|
31
|
-
self.assertEqual(action_item.status, CLOSED)
|
|
32
|
-
self.assertEqual(
|
|
33
|
-
action_item.subject_identifier, subject_consent.subject_identifier
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
def test_ae_initial_creates_ae_followup_action(self):
|
|
37
|
-
subject_screening = self.get_subject_screening()
|
|
38
|
-
subject_consent = self.get_subject_consent(subject_screening)
|
|
39
|
-
ae_initial = baker.make_recipe(
|
|
40
|
-
"meta_ae.aeinitial", subject_identifier=subject_consent.subject_identifier
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
action_item = ActionItem.objects.get(action_identifier=ae_initial.action_identifier)
|
|
44
|
-
try:
|
|
45
|
-
action_item = ActionItem.objects.get(
|
|
46
|
-
parent_action_item=action_item,
|
|
47
|
-
action_type__name=AE_FOLLOWUP_ACTION,
|
|
48
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
49
|
-
)
|
|
50
|
-
except ObjectDoesNotExist:
|
|
51
|
-
self.fail("ObjectDoesNotExist unexpectedly raised.")
|
|
52
|
-
else:
|
|
53
|
-
self.assertEqual(action_item.status, NEW)
|
|
54
|
-
|
|
55
|
-
@override_settings(EDC_RANDOMIZATION_REGISTER_DEFAULT_RANDOMIZER=False)
|
|
56
|
-
def test_ae_initial_G4_creates_ae_tmg_action(self):
|
|
57
|
-
subject_screening = self.get_subject_screening()
|
|
58
|
-
subject_consent = self.get_subject_consent(subject_screening)
|
|
59
|
-
baker.make_recipe(
|
|
60
|
-
"meta_ae.aeinitial",
|
|
61
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
62
|
-
ae_grade=GRADE4,
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
try:
|
|
66
|
-
ActionItem.objects.get(
|
|
67
|
-
action_type__name=AE_TMG_ACTION,
|
|
68
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
69
|
-
)
|
|
70
|
-
except ObjectDoesNotExist:
|
|
71
|
-
self.fail("ObjectDoesNotExist unexpectedly raised.")
|
|
72
|
-
|
|
73
|
-
def test_ae_initial_G5_creates_death_report_action(self):
|
|
74
|
-
subject_screening = self.get_subject_screening()
|
|
75
|
-
subject_consent = self.get_subject_consent(subject_screening)
|
|
76
|
-
baker.make_recipe(
|
|
77
|
-
"meta_ae.aeinitial",
|
|
78
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
79
|
-
ae_grade=GRADE5,
|
|
80
|
-
)
|
|
81
|
-
try:
|
|
82
|
-
ActionItem.objects.get(
|
|
83
|
-
action_type__name=DEATH_REPORT_ACTION,
|
|
84
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
85
|
-
)
|
|
86
|
-
except ObjectDoesNotExist:
|
|
87
|
-
self.fail("ObjectDoesNotExist unexpectedly raised.")
|
|
88
|
-
|
|
89
|
-
self.assertRaises(
|
|
90
|
-
ObjectDoesNotExist,
|
|
91
|
-
ActionItem.objects.get,
|
|
92
|
-
action_type__name=DEATH_REPORT_TMG_ACTION,
|
|
93
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
def test_death_report_create_death_report_tmg_action(self):
|
|
97
|
-
subject_screening = self.get_subject_screening()
|
|
98
|
-
subject_consent = self.get_subject_consent(subject_screening)
|
|
99
|
-
baker.make_recipe(
|
|
100
|
-
"meta_ae.aeinitial",
|
|
101
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
102
|
-
ae_grade=GRADE5,
|
|
103
|
-
)
|
|
104
|
-
action_item = ActionItem.objects.get(
|
|
105
|
-
action_type__name=DEATH_REPORT_ACTION,
|
|
106
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
baker.make_recipe(
|
|
110
|
-
"meta_ae.deathreport",
|
|
111
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
112
|
-
action_identifier=action_item.action_identifier,
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
action_item.refresh_from_db()
|
|
116
|
-
self.assertEqual(action_item.status, CLOSED)
|
|
117
|
-
|
|
118
|
-
try:
|
|
119
|
-
action_item = ActionItem.objects.get(
|
|
120
|
-
action_type__name=DEATH_REPORT_TMG_ACTION,
|
|
121
|
-
subject_identifier=subject_consent.subject_identifier,
|
|
122
|
-
)
|
|
123
|
-
except ObjectDoesNotExist:
|
|
124
|
-
self.fail("ObjectDoesNotExist unexpectedly raised.")
|
|
125
|
-
else:
|
|
126
|
-
self.assertEqual(action_item.status, NEW)
|
meta_ae/tests/urls.py
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
from django.contrib import admin
|
|
2
|
-
from django.urls.conf import include, path
|
|
3
|
-
|
|
4
|
-
from meta_ae.admin_site import meta_ae_admin
|
|
5
|
-
|
|
6
|
-
urlpatterns = [
|
|
7
|
-
path("ae/", include("meta_ae.urls")),
|
|
8
|
-
path("admin/", meta_ae_admin.urls),
|
|
9
|
-
path("admin/", admin.site.urls),
|
|
10
|
-
]
|
|
File without changes
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "code",
|
|
5
|
-
"execution_count": null,
|
|
6
|
-
"id": "0",
|
|
7
|
-
"metadata": {},
|
|
8
|
-
"outputs": [],
|
|
9
|
-
"source": [
|
|
10
|
-
"%%capture\n",
|
|
11
|
-
"import pandas as pd\n",
|
|
12
|
-
"from django_pandas.io import read_frame\n",
|
|
13
|
-
"from pathlib import Path\n",
|
|
14
|
-
"from dj_notebook import activate\n",
|
|
15
|
-
"\n",
|
|
16
|
-
"plus = activate(dotenv_file=\"/Users/erikvw/source/edc_source/meta-edc/.env\")\n",
|
|
17
|
-
"report_folder = Path(\"/Users/erikvw/Documents/ucl/protocols/meta3/reports/\")\n",
|
|
18
|
-
"# output is suppressed -- normally would spew out all the edc loading messages\n"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"cell_type": "code",
|
|
23
|
-
"execution_count": null,
|
|
24
|
-
"id": "1",
|
|
25
|
-
"metadata": {},
|
|
26
|
-
"outputs": [],
|
|
27
|
-
"source": [
|
|
28
|
-
"from edc_pdutils.dataframes import get_crf\n",
|
|
29
|
-
"\n",
|
|
30
|
-
"df_patient_history = get_crf(model=\"meta_subject.patienthistory\", subject_visit_model=\"meta_subject.subjectvisit\")"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"cell_type": "code",
|
|
35
|
-
"execution_count": null,
|
|
36
|
-
"id": "2",
|
|
37
|
-
"metadata": {},
|
|
38
|
-
"outputs": [],
|
|
39
|
-
"source": [
|
|
40
|
-
"df_blood_results_rft = get_crf(model=\"meta_subject.bloodresultsrft\", subject_visit_model=\"meta_subject.subjectvisit\")\n"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"cell_type": "code",
|
|
45
|
-
"execution_count": null,
|
|
46
|
-
"id": "3",
|
|
47
|
-
"metadata": {},
|
|
48
|
-
"outputs": [],
|
|
49
|
-
"source": [
|
|
50
|
-
"df_patient_history.to_csv(Path(\"/Users/erikvw/Documents/ucl/protocols/meta3/analysis/\") / \"patient_history.csv\")"
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"cell_type": "code",
|
|
55
|
-
"execution_count": null,
|
|
56
|
-
"id": "4",
|
|
57
|
-
"metadata": {},
|
|
58
|
-
"outputs": [],
|
|
59
|
-
"source": [
|
|
60
|
-
"df_blood_results_rft.to_csv(Path(\"/Users/erikvw/Documents/ucl/protocols/meta3/analysis/\") / \"bllod_results_rft.csv\")"
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"cell_type": "code",
|
|
65
|
-
"execution_count": null,
|
|
66
|
-
"id": "5",
|
|
67
|
-
"metadata": {},
|
|
68
|
-
"outputs": [],
|
|
69
|
-
"source": [
|
|
70
|
-
"df_visit ="
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
"metadata": {
|
|
75
|
-
"kernelspec": {
|
|
76
|
-
"display_name": "Python 3",
|
|
77
|
-
"language": "python",
|
|
78
|
-
"name": "python3"
|
|
79
|
-
},
|
|
80
|
-
"language_info": {
|
|
81
|
-
"codemirror_mode": {
|
|
82
|
-
"name": "ipython",
|
|
83
|
-
"version": 2
|
|
84
|
-
},
|
|
85
|
-
"file_extension": ".py",
|
|
86
|
-
"mimetype": "text/x-python",
|
|
87
|
-
"name": "python",
|
|
88
|
-
"nbconvert_exporter": "python",
|
|
89
|
-
"pygments_lexer": "ipython2",
|
|
90
|
-
"version": "2.7.6"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"nbformat": 4,
|
|
94
|
-
"nbformat_minor": 5
|
|
95
|
-
}
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "code",
|
|
5
|
-
"execution_count": null,
|
|
6
|
-
"id": "0",
|
|
7
|
-
"metadata": {},
|
|
8
|
-
"outputs": [],
|
|
9
|
-
"source": [
|
|
10
|
-
"%%capture\n",
|
|
11
|
-
"import os\n",
|
|
12
|
-
"from pathlib import Path\n",
|
|
13
|
-
"import pandas as pd\n",
|
|
14
|
-
"from dj_notebook import activate\n",
|
|
15
|
-
"import numpy as np\n",
|
|
16
|
-
"from django_pandas.io import read_frame\n",
|
|
17
|
-
"\n",
|
|
18
|
-
"env_file = os.environ[\"META_ENV\"]\n",
|
|
19
|
-
"reports_folder = Path(os.environ[\"META_REPORTS_FOLDER\"])\n",
|
|
20
|
-
"analysis_folder = Path(os.environ[\"META_ANALYSIS_FOLDER\"])\n",
|
|
21
|
-
"pharmacy_folder = Path(os.environ[\"META_PHARMACY_FOLDER\"])\n",
|
|
22
|
-
"plus = activate(dotenv_file=env_file)\n",
|
|
23
|
-
"pd.set_option('future.no_silent_downcasting', True)"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"cell_type": "code",
|
|
28
|
-
"execution_count": null,
|
|
29
|
-
"id": "1",
|
|
30
|
-
"metadata": {},
|
|
31
|
-
"outputs": [],
|
|
32
|
-
"source": [
|
|
33
|
-
"import pdfkit\n",
|
|
34
|
-
"from datetime import date\n",
|
|
35
|
-
"from edc_pdutils.dataframes import get_subject_visit\n",
|
|
36
|
-
"from meta_analytics.dataframes import get_glucose_fbg_ogtt_df, get_glucose_fbg_df\n",
|
|
37
|
-
"from meta_visit_schedule.constants import MONTH15, MONTH18, MONTH21, MONTH27, MONTH30, MONTH33, MONTH39\n",
|
|
38
|
-
"from meta_analytics.dataframes import GlucoseEndpointsByDate\n",
|
|
39
|
-
"from scipy.stats import chi2\n",
|
|
40
|
-
"from great_tables import loc, style, md\n",
|
|
41
|
-
"from meta_analytics.dataframes import get_eos_df\n",
|
|
42
|
-
"from meta_analytics.utils import df_as_great_table, df_as_great_table2\n",
|
|
43
|
-
"from meta_prn.models import LossToFollowup\n",
|
|
44
|
-
"from edc_visit_schedule.models import SubjectScheduleHistory\n",
|
|
45
|
-
"from edc_appointment.analytics import get_appointment_df\n",
|
|
46
|
-
"from edc_appointment.constants import NEW_APPT, CANCELLED_APPT, ONTIME_APPT, MISSED_APPT, SCHEDULED_APPT, COMPLETE_APPT, INCOMPLETE_APPT, IN_PROGRESS_APPT, UNSCHEDULED_APPT\n",
|
|
47
|
-
"from edc_constants.constants import YES\n",
|
|
48
|
-
"from meta_consent.models import SubjectConsentV1Ext"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"cell_type": "code",
|
|
53
|
-
"execution_count": null,
|
|
54
|
-
"id": "2",
|
|
55
|
-
"metadata": {},
|
|
56
|
-
"outputs": [],
|
|
57
|
-
"source": [
|
|
58
|
-
"html_data = []\n",
|
|
59
|
-
"cutoff_date = date(2025,3, 31)\n",
|
|
60
|
-
"end_of_trial_date= date(2026,3, 1)\n",
|
|
61
|
-
"document_title = f\"<h2>Monitoring Report: {cutoff_date.strftime('%B %Y')}</h2><h5>Data Download: {cutoff_date.strftime('%d %B %Y')}</h5>\"\n",
|
|
62
|
-
"study_title = 'META3 - Metformin treatment for diabetes prevention in Africa'\n",
|
|
63
|
-
"pdf_filename = f\"monitoring_report_{cutoff_date.strftime('%Y%m%d')}.pdf\"\n",
|
|
64
|
-
"\n",
|
|
65
|
-
"column_headers = {\"appt_datetime\": \"Appointment\", \"year\": \"Year\", \"month\": \"Month\", \"10\": \"Hindu Mandal\", \"20\": \"Amana\", \"30\": \"Temeke\", \"40\": \"Mwananyamala\", \"60\": \"Mnazi Moja\", \"total\": \"Total\"}\n",
|
|
66
|
-
"\n"
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"cell_type": "code",
|
|
71
|
-
"execution_count": null,
|
|
72
|
-
"id": "3",
|
|
73
|
-
"metadata": {},
|
|
74
|
-
"outputs": [],
|
|
75
|
-
"source": [
|
|
76
|
-
"df_visit = get_subject_visit(\"meta_subject.subjectvisit\")\n",
|
|
77
|
-
"df_visit = df_visit[df_visit.appt_datetime.dt.date<=cutoff_date]\n",
|
|
78
|
-
"df_appointments = get_appointment_df()\n",
|
|
79
|
-
"df_appointments[\"site_id\"] = df_appointments.site_id.astype(str)\n",
|
|
80
|
-
"cls = GlucoseEndpointsByDate()\n",
|
|
81
|
-
"cls.run()\n",
|
|
82
|
-
"df_endpoint = cls.endpoint_only_df.copy()\n",
|
|
83
|
-
"df_glucose = get_glucose_fbg_ogtt_df()\n",
|
|
84
|
-
"df_glucose_fbg = get_glucose_fbg_df()\n",
|
|
85
|
-
"df_glucose = pd.concat([df_glucose, df_glucose_fbg])\n",
|
|
86
|
-
"\n",
|
|
87
|
-
"enrolled = df_visit.copy()\n",
|
|
88
|
-
"enrolled[\"site_id\"] = enrolled[\"site_id\"].astype(str)\n",
|
|
89
|
-
"enrolled_pivot = (\n",
|
|
90
|
-
" enrolled\n",
|
|
91
|
-
" .query(\"visit_code==1000.0\").groupby([\"site_id\"])\n",
|
|
92
|
-
" .size()\n",
|
|
93
|
-
" .reset_index()\n",
|
|
94
|
-
" .pivot_table(columns=\"site_id\", values=0, observed=True)\n",
|
|
95
|
-
")\n",
|
|
96
|
-
"enrolled_pivot.columns.name=\"\"\n",
|
|
97
|
-
"enrolled_pivot[\"total\"] = enrolled_pivot[[\"10\", \"20\",\"30\",\"40\",\"60\"]].sum(axis=1)\n",
|
|
98
|
-
"\n"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"cell_type": "code",
|
|
103
|
-
"execution_count": null,
|
|
104
|
-
"id": "4",
|
|
105
|
-
"metadata": {},
|
|
106
|
-
"outputs": [],
|
|
107
|
-
"source": [
|
|
108
|
-
"# Table 1f Future scheduled appointments per month\n",
|
|
109
|
-
"df_appt_pivot = (\n",
|
|
110
|
-
" # df_appointments.query(\"appt_datetime<=@cutoff_date and appt_reason==@SCHEDULED_APPT and appt_timing==@ONTIME_APPT and ~appt_status.isin([@NEW_APPT])\")\n",
|
|
111
|
-
" df_appointments.query(\"@cutoff_date<=appt_datetime<=@end_of_trial_date and appt_reason==@SCHEDULED_APPT and appt_timing==@ONTIME_APPT and appt_status.isin([@NEW_APPT])\")\n",
|
|
112
|
-
" .set_index(\"appt_datetime\")\n",
|
|
113
|
-
" .groupby(by=[\"site_id\", pd.Grouper(freq=\"ME\")])\n",
|
|
114
|
-
" .size()\n",
|
|
115
|
-
" .to_frame()\n",
|
|
116
|
-
" .reset_index()\n",
|
|
117
|
-
" .rename(columns={0:\"patients\"})\n",
|
|
118
|
-
" .pivot(index=\"appt_datetime\", columns=\"site_id\", values=\"patients\")\n",
|
|
119
|
-
" .reset_index()\n",
|
|
120
|
-
" .fillna(0)\n",
|
|
121
|
-
")\n",
|
|
122
|
-
"\n",
|
|
123
|
-
"df_appt_pivot.columns.name = None\n",
|
|
124
|
-
"df_appt_pivot[\"total\"] = df_appt_pivot.iloc[:,1:].sum(axis=1)\n",
|
|
125
|
-
"df_appt_pivot[\"appt_datetime\"] = df_appt_pivot.appt_datetime.dt.strftime(\"%Y-%m\")\n",
|
|
126
|
-
"sum_row = df_appt_pivot.select_dtypes(include='float64').sum()\n",
|
|
127
|
-
"sum_row['appt_datetime'] = 'Total-'\n",
|
|
128
|
-
"sum_row_df = pd.DataFrame(sum_row).T\n",
|
|
129
|
-
"df_appt_pivot = pd.concat([df_appt_pivot, sum_row_df], axis=0)\n",
|
|
130
|
-
"df_appt_pivot[[\"year\", \"month\"]] = df_appt_pivot[\"appt_datetime\"].str.split(\"-\", expand=True)\n",
|
|
131
|
-
"\n",
|
|
132
|
-
"df_appt_pivot2 = (\n",
|
|
133
|
-
" # df_appointments.query(\"appt_datetime<=@cutoff_date and appt_reason==@SCHEDULED_APPT and appt_timing==@ONTIME_APPT and ~appt_status.isin([@NEW_APPT])\")\n",
|
|
134
|
-
" df_appointments.query(\"@cutoff_date<=appt_datetime<=@end_of_trial_date and appt_reason==@SCHEDULED_APPT and appt_timing==@ONTIME_APPT and appt_status.isin([@NEW_APPT])\")\n",
|
|
135
|
-
" .set_index(\"visit_code\")\n",
|
|
136
|
-
" .groupby(by=[\"site_id\", \"visit_code\"])\n",
|
|
137
|
-
" .agg([\"last\"])\n",
|
|
138
|
-
" .size()\n",
|
|
139
|
-
" .to_frame()\n",
|
|
140
|
-
" .reset_index()\n",
|
|
141
|
-
" .rename(columns={0:\"patients\"})\n",
|
|
142
|
-
" .pivot(index=\"visit_code\", columns=\"site_id\", values=\"patients\")\n",
|
|
143
|
-
" .reset_index()\n",
|
|
144
|
-
" .fillna(0)\n",
|
|
145
|
-
")\n",
|
|
146
|
-
"\n",
|
|
147
|
-
"df_appt_pivot2.columns.name = None\n",
|
|
148
|
-
"df_appt_pivot2[\"total\"] = df_appt_pivot2.iloc[:,1:].sum(axis=1)\n",
|
|
149
|
-
"df_appt_pivot2[\"visit_code\"] = df_appt_pivot2.visit_code.astype(str)\n",
|
|
150
|
-
"sum_row = df_appt_pivot2.select_dtypes(include='float64').sum()\n",
|
|
151
|
-
"sum_row['visit_code'] = 'Total-'\n",
|
|
152
|
-
"sum_row_df = pd.DataFrame(sum_row).T\n",
|
|
153
|
-
"df_appt_pivot2 = pd.concat([df_appt_pivot2, sum_row_df], axis=0)\n",
|
|
154
|
-
"\n",
|
|
155
|
-
"# df_appt_pivot2[[\"year\", \"month\"]] = df_appt_pivot2[\"appt_datetime\"].str.split(\"-\", expand=True)\n",
|
|
156
|
-
"\n",
|
|
157
|
-
"\n",
|
|
158
|
-
"df_appt_pivot2"
|
|
159
|
-
]
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"cell_type": "code",
|
|
163
|
-
"execution_count": null,
|
|
164
|
-
"id": "5",
|
|
165
|
-
"metadata": {},
|
|
166
|
-
"outputs": [],
|
|
167
|
-
"source": [
|
|
168
|
-
"def get_df_appt(criteria:str):\n",
|
|
169
|
-
" df_appt = (\n",
|
|
170
|
-
" df_appointments.query(\"@cutoff_date<=appt_datetime<=@end_of_trial_date and appt_reason==@SCHEDULED_APPT and appt_timing==@ONTIME_APPT and appt_status.isin([@NEW_APPT]) and visit_code<2000.0\")\n",
|
|
171
|
-
" .groupby([\"site_id\", \"appt_datetime\"])\n",
|
|
172
|
-
" .agg(\"last\")\n",
|
|
173
|
-
" .reset_index()\n",
|
|
174
|
-
" .query(criteria)\n",
|
|
175
|
-
" .set_index(\"appt_datetime\")\n",
|
|
176
|
-
" .groupby(by=[\"site_id\", pd.Grouper(freq=\"ME\")])\n",
|
|
177
|
-
" .size()\n",
|
|
178
|
-
" .to_frame()\n",
|
|
179
|
-
" .reset_index()\n",
|
|
180
|
-
" .rename(columns={0:\"patients\"})\n",
|
|
181
|
-
" .pivot(index=\"appt_datetime\", columns=\"site_id\", values=\"patients\")\n",
|
|
182
|
-
" .reset_index()\n",
|
|
183
|
-
" .fillna(0)\n",
|
|
184
|
-
" )\n",
|
|
185
|
-
" df_appt.columns.name = None\n",
|
|
186
|
-
" df_appt[\"total\"] = df_appt.iloc[:,1:].sum(axis=1)\n",
|
|
187
|
-
" sum_row = df_appt.select_dtypes(include='float64').sum()\n",
|
|
188
|
-
" sum_row_df = pd.DataFrame(sum_row).T\n",
|
|
189
|
-
" df_appt = pd.concat([df_appt, sum_row_df], axis=0)\n",
|
|
190
|
-
" df_appt[\"appt_datetime\"] = df_appt.appt_datetime.dt.strftime(\"%Y-%m\")\n",
|
|
191
|
-
" df_appt[[\"year\", \"month\"]] = df_appt[\"appt_datetime\"].str.split(\"-\", expand=True)\n",
|
|
192
|
-
" df_appt[\"year\"] = df_appt[\"year\"].fillna(\"Total\")\n",
|
|
193
|
-
" return df_appt\n",
|
|
194
|
-
"\n",
|
|
195
|
-
"\n",
|
|
196
|
-
"gt = df_as_great_table2(\n",
|
|
197
|
-
" get_df_appt(criteria=\"visit_code.isin([1360.0, 1480.0])\"),\n",
|
|
198
|
-
" title=\"Table 1f: Participants who will complete followup on 1360 or 1480 before 2026-03-01\",\n",
|
|
199
|
-
" # subtitle=\"Visit codes 1360 or 1480 only\",\n",
|
|
200
|
-
" rowname_col=\"month\",\n",
|
|
201
|
-
" groupname_col=\"year\",\n",
|
|
202
|
-
")\n",
|
|
203
|
-
"gt = (\n",
|
|
204
|
-
" gt\n",
|
|
205
|
-
" .cols_label({k:v for k, v in column_headers.items() if k!=\"label\"})\n",
|
|
206
|
-
" .cols_align(align=\"center\", columns=[\"appt_datetime\", \"10\", \"20\", \"30\", \"40\", \"60\", \"total\"])\n",
|
|
207
|
-
" .cols_align(align=\"left\", columns=[\"month\", \"year\"])\n",
|
|
208
|
-
" .fmt_number(columns=[\"10\", \"20\", \"30\", \"40\", \"60\", \"total\"], decimals=0)\n",
|
|
209
|
-
" .tab_source_note(source_note=f\"Scheduled appointment date is on or after {cutoff_date.strftime('%d %B %Y')} and before {end_of_trial_date.strftime('%d %B %Y')}.\")\n",
|
|
210
|
-
" .tab_style(\n",
|
|
211
|
-
" style=[\n",
|
|
212
|
-
" style.text(color=\"black\", weight=\"bold\"),\n",
|
|
213
|
-
" style.fill(color=\"lightgray\")\n",
|
|
214
|
-
" ],\n",
|
|
215
|
-
" locations=loc.row_groups()\n",
|
|
216
|
-
" )\n",
|
|
217
|
-
")\n",
|
|
218
|
-
"html_data.append(gt.as_raw_html())\n",
|
|
219
|
-
"gt.show()"
|
|
220
|
-
]
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"cell_type": "code",
|
|
224
|
-
"execution_count": null,
|
|
225
|
-
"id": "6",
|
|
226
|
-
"metadata": {},
|
|
227
|
-
"outputs": [],
|
|
228
|
-
"source": [
|
|
229
|
-
"\n",
|
|
230
|
-
"gt = df_as_great_table2(\n",
|
|
231
|
-
" get_df_appt(criteria=\"~visit_code.isin([1360.0, 1480.0])\"),\n",
|
|
232
|
-
" title=\"Table 1f: Participants who will NOT complete followup on 1360 or 1480 before 2026-03-01\",\n",
|
|
233
|
-
" rowname_col=\"month\",\n",
|
|
234
|
-
" groupname_col=\"year\",\n",
|
|
235
|
-
")\n",
|
|
236
|
-
"gt = (\n",
|
|
237
|
-
" gt\n",
|
|
238
|
-
" .cols_label({k:v for k, v in column_headers.items() if k!=\"label\"})\n",
|
|
239
|
-
" .cols_align(align=\"center\", columns=[\"appt_datetime\", \"10\", \"20\", \"30\", \"40\", \"60\", \"total\"])\n",
|
|
240
|
-
" .cols_align(align=\"left\", columns=[\"month\", \"year\"])\n",
|
|
241
|
-
" .fmt_number(columns=[\"10\", \"20\", \"30\", \"40\", \"60\", \"total\"], decimals=0)\n",
|
|
242
|
-
" .tab_source_note(source_note=f\"Scheduled appointment date is on or after {cutoff_date.strftime('%d %B %Y')} and before {end_of_trial_date.strftime('%d %B %Y')}.\")\n",
|
|
243
|
-
" .tab_style(\n",
|
|
244
|
-
" style=[\n",
|
|
245
|
-
" style.text(color=\"black\", weight=\"bold\"),\n",
|
|
246
|
-
" style.fill(color=\"lightgray\")\n",
|
|
247
|
-
" ],\n",
|
|
248
|
-
" locations=loc.row_groups()\n",
|
|
249
|
-
" )\n",
|
|
250
|
-
")\n",
|
|
251
|
-
"html_data.append(gt.as_raw_html())\n",
|
|
252
|
-
"gt.show()"
|
|
253
|
-
]
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"cell_type": "code",
|
|
257
|
-
"execution_count": null,
|
|
258
|
-
"id": "7",
|
|
259
|
-
"metadata": {},
|
|
260
|
-
"outputs": [],
|
|
261
|
-
"source": [
|
|
262
|
-
"# gather raw html\n",
|
|
263
|
-
"raw_html = [f'<div class=\"page-break\">{s}</div>' for s in html_data]\n",
|
|
264
|
-
"style_css = \"\"\"\n",
|
|
265
|
-
"<style>\n",
|
|
266
|
-
" .page-break {\n",
|
|
267
|
-
" page-break-inside: avoid; /* Always add page break before this element */\n",
|
|
268
|
-
" }\n",
|
|
269
|
-
" .table-header {\n",
|
|
270
|
-
" font-weight: bold;\n",
|
|
271
|
-
" font-size: 18px;\n",
|
|
272
|
-
" text-align: center;\n",
|
|
273
|
-
" border-bottom: None;\n",
|
|
274
|
-
" }\n",
|
|
275
|
-
"</style>\n",
|
|
276
|
-
"\"\"\"\n",
|
|
277
|
-
"raw_html = ''.join(raw_html)\n",
|
|
278
|
-
"raw_html = f'<!DOCTYPE html>\\n<html lang=\"en\">\\n{style_css}\\n<head>\\n<meta charset=\"utf-8\"/>\\n</head>\\n<body>\\n' + document_title + raw_html + '\\n</body>\\n</html>\\n'"
|
|
279
|
-
]
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
"cell_type": "code",
|
|
283
|
-
"execution_count": null,
|
|
284
|
-
"id": "8",
|
|
285
|
-
"metadata": {},
|
|
286
|
-
"outputs": [],
|
|
287
|
-
"source": [
|
|
288
|
-
"pdfkit.from_string(raw_html, str(analysis_folder / pdf_filename),\n",
|
|
289
|
-
"options={\n",
|
|
290
|
-
" 'footer-center': 'Page [page] of [topage]',\n",
|
|
291
|
-
" 'footer-font-size': '8',\n",
|
|
292
|
-
" 'footer-spacing': '5',\n",
|
|
293
|
-
" 'encoding': \"UTF-8\",\n",
|
|
294
|
-
" 'margin-top':'10mm',\n",
|
|
295
|
-
" 'margin-right':'15mm',\n",
|
|
296
|
-
" 'margin-bottom':'15mm',\n",
|
|
297
|
-
" 'margin-left':'15mm',\n",
|
|
298
|
-
" 'header-center': study_title,\n",
|
|
299
|
-
" 'header-font-size': '6',\n",
|
|
300
|
-
" 'header-spacing': '0',\n",
|
|
301
|
-
" 'disable-javascript': None,\n",
|
|
302
|
-
" 'no-outline': None,\n",
|
|
303
|
-
"},\n",
|
|
304
|
-
"verbose=True)"
|
|
305
|
-
]
|
|
306
|
-
}
|
|
307
|
-
],
|
|
308
|
-
"metadata": {
|
|
309
|
-
"kernelspec": {
|
|
310
|
-
"display_name": "Python 3",
|
|
311
|
-
"language": "python",
|
|
312
|
-
"name": "python3"
|
|
313
|
-
},
|
|
314
|
-
"language_info": {
|
|
315
|
-
"codemirror_mode": {
|
|
316
|
-
"name": "ipython",
|
|
317
|
-
"version": 2
|
|
318
|
-
},
|
|
319
|
-
"file_extension": ".py",
|
|
320
|
-
"mimetype": "text/x-python",
|
|
321
|
-
"name": "python",
|
|
322
|
-
"nbconvert_exporter": "python",
|
|
323
|
-
"pygments_lexer": "ipython2",
|
|
324
|
-
"version": "2.7.6"
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
"nbformat": 4,
|
|
328
|
-
"nbformat_minor": 5
|
|
329
|
-
}
|