v1
Scan filter step v1.
Module
Submodules
- bitfount.steps.scan_filter.v1.config - Config for the scan filter step (v1).
- bitfount.steps.scan_filter.v1.result - Result for the scan filter step (v1).
- bitfount.steps.scan_filter.v1.task - Prefect task for the scan_filter step.
Functions
task_fn
def task_fn( datasource: BaseSource, config: ScanFilterConfig, filenames: list[str],) ‑> ScanFilterResult:Filter the input file list down to the latest scan per patient.
Arguments
datasource: The datasource providing per-file metadata (date and patient identifier columns) used by the "latest" strategy.config: Scan filter configuration.filenames: List of file IDs to filter (typically wired from$file_metadata.cache).
Returns
ScanFilterResult with the filtered filenames.
An invalid strategy is rejected up-front by ScanFilterConfig
(pydantic), so the strategy here is always a valid ScanFilterStrategy.
Classes
Config
class Config(**data: Any):Config for the scan filter step.
All fields are required — defaults are provided by the YAML template.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Variables
- static
date_column : str
- static
id_columns : list[str]
- static
model_config
- static
num_latest : int
- static
strategy : ScanFilterStrategy
Result
class Result(**data: Any):Result of a scan filter task.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.