DICOM C-Find vs API find

Hello,
I ran into the bug or wrong usage.

DICOM C-Find returns 8 items:

I0922 13:53:15.199045 OrthancFindRequestHandler.cpp:634] DICOM C-Find request at level: Study
I0922 13:53:15.199063 OrthancFindRequestHandler.cpp:640] (0008,0005) SpecificCharacterSet = ISO_IR 192
I0922 13:53:15.199077 OrthancFindRequestHandler.cpp:640] (0008,0020) StudyDate = 20200922-20200923
I0922 13:53:15.199088 OrthancFindRequestHandler.cpp:640] (0008,0030) StudyTime =
I0922 13:53:15.199098 OrthancFindRequestHandler.cpp:640] (0008,0050) AccessionNumber =
I0922 13:53:15.199108 OrthancFindRequestHandler.cpp:640] (0008,0052) QueryRetrieveLevel = STUDY
I0922 13:53:15.199119 OrthancFindRequestHandler.cpp:640] (0008,0061) ModalitiesInStudy = CR
I0922 13:53:15.199129 OrthancFindRequestHandler.cpp:640] (0010,0010) PatientName =
I0922 13:53:15.199139 OrthancFindRequestHandler.cpp:640] (0020,000d) StudyInstanceUID =
I0922 13:53:15.199149 OrthancFindRequestHandler.cpp:640] (0020,0010) StudyID =
I0922 13:53:15.199289 PluginsManager.cpp:172] Preparing MySQL statement: SELECT series.publicId, MIN(instances.publicId) FROM (SELECT series.publicId, series.internalId FROM Resources AS series INNER JOIN Resources studies ON studies.internalId=series.parentId INNER JOIN DicomIdentifiers t0 ON t0.id = studies.internalId AND t0.tagGroup = 8 AND t0.tagElement = 32 INNER JOIN DicomIdentifiers t1 ON t1.id = studies.internalId AND t1.tagGroup = 8 AND t1.tagElement = 32 INNER JOIN MainDicomTags t2 ON t2.id = series.internalId AND t2.tagGroup = 8 AND t2.tagElement = 96 WHERE series.resourceType = 2 AND t0.value >= ? AND t1.value <= ? AND t2.value = ? LIMIT 101) series INNER JOIN Resources instances ON instances.parentId = series.internalId GROUP BY series.publicId
I0922 13:53:15.204247 ServerContext.cpp:958] Number of candidate resources after fast DB filtering on main DICOM tags: 8
I0922 13:53:15.220599 ServerContext.cpp:1083] Number of matching resources: 8

API /tools/find does not
{“Level”:“Study”,“Expand”:true,“Limit”:101,“Query”:{“Modality”:“CR”,“StudyDate”:“20200922-20200923”}}

I0922 14:04:06.848136 HttpServer.cpp:817] POST /tools/find
I0922 14:04:06.849302 PluginsManager.cpp:172] Preparing MySQL statement: SELECT studies.publicId, MIN(instances.publicId) FROM (SELECT studies.publicId, studies.internalId FROM Resources AS studies INNER JOIN Resources series ON studies.internalId=series.parentId INNER JOIN MainDicomTags t0 ON t0.id = series.internalId AND t0.tagGroup = 8 AND t0.tagElement = 96 INNER JOIN DicomIdentifiers t1 ON t1.id = studies.internalId AND t1.tagGroup = 8 AND t1.tagElement = 32 INNER JOIN DicomIdentifiers t2 ON t2.id = studies.internalId AND t2.tagGroup = 8 AND t2.tagElement = 32 WHERE studies.resourceType = 1 AND lower(t0.value) = lower(?) AND t1.value >= ? AND t2.value <= ? LIMIT 101) studies INNER JOIN Resources series ON series.parentId = studies.internalId INNER JOIN Resources instances ON instances.parentId = series.internalId GROUP BY studies.publicId
I0922 14:04:06.854740 ServerContext.cpp:958] Number of candidate resources after fast DB filtering on main DICOM tags: 8
I0922 14:04:06.870317 ServerContext.cpp:1083] Number of matching resources: 0

SQL queries differ as I see.

What I can do with that ? Thanks
Orthanc 1.7.4 + MySQL

Hello,

You are not providing the same request to C-FIND SCP and to “/tools/find”.

Replace:

{“Level”:“Study”,“Expand”:true,“Limit”:101,“Query”:{“Modality”:“CR”,“StudyDate”:“20200922-20200923”}}

By:

{“Level”:“Study”,“Expand”:true,“Limit”:101,“Query”:{“ModalitiesInStudy”:“CR”,“StudyDate”:“20200922-20200923”}}

Sébastien-

Thanks again, Sébastien
I’m a bit confused about the “Query” parameters.
Docs and examples gave me Modality, StudyDate and PatientID only.

среда, 23 сентября 2020 г. в 12:51:29 UTC+7, s.jo...@gmail.com:

“Query” can contain any DICOM tag that makes sense at the “Level” of interest, either in hexadecimal format (e.g. “0008,0061”), or using its symbolic name (e.g. “ModalitiesInStudy”).