Skip to content

Commit 83f47ee

Browse files
committed
enh: program_ID retrocompatability with group_ID
1 parent d5c5c1e commit 83f47ee

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/clinical_dbs_annotator/utils/longitudinal_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ def _create_lateral_table(self, df: pd.DataFrame) -> pd.DataFrame:
11111111
"_global_entry_id": entry_id,
11121112
"source": source_label,
11131113
"date": date_val,
1114-
"program_ID": first.get("program_ID", ""),
1114+
"program_ID": first.get("program_ID") or first.get("group_ID", ""),
11151115
"scale_name": combined_sn,
11161116
"scale_value": combined_sv,
11171117
"notes": first.get("notes", ""),

src/clinical_dbs_annotator/utils/session_exporter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,16 @@ def _create_lateral_table_data(self, df):
501501
right_row["block_id"] = block_id
502502

503503
# Common columns (non-lateral) - use combined scales with internal lines
504-
left_row["group_ID"] = first_row.get("group_ID", "")
504+
left_row["program_ID"] = first_row.get("program_ID") or first_row.get(
505+
"group_ID", ""
506+
)
505507
left_row["scale_name"] = combined_scale_name
506508
left_row["scale_value"] = combined_scale_value
507509
left_row["notes"] = first_row.get("notes", "")
508510

509-
right_row["group_ID"] = first_row.get("group_ID", "")
511+
right_row["program_ID"] = first_row.get("program_ID") or first_row.get(
512+
"group_ID", ""
513+
)
510514
right_row["scale_name"] = combined_scale_name
511515
right_row["scale_value"] = combined_scale_value
512516
right_row["notes"] = first_row.get("notes", "")

src/clinical_dbs_annotator/views/step1_view.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,8 +1266,10 @@ def _load_existing_file(self, file_path: str) -> None:
12661266
except Exception:
12671267
pass
12681268

1269-
# Load program
1270-
program_val = latest_initial.get("program_ID", None)
1269+
# Load program (backward compatibility: use group_ID if program_ID not present)
1270+
program_val = latest_initial.get("program_ID") or latest_initial.get(
1271+
"group_ID"
1272+
)
12711273
if program_val not in (None, "") and hasattr(self, "group_combo"):
12721274
try:
12731275
self.group_combo.setCurrentText(str(program_val))

0 commit comments

Comments
 (0)