MainDicomTags table additional info

Hello!

I need to have some additional information over the studies on the MainDicomTags table and was wondering what was the best approach to do so.

I tried adding new columns to MainDicomTags but the application stopped working (maybe an ORM issue about unknown columns?). Now i am creating a new table StudyComplementaryInfo with a FK to the MainDicomTags table which will be populated when the resourceType is equal to 1 (study resourceType). However, i need a way to know when a new exam (study) is inserted on MainDicomTags to correctly populate StudyComplementaryInfo. Right now i am using a trigger on the MainDicomTags table to populate StudyComplementaryInfo. The StudyComplementaryInfo table data can be changed via application.

Is that the best way to have additional information over Orthanc tables?

Hello,

You should not try and modify the list of main DICOM tags in your setup (cf. source file “orthanc/Core/DicomFormat/DicomMap.cpp”), as this requires reconstructing all the index (cf. POST to REST URI “/tools/reconstruct”), which takes much time, and as this makes your Orthanc setup incompatible with future releases of Orthanc.

Similarly, you should never access the Orthanc database directly by yourself:
https://book.orthanc-server.com/faq/orthanc-storage.html#direct-access

The solution to your issue consists in taking advantage of the metadata feature combined with the “ReceivedInstanceFilter()” Lua callback:
https://book.orthanc-server.com/faq/features.html#metadata-attachments

https://book.orthanc-server.com/users/lua.html#callbacks-to-react-to-events

By combining these two features, whenever a DICOM file is received, you can extract your tags of interest (to create your “StudyComplementaryInfo”), then attach this information as metadata of the instance (e.g. formatting it in JSON using the “DumpJson()” Lua function).

HTH,
Sébastien-