Hello again,
I'm really excited about using Orthanc for my local DICOM server. I am now trying to anonymize all incoming instances. My use case is that a hospital will be transferring DICOMs to me using "storescu," but I would like them to be anonymized before saving to my local server. Here is what I have been able to do so far:
Using the example script AnonymizeAllPatients.py, I can anonymize after the DICOMS have been transferred to my server. This is less-than-ideal because they should really be anonymized before storing.
Using the example script AutoroutingModification.lua, with the following in the main body:
if (metadata['ModifiedFrom'] == nil and
metadata['AnonymizedFrom'] == nil) then
-- The tags to be replaced
local replace = {}
replace['0010-0010'] = 'AnonName'
-- more tags follow...
-- The tags to be removed
local remove = { }
-- Modify the instance, send it, then delete the modified instance
ModifyInstance(instanceId, replace, remove, true)
-- Delete the original instance
Delete(instanceId)
I am able to change attributes of the particular instance, e.g. PatientName, but this only seems to change the particular instance entry and not the actual patient entry. So in the end I get the original PatientName as the patient name entry in Orthanc, with 'AnonName' as the PatientName of the instances. In addition, I am not sure how to use this Lua script to make unique patient names (though I could append a random number, etc.). Should I call the python script within the body of "OnStoredInstance"?
Not sure if my process makes sense. I am very new to PACS/DICOM servers...
Thanks for your help,
Jon