harcoding verification_sop_class value.
This avoids potential threading issues and any possible future change in pynetdicom
attributes.
included URL reference to appropriate part of the DICOM Standard
@@ -77,23 +77,16 @@ class DicomListener(DicomConnectBase):
# Initialise the Application Entity
self.ae = pynetdicom.AE(ae_title=self.ae_title)
- # pynetdicom 2.0 changed attributes for Verification/C-ECHO
- verification_sop_class = None
- old_verification_attribute = "VerificationSOPClass"
- new_verification_attribute = "Verification"
- if hasattr(pynetdicom.sop_class, old_verification_attribute):
- verification_sop_class = getattr(
- pynetdicom.sop_class, old_verification_attribute
- )
- elif hasattr(pynetdicom.sop_class, new_verification_attribute):
- verification_sop_class = getattr(
- pynetdicom.sop_class, new_verification_attribute
- )
+ # pynetdicom 2.0 changed attributes for Verification/C-ECHO in pynetdicom.sop_classes
+ # The Verification SOP Class UID is a single well known constant
+ # https://dicom.nema.org/medical/dicom/current/output/html/part04.html#chapter_A
+ # section A.4 Verification SOP Class
+
+ verification_sop_class = "1.2.840.10008.1.1"
# Add the supported presentation context
- self.ae.add_supported_context(
- verification_sop_class # pylint: disable = no-member
- )
+ self.ae.add_supported_context(verification_sop_class)
+
for context in pynetdicom.StoragePresentationContexts:
self.ae.add_supported_context(context.abstract_syntax)
