Newbie qrscp

96 views
Skip to first unread message

Jeenit Khatri

unread,
Aug 12, 2016, 6:04:21 PM8/12/16
to pynetdicom
Hello, 
I am trying to fetch the study details from the dcm4chee using the qrscp.py of pynetdicom.
But the search in the given example is just working on the basis of patient name, but I need to fetch the data 
using the study date and time.
So I made some changes to the code like I try to use the 

print "DICOM FindSCU ... ",
d = Dataset()
d.StudyDate = args.searchstring
d.QueryRetrieveLevel = "STUDY"
d.StudyID = "*"
study = [x[1] for x in assoc.StudyRootFindSOPClass.SCU(d, 1)][:-1]
print 'done with status "%s"' % st
print "\n\n\n Cont...", study

But I get this error :

Request association
Association response received
DICOM Echo ...  done with status "Success "
DICOM FindSCU ... 
Traceback (most recent call last):
  File "studyqrscu.py", line 104, in <module>
    study = [x[1] for x in assoc.StudyRootFindSOPClass.SCU(d, 1)][:-1]
  File "/usr/local/lib/python2.7/dist-packages/pynetdicom-0.8.1-py2.7.egg/netdicom/applicationentity.py", line 90, in __getattr__
    raise Exception("SOP Class %s not supported as SCU" % attr)
Exception: SOP Class StudyRootFindSOPClass not supported as SCU


Please let me know that what I need to do to find the study using the date and time.

Thanks 
 

Patrice Munger

unread,
Aug 12, 2016, 6:10:48 PM8/12/16
to pynetdicom
Jeenit, 

You need to add the StudyRootFindSOPClass in the list of supported classes as SCU. This is done when creating the application entity, i.e,
change the lines:

# create application entity
MyAE = AE(args.aet, args.p, [PatientRootFindSOPClass,
                             PatientRootMoveSOPClass,
                             VerificationSOPClass], [StorageSOPClass], ts)

for

# create application entity
MyAE = AE(args.aet, args.p, [PatientRootFindSOPClass,
                             PatientRootMoveSOPClass,
                             StudyRootFindSOPClass,
                             VerificationSOPClass], [StorageSOPClass], ts)


Cheers
Reply all
Reply to author
Forward
0 new messages