Hi, I’ve been using orthanc in a windows PC for a while. Last week I have installed in a Linux Ubuntu machine.
Now I have put the config and the old lua script that I have been using but I have got trouble when retrieving DICOM metadata.
I have reinstalhed, simplifyed the script and got no light.
Could anyone tel me why this LUAScript is not working ?
The errors I Get on the logfile are:
W0225 23:00:46.722068 MAIN main.cpp:924] Orthanc has started
W0225 23:02:21.231945 LUA-EVENTS LuaContext.cpp:94] Lua says: This series is now stable, writing its instances on the disk: 3c2e3248-26d77f49-de4d107b-05497655-73ed4828
E0225 23:02:21.232260 LUA-EVENTS OrthancException.cpp:61] Cannot execute a Lua command: [string “line”]:9: attempt to concatenate a table value (local ‘instanceId’)
E0225 23:02:21.233341 LUA-EVENTS LuaScripting.cpp:841] Error while processing Lua events: Cannot execute a Lua command
W0225 23:03:17.899726 MAIN main.cpp:986] Orthanc is stopping
If I change the line 9 to another DICOM METADATA it fails. I was using this script on a windows PC with older orthanc.
Could anyone help me solve this?
I’m stuck in this script for more thans 10 days…
Hello friend, thank you very much for the quick and efficient response.
I really hadn’t thought of OnStableSeries as an exam series. I was thinking of it as just a trigger. Thinking “when it’s stable, do this”.
In my case, I’m just waiting for the entire exam to be received. A chest x-ray usually has few images.
I’m going to study this DICOM hierarchy issue better. I would like to extract all METADATA to TXT. In this case, can I use it as OnStoredInstance? Can I extract the patient and study data using the OnStoredInstance trigger? Data that would be one hierarchy above, correct?
I’m going to restart the studies using the examples in the documentation.
I actually made the mistake of asking a GPT for help to refactor my old code and he hindered me more than helped =).
Thank God this forum exists to help users.
If you are only interested in getting the series, study and patient metadata, you should only react to OnStableSeries
If multiple series are transferred and you need to wait for them all, you can instead implement OnStableStudy.
etc…
If you’re not interested in individual instances, you should not override OnStoredInstance because it will be called, as the name says, for each instance, and you will extract the same data multiple times.
And, as always, don’t forget to read the relevant sections of the Orthanc Book.