Bug 90 - C-Find shall match missing tags to null/empty string
Summary: C-Find shall match missing tags to null/empty string
Status: RESOLVED FIXED
Alias: None
Product: Orthanc
Classification: Unclassified
Component: Orthanc Core (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Assignee: Sébastien Jodogne
URL:
Depends on:
Blocks:
 
Reported: 2020-06-29 15:13 CEST by Sébastien Jodogne
Modified: 2020-06-29 15:24 CEST (History)
0 users

See Also:


Attachments
CR000000.dcm (11.26 MB, application/dicom)
2020-06-29 15:18 CEST, Sébastien Jodogne
Details
1716449192-Capture.PNG (164.26 KB, image/png)
2020-06-29 15:22 CEST, Sébastien Jodogne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sébastien Jodogne 2020-06-29 15:13:48 CEST
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-05-02.08:10:43]

this bug was previously part of [Issue 57](bug 57)

# Steps to reproduce #

- upload an instance from the ORTHO patient (attached),
- perform the following tools/find request:

```
#!python
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}'

```
- the search returns no result because `PatientSex` is missing from the `ORTHO` patient

# additional info #
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.
Comment 1 Sébastien Jodogne 2020-06-29 15:18:02 CEST
Created attachment 66 [details]
CR000000.dcm
Comment 2 Sébastien Jodogne 2020-06-29 15:22:53 CEST
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-12-10.17:18:40]

Note that this also affects the new Orthanc Explorer interface and therefore, some studies might be inaccessible through the web interface.
In this case, I have 3 patients whose name is "MAZY^ALAIN".  Two of them have incomplete tags.  Only one is found in the lookup interface.

![Capture.PNG](1716449192-Capture.PNG)
Comment 3 Sébastien Jodogne 2020-06-29 15:22:55 CEST
Created attachment 100 [details]
1716449192-Capture.PNG
Comment 4 Sébastien Jodogne 2020-06-29 15:22:56 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2018-12-11.12:26:17]

"PatientSex" is a mandatory type 2 DICOM tag, as can be seen using dicom3tools:

```text
$ dciodvfy /tmp/CR000000.dcm 2>&1 | grep Error
Error - Missing attribute Type 2 Required Element=<PatientSex> Module=<Patient>
Error - Missing attribute Type 1C Conditional Element=<DeidentificationMethod> Module=<Patient>
Error - Missing attribute Type 1C Conditional Element=<DeidentificationMethodCodeSequence> Module=<Patient>
Error - Missing attribute Type 2 Required Element=<ReferringPhysicianName> Module=<GeneralStudy>
Error - Missing attribute Type 2 Required Element=<StudyID> Module=<GeneralStudy>
Error - Missing attribute Type 2 Required Element=<AccessionNumber> Module=<GeneralStudy>
Error - Attribute present when condition unsatisfied (which may not be present otherwise) Type 2C Conditional Element=<Laterality> Module=<GeneralSeries>
```

I guess the images from the first comment are invalid as well
Comment 5 Sébastien Jodogne 2020-06-29 15:22:57 CEST
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-12-17.10:20:34]

images from the first comment where linked to a UI problem that has been solved in https://hg.orthanc-server.com/orthanc/changeset/c9c2faf76bec1b3573d389a744ddae241ea2e037
Comment 6 Sébastien Jodogne 2020-06-29 15:24:18 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2019-01-24.17:25:17]

Fixed by changelist: https://hg.orthanc-server.com/orthanc/changeset/cf91b6f222784a9664961569f76ace9d47d52231