Issue57

Title C-Find matching refactoring required
Priority bug Status in-progress
Superseder Nosy List admin
Assigned To
Keywords Orthanc Core

Created on 2017-07-13.12:56:23 by admin, last changed by admin.

Files
File name Uploaded Type Edit Remove
CR000000.dcm admin, 2020-06-29.15:18:00 application/dicom
Messages
msg265 (view) Author: admin Date: 2017-07-13.12:56:23
[BitBucket user: Alain Mazy]
[BitBucket date: 2017-07-13.10:56:23]

Trying to summarize the overall situation with C-Find:

- worklist plugins uses the HierarchicalMatcher
- standard C-Find handler is customizable for each manufacturer (not the worklist plugin)
- standard C-Find requests can be sanitized by the lua callback IncomingFindRequestFilter (not the worklist plugin)

We should really try to use the same code as much as possible for all C-Finds. 
Ideal implementation: 

- use Hierarchical matcher for standard C-Find too 
- implement manufacturer patches in the Hierarchical matcher 
- call the lua filter on every incoming C-Find request



The following behaviour shall also be investigated:  connect 2 Orthancs.  
On Orthanc A: upload a patient and anonymize it.
The anonymized patient does not have a PatientBirthDate, PatientSex, ...

Therefore, if Orthanc B performs a C-Find on Orthanc A, A will not match the studies because some fields that are requested (PatientBirthDate, PatientSex, ...) are not present in the studies.

The spec is not clear about that: http://dicom.nema.org/medical/dicom/current/output/chtml/part04/sect_C.2.2.2.html
We should also check how other tools behave in this case.
msg266 (view) Author: admin Date: 2020-06-29.15:18:00
[Bugzilla user: s.jodogne@gmail.com]
[Bugzilla date: 2020-06-29T13:18:00+00:00]

Created attachment 65
CR000000.dcm
msg267 (view) Author: admin Date: 2017-07-19.18:23:55
[BitBucket user: Alain Mazy]
[BitBucket date: 2017-07-19.16:23:55]

https://groups.google.com/forum/#!topic/comp.protocols.dicom/3jKD65ge7E8
msg268 (view) Author: admin Date: 2018-04-23.10:24:55
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-04-23.08:24:55]

The fact that the find fails in case one of the searched dicom tag is null is also affecting the search in OrthancExplorer2:

- upload an instance from the ORTHO patient (attached),
- perform the following `tools/find` request: 
```
curl 'http://localhost:8042/tools/find' --data-binary '{"Level":"Patient","CaseSensitive":false,"Query":{"AccessionNumber":"*","PatientBirthDate":"*","PatientID":"*","PatientName":"*O*","PatientSex":"*","StudyDate":"*","StudyDescription":"*"},"Limit":10,"Since":0}'
```
- this will return no result
- note that this happens with all anonymized instances since they usually lose their `PatientSex` and `PatientBirthDate`
msg269 (view) Author: admin Date: 2018-09-19.21:14:54
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2018-09-19.19:14:54]

Since Orthanc 1.4.2, this issue is partially fixed. The new `IncomingWorklistRequestFilter()` Lua callback can be used to sanitize incoming C-FIND requests for worklists.

Related changeset: https://hg.orthanc-server.com/orthanc/changeset/d4fd4614f2756a1efb5088d7297f27fa86c57b13
msg270 (view) Author: admin Date: 2019-01-24.18:27:26
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2019-01-24.17:27:26]

This is closely related to issue #90, that is fixed since Orthanc 1.5.3: bug 90
History
Date User Action Args
2026-07-29 15:51:20admincreate