Possible problem with OrthancPluginWorklistIsMatch

Hello,

I’ve been sending DICOM CFind requests for worklists and there appears to be a problem with the OrthancPluginWorklistIsMatch function.

Say we have the following WL:

`

(0008,0005), 10, CS, Specific Character Set: ISO_IR 100
(0008,0050), 6, SH, Accession Number: 00000
(0010,0010), 16, PN, Patient’s Name: VIVALDI^ANTONIO
(0010,0020), 8, LO, Patient ID: AV35674
(0010,0030), 8, DA, Patient’s Birth Date: 16780304
(0010,0040), 2, CS, Patient’s Sex: M
(0010,2000), 10, LO, Medical Alerts: METASTASIS
(0010,2110), 6, LO, Contrast Allergies: TANTAL
(0020,000D), 26, UI, Study Instance UID: 1.2.276.0.7230010.3.2.101
(0032,1032), 6, PN, Requesting Physician: SMITH
(0032,1060), 6, LO, Requested Procedure Description: EXAM6
(0040,0100), -1, SQ, Scheduled Procedure Step Sequence:
(FFFE,E000), -1, , Item:
(0008,0060), 2, CS, Modality: CT
(0032,1070), 12, LO, Requested Contrast Agent: BARIUMSULFAT
(0040,0001), 6, AE, Scheduled Station AE Title: CT520
(0040,0002), 8, DA, Scheduled Procedure Step Start Date: 20160316
(0040,0003), 6, TM, Scheduled Procedure Step Start Time: 200000
(0040,0006), 8, PN, Scheduled Performing Physician’s Name: JOHNSON
(0040,0007), 6, LO, Scheduled Procedure Step Description: EXAM74
(0040,0009), 8, SH, Scheduled Procedure Step ID: SPD3445
(0040,0010), 6, SH, Scheduled Station Name: STN456
(0040,0011), 6, SH, Scheduled Procedure Step Location: B34F56
(0040,0012), 0, LO, Pre-Medication:
(0040,0400), 0, LT, Comments on the Scheduled Procedure Step:
(FFFE,E00D), 0, , Item Delimitation Item:
(FFFE,E0DD), 0, , Sequence Delimitation Item:
(0040,1001), 10, SH, Requested Procedure ID: RP454G234
(0040,1003), 4, SH, Requested Procedure Priority: LOW

`

If you send a CFIND with a scheduled date and time filter of 16.03.2016 00:00:00 to 17.03.2016 00:00:00 Orthanc will return nothing, if however you change that to 16.03.2016 00:00:00 to 17.03.2016 23:59:59 (notice the hour to changed) it will return my worklist fine. Given that the scheduled date and time is on the 16th it should have returned it the first time, so I think there is a problem with the OrthancPluginWorklistIsMatch it somehow ignores the date part or checks the time part first.

Hello,

Back to this very old question (sorry for the delay).

Here is how the DICOM standard specifies range matching in C-Find requests:
http://dicom.nema.org/dicom/2013/output/chtml/part04/sect_C.2.html#sect_C.2.2.2.5

In your case, Orthanc would apply the conjunction of range matching “20160316-20160317” on the “Scheduled Procedure Step Start Date” field, and of range matching “000000-000000” on “Scheduled Procedure Step Start Time”. The second range will be empty, so no answer is returned by Orthanc. This is in accordance with the DICOM standard.

To solve your issue, either remove the matching over the “Scheduled Procedure Step Start Time” field if time is not important, or apply the range search on the “Scheduled Procedure Step Start DateTime” (0040,4005). The latter field is the concatenation of a Date and a Time, thus range matching will work as expected.

HTH,
Sébastien-