Hello,
Is it possible to search on a data field if it is not indexed by Orthanc?
Yes: Check out the “StorageAccessOnFind” configuration option. By default, if a tag is not indexed, Orthanc will read the full DICOM file from its storage area to extract the tag (obviously, this operation is costly):
https://groups.google.com/g/orthanc-users/c/0VvppRkzGXw/m/Vz5VPW9xBgAJ
If it is not indexed by Orthanc, is there a way to tell Orthanc to index it? Is there a list I can look at that contains all the data fields that are indexed by Orthanc?
As of Orthanc 1.8.2, you cannot index more tags. The so-called “main DICOM tags” are the only ones to be indexed in the database, and their list can be found in the “DicomMap.cpp” source file:
https://hg.orthanc-server.com/orthanc/file/Orthanc-1.8.2/OrthancFramework/Sources/DicomFormat/DicomMap.cpp#l48
For example, I would like to get all DICOMs with a given Device Serial Number (0018,1000) . Is it possible to do a query on Device Serial Number through the DICOMWeb Plugin?
Yes:
$ curl https://demo.orthanc-server.com/dicom-web/series?0018,1000=0000000843815bmr
Is it possible through the Orthanc REST API?
Yes:
$ curl https://demo.orthanc-server.com/tools/find -d ‘{“Level”:“Series”,“Query”:{“DeviceSerialNumber”:“0000000843815bmr”},“Expand”:true}’
Is it possible through the DICOM protocol itself?
Yes:
$ findscu localhost 4242 -S -k QueryRetrieveLevel=SERIES -k DeviceSerialNumber=0000000843815bmr
What if I want to query on Institution Name (0008,0080)?
$ curl https://demo.orthanc-server.com/dicom-web/studies?0008,0080=HUG
$ curl https://demo.orthanc-server.com/tools/find -d ‘{“Level”:“Study”,“Query”:{“InstitutionName”:“HUG”},“Expand”:true}’
$ findscu localhost 4242 -S -k QueryRetrieveLevel=STUDY -k InstitutionName=HUG
Also, is there any way to query Orthanc using a “logical or” operator? Such as : “Give me all the DICOMs with a Device Serial of 10001, 10002, OR 10003”
In the examples below, we look for serial numbers “0000000843815bmr” or “10”:
$ curl https://demo.orthanc-server.com/dicom-web/series?0018,1000=0000000843815bmr%2C10
$ curl -s https://demo.orthanc-server.com/tools/find -d ‘{“Level”:“Series”,“Query”:{“DeviceSerialNumber”:“0000000843815bmr\10”},“Expand”:true}’
$ findscu localhost 4242 -S -k QueryRetrieveLevel=SERIES -k DeviceSerialNumber=0000000843815bmr\10
Note that “%2c” in the DICOMweb version corresponds to the URL encoding of the comma.
Sébastien-