All,
In compliance with the AGPL licensing scheme, I am publishing my Orthanc setup to github.
https://github.com/HDVUCAIR/OrthancContribution
We developed and use this setup extensively at our university lab for anonymizing and managing our research DICOM. I wrote much of the framework in Lua back in the days when that was the only scripting language embedded in Orthanc. I have since started converting my Lua to Python with the Python plugin, but have not completed the conversion process.
I am a physicist by training and a coder by necessity. You have my apologies for the readability or lack thereof of my code. Since I make extensive use of Lua and Python as well as accompanying PostGreSQL servers, I knew I needed to publish the code to come into AGPL compliance.
I make no claims that the anonymized images produced by this setup meet the legal definition of anonymization and patient privacy in your setting. It is up to you to confirm that the output DICOM meet your local requirements.
At the moment, I have detected some non-compliance in the DICOM output based on Dave Clunie’s DICOM validator. Mostly, this involves missing DICOM tags that should be left blank rather than deleted by the anonymization.
A general description of the setup is given on github.
- I use docker-compose to launch a number of Orthancs (built on the Osimis docker container) and accompanying PostGreSQL servers.
- The main anonymizing Orthanc maintains a lookup table between original PatientID and anonymized ID, and original StudyInstanceUID and anonymized StudyInstanceUID.
- Longitudinal anonymization is supported (repeat visits by the same subject)
- This involves assigning and tracking a single random shift (up to 365 days) in time to each patient.
- Longitudinal visits retain their order, but with a relative shift to obscure the true dates.
- Inter-series relationships are retained. This is managed by first recursively searching all UID and links between series prior to anonymization and replacing all UID with new UID while retaining their link relationship.
- Two optional Orthancs can receive the anonymized images from the anonymizing orthanc. Which Orthanc is used depends on user preference. The point is to separate the Orthanc with patient data (the anonymizing Orthanc) from the Orthancs users more often access.
- One for simple web access (when there is no need for disk access)
- Another if automated structured output to disk is desired.
I am happy to answer questions as I am able. It is unlikely that I would have the time to support requested modifications, but people are free to fork this code base.
John.