pynetdicom._config.VALIDATORS

pynetdicom._config.VALIDATORS: Dict[str, Callable[[Any], Tuple[bool, str]]] = {'AE': <function validate_ae>, 'UI': <function validate_ui>}

Customise the validation performed on DIMSE elements and PDU parameters.

New in version 2.0.

AE

Function signature: def func(value: str) -> Tuple[bool, str]

Where value is the AE title to be validated as a str.

The function should return a tuple of (bool, str) as the (result, msg). If the result is True then msg is ignored, otherwise msg will be used to provide feedback about why validation has failed.

UI

Function signature: def func(value: pydicom.uid.UID) -> Tuple[bool, str]

Where value is the UID to be validated.

The function should return a tuple of (bool, str) as the (result, msg). If the result is True then msg is ignored, otherwise msg will be used to provide feedback about why validation has failed.

The default validation functions can be found here .

Examples

Perform no validation of AE DIMSE elements and AE title PDU parameters:

>>> from pynetdicom import _config
>>> _config.VALIDATORS['AE'] = def my_validator(value): return (True, "")