Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assumes AffectedSOPClass is returned in C-ECHO-RSP #65

Open
gilbahat opened this issue May 13, 2017 · 1 comment
Open

Assumes AffectedSOPClass is returned in C-ECHO-RSP #65

gilbahat opened this issue May 13, 2017 · 1 comment

Comments

@gilbahat
Copy link

Hi,

pynetdicom assumes that AffectedSOPClass is returned in a C-ECHO-RSP. However, it seems that at least mirth does not return AffectedSOPClass in its response, making pynetdicom unable to properly ping mirth, throwing the following trace:

File "pinger.py", line 38, in
st = assoc.VerificationSOPClass.SCU(1)
File "/usr/local/lib/python2.7/site-packages/netdicom/SOPclass.py", line 60, in SCU
ans, id = self.DIMSE.Receive(Wait=True)
File "/usr/local/lib/python2.7/site-packages/netdicom/DIMSEprovider.py", line 75, in Receive
return tmp.ToParams(), tmp.ID
File "/usr/local/lib/python2.7/site-packages/netdicom/DIMSEmessages.py", line 248, in ToParams
tmp.AffectedSOPClassUID = self.CommandSet[(0x0000,0x0002)]
File "/usr/local/lib/python2.7/site-packages/pydicom-0.9.9-py2.7.egg/dicom/dataset.py", line 277, in getitem
data_elem = dict.getitem(self, tag)
KeyError: (0000, 0002)

the quick fix is to change AffectedSOPClassUID to optional, in DIMSEmessages.py line 247:

    if self.CommandSet.has_key((0x0000,0x0002)):
        tmp.AffectedSOPClassUID = self.CommandSet[(0x0000,0x0002)]

I will file a bug with Mirth in parallel, but I believe pynetdicom should be more lenient.

@gilbahat
Copy link
Author

Looks like this is affecting more SOP classes and more keys like AffectedSOPInstanceUID. This had better be a more generic thing rather than just those classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant