sjoerdk / dicomtrolley

Retrieve medical images via WADO, MINT, RAD69 and DICOM-QR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dicomtrolley does not handle valid http 204 - No Content

sjoerdk opened this issue · comments

  • dicomtrolley version: 3.0.2
  • Python version: 3.9

Description

For queries that return no results, a DICOM-web server should return http 204 (No Content). See DICOM docs here:
https://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_8.3.4.4.html

This is not handled in dicomtrolley.
Currently this happens:

trolley.find_studies(Query(PatientName="NonExistingPatient"))
>>> dicomtrolley.exceptions.DICOMTrolleyError: Calling <server_url> failed (204 - No Content)
        response content was b''

Instead the exception should be caught and an empty list should be returned:

trolley.find_studies(Query(PatientName="NonExistingPatient"))
[]