pydicom / pynetdicom

A Python implementation of the DICOM networking protocol
https://pydicom.github.io/pynetdicom
MIT License
502 stars 176 forks source link

Improve QR Move SCP #489

Open scaramallion opened 4 years ago

scaramallion commented 4 years ago

The interface for the QR Move SCP could use some work:

scaramallion commented 4 years ago

Possibilities...

  1. When yielding the (address, port) of the Move Destination allow the user to optionally yield kwargs to pass AE.associate(). This seems like the simplest option to control the presentation contexts and is relatively simple to implement so it could be done in v1.5
  2. Add a new event evt.EVT_C_MOVE_ASSOC, although I don't think it'll be flexible enough

The form:

try:
     something()
except Exception as exc:
    logger.error('some failure str')
    logger.exception(exc)
    rsp.Status = 0xC514
    self.dimse.send_msg(rsp, context.context_id)
    return

is also used a lot, maybe we can replace it with a context instead?

with attempt(msg='some failure str', status=0xC514):
    something()