Repository navigation
Add subject include-list support to search_specs query mode - #121
Merged
Merged
Conversation
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add subject include list for DICOM search specs
Add subject include-list support to search_specs query mode
Oct 2, 2026
Member
|
@copilot: works great - but upon reflection this config field should be named "select" instead of "subjects", and the "subject_query_field" can be called "select_from_field". Also make the default select_from_field to be "patient_name" instead of "patient_id". Make those changes throughout. |
akhanf
marked this pull request as ready for review
October 2, 2026 16:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DICOM queries previously required one explicit
dicom_queryblock per search (date range, study description, etc.), with no way to target a known list of subjects while excluding everything else — and PACS can't be queried for multiple subjects in a single request.Query expansion
expand_search_specs()inworkflow/lib/query_filter.py: detects aselectkey on a search spec and expands it into one explicit per-subjectdicom_query, merging shared filters with the subject ID underpatient_id(configurable viasubject_query_field).query_dicoms()now runs expansion first, so each subject is queried individually and results are concatenated as before — downstream behavior is unchanged.Backward compatibility
selectpass through untouched; select-list specs can be freely mixed with legacy explicit-query specs in the samesearch_specslist.Validation
ValueErrorwith clear messages for missing/non-list/emptyselect, and for blank or non-string select entries.Docs & tests
README.mdandconfig/config.ymlwith an example of the new mode.select_from_fieldoverride, mixed specs, and all validation error paths.Example config:
This expands internally into three per-subject queries (each with
patient_name: SUBJ00Nmerged intodicom_query), with results concatenated into a single study list.