The documentation in the book already mentioned isn't bad. If you are going to be working with MWL's a lot you really should have some testing tools installed on your system as well, like:
1. dcmtk: Open Source and multiplatform:
dcmtk2. Multiple others depending on your platform, but dcmtk is probably good enough for most cases once you learn how to use it.
I have a repo that has some stuff for creating them via an API using some Python Plug-ins on GitHub (
GitHub Repo), but the MWL generation is largely based on a pretty simple Python script that allows you to create MWL's from JSON using the DICOM short names and a JSON request. I have attached a sample file for that and the generated .wl file with dummy values.
To get it to run you'll need python3 on your system, the pydicom PIP module and probably dcmtk for testing. To run the script, just run 'python3 mwl_sample.py" from the working directory for that file and it will spit out the generated tags and save a .wl file as well called "MWL_TEST.wl". To use it, you would have to create a template for your system and populate the tags from a RIS..
To check the tags in the .wl using dcmtk, just run 'dcmdump MWL_TEST.wl' and it will display a dump of the tags. If you put that file in the worklist folder with the MWL plug-in enabled, then when Orthanc receives a MWL find request it will search the worklist folder and possibly display that requested tags from that file if there is a match. If you want to use XML, a text file, etc. up to you, but I find JSON much more pleasant to deal with. It isn't that hard to save them in a DB along with some other column for items that you want to Index on, possibly along with the JSON depending upon your DB.
That is useful if you want to use a Python Plug-in to do some more advanced handling of the MWL's. See:
Handling worklist SCP requests in the Orthanc Book.
Regarding checking the MWL's via the API, I believe there is a way using a call like this:
orthanc.RestApiPost('/modalities/PACS1/find-worklist', json.dumps(tags))
using curl from the CLI, that would just be like:
curl -k -d '{"Modality": "MR","PatientID":"","ScheduledProcedureStepSequence": [{"Modality": "MR"}]}' localhost:8042/modalities/SELF/find-worklist
where SELF and PACS1 are defined as modalities in your orthanc.json. FINDSCU is also often used for the name there.
Haven't tried that in awhile, but I think it works. the dcmtk findscu works fine in most cases, unless you want to use an API from a WebApp for some reason.
Stephen D. Scotti