Hello,
we are using ORTHANC to receive images from different locations.
In order to distinguish which images are from where (and as orthanc accetps images even if the AT Title is different) we tought we might use different AT Titles for each city, like:
ORTH_NY
ORTH_LA
ORTH_MI
The main reason to use AE Title is that it’s a “easy to configure” parameter on each machine.
Unfortunately I can’t retrive the AT Title that the client used when sending the images.
- Do you know if Orthanc stores somewhere the AT Title that was used ?
- Do you know if there is a way to retrieve it ?
Eventually, do you have any other suggested params that can be used ?
Thank you all for help
Julien
What I do is when an image is accepted, within the Lua script throw the AET into: 2100,0070 (Originator). This works the easiest.
WoW that looks nice - is there a LUA script already I ca reuse ?
Here is a rough script. This is on instance stored. Replace varOriginator with OnStoredInstance Origin and you should be good. This will modify the instance, add the Origin AE title, and keep the same study UID data.
if origin[‘RequestOrigin’] ~= ‘Lua’ then
–Initiate replace of image tags
local replace = {}
– The tags to be replaced for all images
replace[‘2100-0070’] = varOriginator
replace[‘StudyInstanceUID’] = tags[‘StudyInstanceUID’]
replace[‘SeriesInstanceUID’] = tags[‘SeriesInstanceUID’]
replace[‘SOPInstanceUID’] = tags[‘SOPInstanceUID’]
– Commands to modify the study
local command = {}
command[‘Replace’] = replace
command[‘Force’] = true
local modifiedFile = RestApiPost(‘/instances/’ … instanceId … ‘/modify’, DumpJson(command, true))
–Delete the original instance
RestApiDelete(‘/instances/’ … instanceId)
– Upload the modified instance to the Orthanc database so that
– it can be sent by Orthanc to other modalities
local modifiedId = ParseJson(RestApiPost(‘/instances/’, modifiedFile)) [‘ID’]
Bryan,
I will paste your code in a LUA script and test and keep you updated
Di you think using this could also help ?
Ie routing feature:
http://book.orthanc-server.com/users/lua.html#lua-auto-routing
Thanks
Julien
Yeppers, that link will help. Thats what I used as a starting point initially.
Thank you I was successfull.
This is the LUA script that worked for me:
function OnStoredInstance(instanceId, tags, metadata,origin)
– Ignore the instances that result from a modification to avoid
– infinite loops
if (metadata[‘ModifiedFrom’] == nil and
metadata[‘AnonymizedFrom’] == nil) then
– The tags to be replaced: Originator and PatientID
local replace = {}
replace[‘2100-0070’] = origin[‘CalledAet’]
– Modify the instance, send it, then delete the modified instance
Delete(SendToModality(ModifyInstance(instanceId, replace, remove, true), ‘sample’))
– Delete the original instance
Delete(instanceId)
end
end
Julien Buratto
Amministratore
Linkas Srl
p: +390230321419 m: +393356359515
f: +390240700321
20124 - Milan (MI)
w: www.linkas.it e: julien@linkas.it