pynetdicom.utils.validate_uid

pynetdicom.utils.validate_uid(uid: UID) bool[source]

Return True if uid is considered valid.

If ENFORCE_UID_CONFORMANCE is True then the following rules apply:

  • 1-64 characters, inclusive

  • Each component may not start with 0 unless the component itself is 0

  • Components are separated by .

  • Valid component characters are 0-9 of the Basic G0 Set of the International Reference Version of ISO 646:1990 (ASCII)

If ENFORCE_UID_CONFORMANCE is False then the following rules apply:

  • 1-64 characters, inclusive

Parameters:

uid (pydicom.uid.UID) – The UID to check for validity.

Returns:

True if the value is considered valid, False otherwise.

Return type:

bool