Anonymize all incoming studies

Hello,

(how) is it possible to anonymize all incoming studies with Orthanc by default?
I couldn’t find a corresponding config setting.
Of course there is the API to perform an anonymization afterwards:
https://book.orthanc-server.com/users/anonymization.html

But I want to make sure that no studies get left out accidentially and wonder if there might be a better way.

Background: we want build a dose management PACS with Orthanc which should be accessible to 3rd parties.

Thanks in advance
Björn

I’d be super interested in this as well, and I think the solution will come with a Python or Lua script but will await Sebastien’s advice.

Ditto.

I’m started to look into integration with a few AI engines. I suspect that they might need studies that are pre-anonymized before sending via their API.
It would pretty easy to implement with Python or Lua, but having it baked into an instance to handle AI interfaces would be helpful.

/sds

Hi everyone,

I’m afraid everyone would have his own anonymization requirements so I think it’s best for everyone to write his own lua script to handle that.

To keep consistency, you should work at Study level so you should call the /studies/…/anonymize API route from the OnStableStudy event handler.

HTH,

Alain.

Since others were interested in this topic as well, here’s my minimal working Lua-script to anonymize each incomming study and delete the original study afterwards:

– Anonymize study or delete original study if already anonymized
function OnStableStudy(studyId, tags, metadata)
local anonymizedFrom = metadata[‘AnonymizedFrom’]
if anonymizedFrom == nil then
print(‘Anonymizing study ’ … studyId)
local command = {}
command[‘Keep’] = { ‘AccessionNumber’, ‘StudyDate’, ‘StudyDescription’ }
RestApiPost(’/studies/’ … studyId … ‘/anonymize’, DumpJson(command))
else
print(‘Deleting original study ’ … anonymizedFrom)
RestApiDelete(’/studies/’ … anonymizedFrom)
end
end

The problem: confidential patient data visible for a few minutes until the anonymization callback gets executed.

My idea is to build an orthanc instance that handles the anonymization and auto-routes those anonymized studies to a different orthanc instance for 3rd party access.

Hi Björn,

Thanks for the sample. And indeed, your solution of implementing this lua script in a middleman Orthanc is the right way to go.

Best regards,

Alain.

@sdscotti
hello sir, I am trying similar concept, but ended with failure.
I wanted to send anonymized dicom to AI but when the AI send back the results. The result should be store on the origin dicom.
Any help on this will be a great .
With regards
Ankush
Have a great day.