Enable Study-level queries without requiring patient info
sjoerdk opened this issue · comments
- dicomtrolley version: 2.1.8
Description
The following code
searcher: DICOMQR
query = Query(
min_study_date=datetime(year=2000, month=1, day=5),
max_study_date=datetime(year=2000, month=1, day=5)
studies = searcher.find_studies(query)
Does not yield any results (studies =[]), even though this is a valid query and a study corresponding to these criteria actually exists.
Tried this on Agfa PACS DICOM-QR.
The issue is probably that dicomtrolley uses the patient as root for the query retrieve model (see https://dicom.nema.org/dicom/2013/output/chtml/part04/sect_C.6.html)
The information model is coded here:
https://github.com/sjoerdk/dicomtrolley/blob/v2.1.8/dicomtrolley/dicom_qr.py#L219
and here
https://github.com/sjoerdk/dicomtrolley/blob/v2.1.8/dicomtrolley/dicom_qr.py#L229
Did some reading and tests to find out what we are talking about.
- The issues is tricky to pin down as it is unclear whether it is in dicomtrolley code, the implementation of the query standard in the specific server, or configuration issues on that server.
- Preliminary tests reveal that using PatientRootQueryRetrieveInformationModelFind in DICOM-QR qeries is indeed causing queries without patientID to return nothing.
Studying https://dicom.nema.org/dicom/2013/output/chtml/part04/sect_C.6.html it seems there is no harm in switching to the Study level information model. In fact, this seems a better fit as throughout dicomtrolley the study, not the patient is the default root level of query and download.
The following query works now for DICOMQR in dicomtrolley >= 2.2.0:
searcher: DICOMQR
query = Query(
min_study_date=datetime(year=2000, month=1, day=5),
max_study_date=datetime(year=2000, month=1, day=5)
studies = searcher.find_studies(query)