Possible bug with ExtraMainDicomTags configuration and WADO-RS Retrieve Metadata endpoint

Short description: OHIF viewer can’t see SOPClassUID attribute after I switched to “MainDicomTags” mode as described here: DICOMweb plugin — Orthanc Book documentation.

Long description:
After setting the above mentioned DicomWeb configurations and setting “ExtraMainDicomTags” exactly as in the sample (https://github.com/orthanc-server/orthanc-setup-samples/blob/master/docker/stone-viewer/docker-compose.yml) I noticed that the SOPClassUID (0008,0016) tag is completely missing in the instance items in the response of the /dicom-web/studies/…/series/…/metadata requests (same is true for /dicom-web/studies/…/metadata endpoint).
After lots of experiments I also checked in the DB in the maindicomtags table and there are also no entries with taggroup=8 and tagelement=16.

In my JSON configuration, just like in the linked sample, there definitely is “SOPClassUID” in the ExtraMainDicomTags.Instance array.

Please help me get an answer to these 2 questions:

  1. Why is SOPClassUID not there in the DB in the maindicomtags table? Shouldn’t it be?
  2. Why is it not served by the metadata endpoints?

Maybe I misunderstand the documentation, or maybe there is a bug somewhere.
After using these settings I expect the SOPClassUID to be stored in the DB as an extra maindicomtag and to also show up in the metadata responses.
If this is not the case, then please help me clarify what the “Instance”, “Series”, “Study”, “Patient” sections each mean under the “ExtraMainDicomTags” configuration parameter.

I’ll appreciate any help and I can post more info if needed but my hope is that it is easy to reproduce.

Hello,

Have you tried with a freshly uploaded study?
If the study you get the metadata from was already stored, you won’t get the newly added tags from the DB.
By the way, with the very last version of Orthanc and the DICOMweb plugin, you should reach good performances without the need for this extra tags mechanism…

HTH,

Yes, I tried several times to delete the patient and reupload it, also tried the /reconstruct endpoint. Neither worked. I’m using the latest orthanc-python:1.12.1 docker image

To narrow down the scope of the question: why are my configured Instance level ExtraMainDicomTags not all there in the instance items in /dicom-web/studies/…/series/…/metadata response?

For example, I definitely have SOPClassUID there but my response looks like this (only showing the beginning for brevity):

[{
   "00080005" : {
      "Value" : [ "ISO_IR 100" ],
      "vr" : "CS"
   },
   "00080018" : {
      "Value" : [ "1.2.276.0.7230010.3.1.4.447481344.1.1683276026.235457" ],
      "vr" : "UI"
   },
   "00080020" : {
      "Value" : [ "20230505" ],
      "vr" : "DA"
   },
   ...

After 00080005, there should be 00080016 (SOPClassIUD), shouldn’t it?
If I switch back to “Full” mode, everything seems to be there in the response.

Good lord… I apologise.
My “ExtraMainDicomTags” entry was under my “DicomWeb” entry in the JSON file so the whole configuration was invalid…
Now with the right config everything seems to work and make sense.
Feel free to remove this thread, there is not much valuable info here, sorry.