Skip to content

Query

DIMSE-C C-FIND Service

Module for querying a DICOM SCU using the C-FIND service.

Classes:

Name Description
DicomStatus
QueryError

Query exception

QueryPacs

Class to perform the actual query.

Functions:

Name Description
get_date_query

Convert one of two datetime.date objects to a DICOM compatible date range.

DicomStatus

Bases: Enum

DICOM C-FIND status codes

Attributes:

Name Type Description
CANCEL

Matching terminated due to Cancel request

DATASET_DOES_NOT_MATCH_SOP_CLASS

Error Data Set does not match SOP Class

OUT_OF_RESOURCES

Refused Out of resources

PENDING_0

Matches are continuing - Current Match is supplied and any

PENDING_1

Matches are continuing - Warning that one or more

SOP_CLASS_NOT_SUPPORTED

Refused SOP Class not supported

SUCCESS

Matching is complete - No final Identifier is supplied.

UNABLE_TO_PROCESS

Failed Unable to process

UNKNOWN

Unknown

CANCEL

CANCEL = 65024

Matching terminated due to Cancel request

DATASET_DOES_NOT_MATCH_SOP_CLASS

DATASET_DOES_NOT_MATCH_SOP_CLASS = 43264

Error Data Set does not match SOP Class

OUT_OF_RESOURCES

OUT_OF_RESOURCES = 42752

Refused Out of resources

PENDING_0

PENDING_0 = 65280

Matches are continuing - Current Match is supplied and any Optional Keys were supported in the same manner as Required Keys.

PENDING_1

PENDING_1 = 65281

Matches are continuing - Warning that one or more Optional Keys were not supported for existence for this Identifier.

SOP_CLASS_NOT_SUPPORTED

SOP_CLASS_NOT_SUPPORTED = 290

Refused SOP Class not supported

SUCCESS

SUCCESS = 0

Matching is complete - No final Identifier is supplied.

UNABLE_TO_PROCESS

UNABLE_TO_PROCESS = 49152

Failed Unable to process

UNKNOWN

UNKNOWN = 4660

Unknown

QueryError

QueryError(response: Dataset)

Bases: Exception

Query exception

QueryPacs

QueryPacs(pacs_config: PacsConfig)

Class to perform the actual query.

Methods:

Name Description
get_modalities_for_accession_number

Get modalities for matching the 'accession_number' in the search_terms.

get_series

Get the series matching the search_terms.

get_series_for_study

Get the series for 'study_uid', filtered by modalities (if specified).

get_studies

Get the studies matching the search_terms.

get_studies_for_patient

Get all studies matching the 'pat_name' in the search_terms.

get_study

Get the single study for the 'study_uid'.

get_modalities_for_accession_number

get_modalities_for_accession_number(
    search_terms: SearchTerms,
) -> list[str]

Get modalities for matching the 'accession_number' in the search_terms.

get_series

get_series(search_terms: SearchTerms) -> list[SeriesData]

Get the series matching the search_terms.

get_series_for_study

get_series_for_study(
    study_uid: str | UID,
    modalities: Sequence[str] | None = None,
) -> list[SeriesData]

Get the series for 'study_uid', filtered by modalities (if specified).

get_studies

get_studies(search_terms: SearchTerms) -> list[StudyData]

Get the studies matching the search_terms.

get_studies_for_patient

get_studies_for_patient(
    search_terms: SearchTerms,
) -> defaultdict[str, list[StudyData]]

Get all studies matching the 'pat_name' in the search_terms.

get_study

get_study(study_uid: str | UID) -> StudyData

Get the single study for the 'study_uid'.

get_date_query

get_date_query(date_range: date | tuple[date, date]) -> str

Convert one of two datetime.date objects to a DICOM compatible date range.