Hi all.
I am at my wits end.
We need to be able to pull all the tag information from files that are uploaded (ALL the tags including private ones) and load them into the db.
I initially had some success with using an OnStoredInstance lua function to output tags to a json, then kick off a python script to upload those tags, but this isn’t capturing everything.
So I’ve been trying to kick off a lua script which will then run a python script taking the url and instances data with a particular instance (carried forward from the lua script), to make a post request and then loop through and return all tags.
url = 'http://localhost:8042/tools/find/'
data = {
"Level": "Instances",
"Query": {
"StudyInstanceUID": StudyInstanceUID
},
"Normalize": False
}
This works perfectly fine if I run the Python on its own, but for some reason in practice (uploading a file), this just hangs the server unless I enforce a timeout:
Request failed: HTTPConnectionPool(host=‘localhost’, port=8042): Read timed out. (read timeout=20)
I haven’t been able to get around this at all, no idea what’s causing it.
I also tried using a direct Python plugin (Python plugin for Orthanc — Orthanc Book documentation) and whilst it claims to pick up on the plugin and the specified script (I tried one of their examples)
W1012 17:13:43.541896 PluginsManager.cpp:261] Registering plugin ‘python’ (version 4.1)
W1012 17:13:43.541896 PluginsManager.cpp:157] Python plugin is initializing
W1012 17:13:43.541896 PluginsManager.cpp:157] Using Python script “OnStoredInstance_py.py” from directory: C:\Program Files\Orthanc Server
It then does nothing at all when I upload a file.
Can someone please advise as I have no idea why neither approach is working.
Thank you.