0

I am trying to pass an event argument from a function to another. The example code that I have now is:

def handle_store(event):

 ds = event.dataset  
 save(ds,event) 


def save(ds,event): 

 
 ds.file_meta = event.file_meta
 ds.save_as(ds.SOPInstanceUID, write_like_original=False)

 return 0x0000   

handlers = [(evt.EVT_C_STORE, handle_store)]

The ds can be passed into the next save func but the event does not. Can someone help? Thanks

  • What do you mean by "cannot be passed"? is it `None`? Do you get an error? – MrBean Bremen Nov 23 '21 at 18:40
  • I am getting an error 'Invalid status returned by callback' – user17489801 Nov 23 '21 at 21:41
  • `EVT_C_STORE` handler functions need to [return a status value](https://pydicom.github.io/pynetdicom/stable/reference/generated/pynetdicom._handlers.doc_handle_store.html#pynetdicom._handlers.doc_handle_store) (such as `0x0000` - Success). Try returning `save` from within `handle_store` – scaramallion Nov 23 '21 at 22:04

0 Answers0