pynetdicom failed to acquire patient information from Orthanc

147 Views Asked by At

I want to acquire all patient name from a SCP with pynetdicom, but it failed. In my computer, the Orthanc is used as the SCP.

Currently, I have successfully connect Orthanc with pynetdicom by:

from pydicom.dataset import Dataset

from pynetdicom import AE, debug_logger
from pynetdicom.sop_class import ModalityWorklistInformationFind

debug_logger()

# Initialise the Application Entity
ae = AE()

ae.add_requested_context('1.2.840.10008.1.1')
assoc = ae.associate("127.0.0.1", 4242)

if assoc.is_established:
    print('Association established with Echo SCP!')
    assoc.release()
else:
    print('Association rejected, aborted or never connected')

And it can print Association established with Echo SCP!

Then, I want to query the patient list from SCP. For example, I want to know how many patient does SCP have, and the patient names. I have read the example: https://pydicom.github.io/pynetdicom/stable/examples/basic_worklist.html.

My code is:

from pydicom.dataset import Dataset

from pynetdicom import AE, debug_logger
from pynetdicom.sop_class import ModalityWorklistInformationFind

debug_logger()

# Initialise the Application Entity
ae = AE()

ae.add_requested_context(ModalityWorklistInformationFind)

assoc = ae.associate("127.0.0.1", 4242)

if assoc.is_established:
    print('Association established with Echo SCP!')
    assoc.release()
else:
    print('Association rejected, aborted or never connected')

But, it print Association rejected, aborted or never connected.

The only difference is changing ae.add_requested_context('1.2.840.10008.1.1') to ae.add_requested_context(ModalityWorklistInformationFind). And ae.add_requested_context(DisplaySystem) also failed.

How can I kown how many patients does the SCP have?

Any suggestion is appreciated~~~

0

There are 0 best solutions below