New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i want to change workitem's status using n-action #509
Comments
The UPS has been created and is in the SCHEDULED initial state? I've never used UPS so I'm only going off what Part 4 says... |
|
I meant I can only look at Part 4 of the DICOM Standard and try and guess what the problem is. Are you getting your from pynetdicom import debug_logger
debug_logger()
# ... rest of code |
def get_sop_instance_uids():
sop_instance_uids = []
ae = AE(ae_title='calling_ae')
ae.add_requested_context(UnifiedProcedureStepQuerySOPClass)
ds = Dataset()
ds.PatientName = '*'
ds.ProcedureStepState = 'SCHEDULED'
ds.SOPInstanceUID = '*'
assoc = ae.associate(
ip,
port,
ae_title='called_ae',
)
if assoc.is_established:
responses = assoc.send_c_find(ds, UnifiedProcedureStepQuerySOPClass)
for (status, identifier) in responses:
if status != None:
# 0xFF00 = pending - Matches are continuing
if status.Status == 0xFF00:
sop_instance_uids.append(identifier.SOPInstanceUID)
else:
print('Connection timed out, was aborted or received invalid response')
assoc.release()
else:
print('Association rejected, aborted or never connected')
return sop_instance_uids C-FIND and N-ACTION output:
|
As far as I can tell you're doing everything correctly. Could you bind the following to from pydicom.dataset import Dataset
from pynetdicom import AE, evt, debug_logger
from pynetdicom.sop_class import (
UnifiedProcedureStepPushSOPClass
)
from pynetdicom.utils import pretty_bytes
from pynetdicom.presentation import (
UnifiedProcedurePresentationContexts
)
from pydicom.uid import generate_uid
debug_logger()
def pdu_sent(event):
if event.pdu.pdu_type == 0x04:
for ii, item in enumerate(event.pdu.presentation_data_value_items):
print('PDV {}'.format(ii))
for line in pretty_bytes(item.presentation_data_value):
print(line)
handlers = [(evt.EVT_PDU_SENT, pdu_sent)]
ae = AE(ae_title='calling_ae')
assoc = ae.associate(
ip,
port,
contexts=UnifiedProcedurePresentationContexts,
ae_title='called_ae',
evt_handlers=handlers
)
ds = Dataset()
ds.TransactionUID = generate_uid()
ds.ProcedureStepState = 'IN PROGRESS'
(status, reply) = assoc.send_n_action(
ds,
1,
UnifiedProcedureStepPushSOPClass,
sop_instance_uid
)
assoc.release() |
|
Everything looks fine, are you sure the problem doesn't lie with the SCP?
|
it returns status - 0x0123(No such action) and have no effect on workitems. but upsscu(dcm4che tool) works correctly with the SCP.
it's so confusing.. |
The N-ACTION-RQ looks the same, maybe try setting the AE title to |
yes.. i tried. but changing AE title didn't have effect. |
hello @scaramallion, I'm working with @codepage949 I think the pynetdicom is correct, but i don't know how to using properly.. |
OK, give me a chance to install dcm4chee and I'll try and figure out what's going on |
Oh, thanks. 😉 NOTE1 : DO NOT USING
docker-compose.env
docker-compose.yml
|
OK, I think this is a pynetdicom issue. The DICOM Standard says:
In essence, dcm4chee wants the requested presentation context to be UPS Pull and the N-ACTION-RQ's Requested SOP Class UID to be UPS Push. pynetdicom doesn't allow that with I'll double check my reasoning and probably put out a patch release. If you need it working sooner rather than later then this branch should work with: def set_in_progress(instance_uid):
ae = AE()
ae.add_requested_context(UnifiedProcedureStepPullSOPClass)
ds = Dataset()
ds.TransactionUID = generate_uid()
ds.ProcedureStepState = 'IN PROGRESS'
assoc = ae.associate('localhost', 11112, ae_title=b"DCM4CHEE")
if assoc.is_established:
(status, reply) = assoc.send_n_action(
ds, 1,
UnifiedProcedureStepPushSOPClass,
instance_uid,
)
print(f"In-progress: 0x{status.Status:04X}")
assoc.release() |
it was so great experience solving a problem with someone online. thank you. |
Fixed with v1.5.2, do you mind testing it? |
You know, now that I've done all that work I've realised that the simplest solution would've been to just use the status, ds = assoc.send_n_action(ds, 1, UnifiedProcedureStepPushSOPClass, '1.2.3.4', meta_uid=UnifiedProcedureStepPullSOPClass) |
with v1.5.2, it worked as expected. and with v1.5.1, meta_uid solved the problem too. thank you very much! have a good weekends. |
Thanks! |
i have tried to change status for workitems in uwl using n-action.
but i got status code - 0x0123(No such action).
i am new to dicom and couldn't find references about changing workitem's status with pynetdicom.
please let me know what is the problem in below code.
or are there examples?
thank you in advance.
n-action document: http://dicom.nema.org/dicom/2013/output/chtml/part04/sect_CC.2.html
The text was updated successfully, but these errors were encountered: