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.
Added 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
tupleof (bool,str) as the(result, msg). If the result isTruethen 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
UIDto be validated.The function should return a
tupleof (bool,str) as the(result, msg). If the result isTruethen 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 >>> def my_validator(value): return (True, "") ... >>> _config.VALIDATORS['AE'] = my_validator