0

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~~~

Qiang Zhang
  • 820
  • 8
  • 32
  • It's likely the SCP either doesn't support Modality Worklist if the association is being rejected, or that the SCP will not allow use of Modality Worklist unless the SCU has been registered with it (contact the SCP admin in that case). – scaramallion Feb 28 '23 at 03:22
  • I have implement a software, and I hope it can connect with PACS system in hospital. Could you please recommand a free PACS system, for example Orthanc, so that I can debug the `pynetdicom` in my computer? – Qiang Zhang Mar 01 '23 at 03:49

0 Answers0