Refine registration workspace controls
This commit is contained in:
@@ -468,6 +468,7 @@ def cases(
|
||||
q: str = "",
|
||||
status_filter: str = Query(default="", alias="status"),
|
||||
body_part: str = "",
|
||||
algorithm_model: str = "",
|
||||
limit: int = Query(default=120, ge=1, le=400),
|
||||
_: str = Depends(require_auth),
|
||||
) -> list[dict[str, Any]]:
|
||||
@@ -492,6 +493,8 @@ def cases(
|
||||
clauses.append(f"registration_status = {sql_literal(status_filter)}")
|
||||
if body_part in {"head_neck", "chest", "upper_abdomen", "lower_abdomen", "pelvis"}:
|
||||
clauses.append(f"body_part_keys ? {sql_literal(body_part)}")
|
||||
if algorithm_model.strip():
|
||||
clauses.append(f"algorithm_model ILIKE {sql_literal('%' + algorithm_model.strip().replace('%', '').replace('_', '') + '%')}")
|
||||
where_sql = "WHERE " + " AND ".join(clauses) if clauses else ""
|
||||
return pg_json_rows(
|
||||
f"""
|
||||
|
||||
Reference in New Issue
Block a user