MWL worklist using Orthanc

217 views
Skip to first unread message

Ashique Mohammed

unread,
Mar 29, 2023, 6:25:58 AM3/29/23
to Orthanc Users
Trying to send MWL worklist to an Xray console , I am using Orthanc with the worklist plugin enabled . I have followed pydicom (https://pydicom.github.io/pydicom/stable/auto_examples/input_output/plot_write_dicom.html#sphx-glr-auto-examples-input-output-plot-write-dicom-py) to generate the worklist (dicom) file with the patient information . The dicom file created was maintained in the worklist database folder of the Orthanc server . 

For the MWL Query from the device console , it is able to query the tags and receive the information . However few tags that are created are not identified by the MWL query . I debugged the console logs to see that the tags are not received at the console end . I am also surprised to see that even in the packet analyser using Wireshark , few tags like Modality that were created like the tags PatientName , PatientID etc are not received on the console end , 

What do you think ?  

Stephen Douglas Scotti

unread,
Mar 29, 2023, 12:34:29 PM3/29/23
to Orthanc Users
Did you try using a complete set of tags in a findscu from the CLI if you have DCMTK ?  e.g.:  You might have to add +tla -ic for TLS.

That sort of emulates a MWL query from the command line, although there are ways to do that with JSON or other tools.

I think that the MWL server only returns a list of tags and values for tags that you actually ask for in the request, not ones that are present, but not requested.

You can also do a dcmdump on the MWL file that resides on the server to verify what tags are defined in the MWL file.

Are you able to determine what is in the request from the device console ?  If you turn on --trace in Orthanc you will get a detailed log of the DIMSE request and response in the Orthanc log, and findscu will show an output in the terminal if you have I think the -v option.

findscu  127.0.0.1 4445 -W -v -d   -k "AccessionNumber" \
-k "Modality" \
-k "InstitutionName" \
-k "ReferringPhysicianName" \
-k "PatientName" \
-k "PatientID" \
-k "PatientBirthDate" \
-k "PatientSex" \
-k "PatientAge" \
-k "PatientWeight" \
-k "MedicalAlerts" \
-k "Allergies" \
-k "StudyInstanceUID" \
-k "StudyID" \
-k "RequestingPhysician" \
-k "RequestedProcedureDescription" \
-k "AdmissionID" \
-k "SpecialNeeds" \
-k "CurrentPatientLocation" \
-k "PatientState" \
-k "ScheduledProcedureStepSequence[0]" \
-k "RequestedProcedureID" \
-k "RequestedProcedurePriority" \
-k "PatientTransportArrangements"

Stephen D. Scotti, M.D.

Ashique Mohammed

unread,
Mar 30, 2023, 5:12:34 PM3/30/23
to Orthanc Users
Dear Stephen , 

Thank you for your response , 

The modailty actually comes as a subset or like an array which is defined as a DataSet which i later came to realize . I modified my python script that generates the worklist file and i was able to get it to work . 

But I really doubt if the MWL setup i have is the ideal one that needs to be maintained . 

I have.a web application on react that is powered by a node backend  . Once the patient information reaches the backend , I have now maintained a worklist template with variables that are present in a folder . The template variables are replaced with the information that are received , and the updated worklist file is moved to the orthanc worklist database . Would this be an ideal workflow to maintain , Do you suggest anything better ?  

Stephen Douglas Scotti

unread,
Mar 31, 2023, 2:21:21 AM3/31/23
to Orthanc Users
What you describe probably 'works'.  But, depending upon the complexity and scale of your setup, you might want:

1.  Put your MWL's in a Database rather than on the file system.
2.  Use the Python Plug-in to manage MWL requests.  See:


That gives you a bit more flexibility with handling and processing requests.  If you just dump all of the MWL's in a folder, eventually you would need to move them or delete them so that folder does not get really large.  With a DB, you can add other columns, including ones for 'active', 'processed', AET, tc. or whatever you want, and you can more effectively filter requests..

I don't think that the Orthanc MWL Plug-in supports N-SET and N-CREATE by default, but it is hard to keep up with recent releases sometimes.

One thing I've noticed about the Python Plug-in is that you might need to use the multiprocessing feature for methods that might take a long time if there are other processes that might be expected to run concurrently.

There is a section in the Orthanc book about that also.


For what it is worth, I think you can also execute what is functionally like findscu like this using the REST-API, where the request data is in JSON format, and 'SELF" is one of your Dicom Modalities.

curl -d '{"Modality": "MR","PatientID":"","ScheduledProcedureStepSequence": [{"Modality": "MR"}]}' localhost:8042/modalities/SELF/find-worklist

/sds
Reply all
Reply to author
Forward
0 new messages