Adding additional DICOM tags to patients during instance parsing

I’d like the ability to add additional tags to be parsed by the Orthanc server upon reception of a DICOM instance. The way I’m accomplishing this is compiling after adding it to OrthancFramework/Sources/DicomFormat/DicomMap.cpp:

{ DicomTag(0x0010, 0x0010), “PatientName” },
{ DicomTag(0x0010, 0x0030), “PatientBirthDate” },
{ DicomTag(0x0010, 0x0040), “PatientSex” },
{ DicomTag(0x0010, 0x1000), “OtherPatientIDs” },
→ { DicomTag(0x0010, 0x2297), “ResponsiblePerson” },

This method requires me to maintain a separate repo branch and rebase when there are Orthanc codebase updates, which makes it not ideal (from my perspective). Is there a better way to accomplish this? I would be able to develop a plugin for it if it’s something that’s available to the plugin API/extensibility.

Thanks,
Callie

Hi Callie,

Customizing the Dicom Tags that are stored in Database is something I’m going to work on very soon (in March-April). I still have to figure out how I will implement this but I’ll take your message into account when designing the feature.

Best regards,

Alain

Thanks Alain!

I really look forward to the addition of that feature – thanks for providing an update! I have several additional DICOM patient tags that I add to that source file currently. That feature will definitely be a big help for me to have.

Thanks,
Callie

Hi,

This feature has now be implemented: https://book.orthanc-server.com/faq/main-dicom-tags.html

Best regards,

Alain

Hello Alain,

I’m confused as to how this is being implemented. I have ExtraMainDicomTags properly configured but I don’t know how to get access to the data.

My goal is to get access to additional patient tags upon every new patient/study pushed over through C-Store. I’m using the HTTP server RESTful API to query the studies and patients. I’m not showing any of the new data in the PatientMainDicomTags object returned by this API. I cannot figure out how to get access to any of the additional patient information.

Here is my current configuration:

{
“ExtraMainDicomTags” : {
“Instance” : [],
“Series” : [],
“Study”: [],
“Patient”: [
“ResponsiblePerson”,
“PatientBreedDescription”,
“PatientAge”,
“PatientSize”,
“PatientBodyMassIndex”,
“PatientWeight”,
“Allergies”,
“AdditionalPatientHistory”,
“PregnancyStatus”,
“PatientSexNeutered”
]
}
}

Hi Callie,

Note that the ExtraMainDicomTags are added to the DB only for images that have been uploaded/received after you have set the configuration. You may use the Housekeeper plugin in order to reprocess older images.

You may also check that your configuration is taken into account correctly → this can be done by checking the /system route that now shows the list of indexed tags for each resource.

Then, the ExtraMainDicomTags shall be listed as any other MainDicomTags in the /patients/{id} route.

Hope this helps,

Alain.

Hey Alain,

I’m not getting anything in the /system route that would indicate that the extra tags have been loaded. What should I see there? Here’s what my Orthanc.log is showing:

W0306 22:24:28.382278 OrthancConfiguration.cpp:55] Reading the configuration from: “/etc/orthanc/extradicomtags.json”
W0306 22:24:28.409731 FromDcmtkBridge.cpp:380] Loading external DICOM dictionary: “/usr/share/libdcmtk16/dicom.dic”
W0306 22:24:28.421148 FromDcmtkBridge.cpp:380] Loading external DICOM dictionary: “/usr/share/libdcmtk16/private.dic”

It seems to be accepting my extradicomtags.json file which I pasted in my previous message in this thread. However, my system route is outputting the following:

{
“ApiVersion” : 16,
“CheckRevisions” : false,
“DatabaseBackendPlugin” : “/usr/lib/orthanc/libOrthancPostgreSQLIndex.so.4.0”,
“DatabaseVersion” : 6,
“DicomAet” : “PACS”,
“DicomPort” : 4242,
“HttpPort” : 8042,
“IsHttpServerSecure” : false,
“Name” : “Orthanc”,
“PluginsEnabled” : true,
“StorageAreaPlugin” : “/usr/lib/orthanc/libOrthancAwsS3Storage.so.mainline”,
“Version” : “1.10.0”
}

When I add the patient tags to OrthancFramework/Sources/DicomFormat/DicomMap.cpp and OrthancFramework/Sources/DicomFormat/DicomTag.h I do get the results that I need. However, it has been a hassle to maintain my fork of Orthanc, so I’d much rather use the config method. Additionally, do you know as if the addition patient tags will also appear in the /studies/{id} route inside the returned PatientMainDicomTags object or will they only appear in the /patients/{id} route once this is functioning properly through the config?

Hi Callie,

The ExtraMainDicomTags were introduced in version 1.11.0 and you are running 1.10.0.

Best regards,

Alain

Thanks again Alain! That was my problem. Everything seems to me working now. :blush: