Hello,
So I am gonna define my problem as simply as possible.
Firstly, I am using the Orthanc worklist plugin to create and modify the worklist. (https://book.orthanc-server.com/plugins/worklists-plugin.html) And I can successfully generate a worklist and modify it.
However, when I try to create a study from the worklist, StudyDate is different than what I enter. So I tried to change a couple of tags in the worklist and see what tag is affecting it. Surprisingly, the StudyDate tag is changed because of PatientID and StudyInstanceUID.
So I am using the default worklist from the OrthancBook and I tried to change PatientID but the study is not generated from the worklist in my Bonsai when I do that (it raises an error). This means I have to change both StudyInstanceUID and PatientID. But I don’t know how to create StudyInstanceUID and PatientID.
My sample worklist tags:
(0010,0020) LO [34665098] # 8, 1 PatientID
(0020,000d) UI [1.2.276.0.7230010.3.2.101] # 26, 1 StudyInstanceUID
My question is how can I generate StudyInstanceUID and how can I fix the StudyDate problem by changing StudyInstanceUID?
Thank you,
Might be helpful if you actually provided the MWL file. I switched from using a .txt template and dcmtk to convert to .wl files to using JSON and a Python script available here:
https://github.com/sscotti/python_script_library
That is a slimmed down version, but I also have it integrated into Orthanc Instances as a Python Plug-in. There is a sample JSON for an MWL in that script. You can generate .wl files from JSON that way. It seems a lot easier to deal with JSON than with text templates.
Note that the StudyDate tag I believe is generated by the modality directly when the study is performed and is not pulled from the MWL file. ScheduledProcedureStepStartDate is what is usually searched on by ModalityWorkList SCU’s, not the StudyDate. Also, any vendor that supports MWL queries will have their implementation specified in their DICOM conformance statements.
Regarding generation of a StudyInstanceUID, it depends. You might want to read over this: https://stackoverflow.com/questions/10295792/how-to-generate-sopinstance-uid-for-dicom-file
Many modalities actually generate their own StudyInstanceUID if the MWL does not provide one.
If you have your own root ID, you can come up with a scheme to guarantee a unqiue ID, and I believe that Orthanc developers have adding one’s own root ID to the config file on their roadmap down the road.
You usually have to pay a fee to get a root ID, and it has to be registered, although I think there are ways to get one for free, depending upon which country you are in.
The REST API also has a GET path to generate a uid: /tools/generate-uid.
Stephen D. Scotti