diff --git a/eb_dashboard.py b/eb_dashboard.py index 06ea788..def8e73 100644 --- a/eb_dashboard.py +++ b/eb_dashboard.py @@ -149,7 +149,7 @@ _user_interaction_lock = threading.Lock() # Global variables (mutable, set at runtime - not constants) inclusions_mapping_config = [] organizations_mapping_config = [] -_exclude_drafts = False # Set by --exclude-drafts CLI arg if provided +_include_drafts = False # Set by --include-drafts CLI arg if provided excel_export_config = None excel_export_enabled = False @@ -184,10 +184,10 @@ if "--config" in sys.argv: else: set_dashboard_config_path_override(os.path.join(get_config_path(), _raw_config_path)) -# Handle --exclude-drafts flag (remove from sys.argv to preserve positional args) -_exclude_drafts = "--exclude-drafts" in sys.argv -if _exclude_drafts: - sys.argv.remove("--exclude-drafts") +# Handle --include-drafts flag (remove from sys.argv to preserve positional args) +_include_drafts = "--include-drafts" in sys.argv +if _include_drafts: + sys.argv.remove("--include-drafts") # --- Progress Bar Configuration --- # NOTE: BAR_N_FMT_WIDTH, BAR_TOTAL_FMT_WIDTH, BAR_TIME_WIDTH, BAR_RATE_WIDTH @@ -1258,8 +1258,8 @@ def get_all_questionnaires_by_patient(patient_id, record_data): # ── DRAFT ANSWERS FILTER ──────────────────────────────────────────────── # "Draft" answers have a missing or mismatched subject (patient id): # they are not yet submitted and should not be treated as valid patient data. - # Activated via --exclude-drafts CLI flag. - if _exclude_drafts: + # Active by default; use --include-drafts CLI flag to disable. + if not _include_drafts: answers_patient = answers.get("subject") if isinstance(answers, dict) else None if not answers_patient or answers_patient != patient_id: answers = {}