Black box testing a remote DICOM Q/R server
Asked Answered
P

2

6

I am wondering if anyone has ever tried to work on the following issue. I need to execute a series of test on a remote DICOM Q/R server. This would allow some easy DICOM Conformance Statement checking.

As an implementation detail of the test suite, I am running the following (DCMTK style command):

$ findscu --study --cancel 1 --key 0020,0010=* --key 8,52=STUDY --aetitle MINE --call THEIR dicom.example.com 11112 

The goal here is to find a valid StudyID (later on I'll use that StudyID to execute lower key level C-FIND, and some related C-MOVE queries). Of course it would be much easier if I could upload my own dataset and try to fetch it back, but I cannot do that against a running PACS in a clinical environment. I need to define with a minimal number of queries how to find a valid StudyID.

However I fear that some DICOM implementation may have policies where quering the entire database is forbidden.

So I was wondering if anyone has written a list of those policies, and maybe describe a way to retrieve a valid StudyID from a remote server with a minimal number of C-FIND queries.

Patristic answered 18/5, 2014 at 8:19 Comment(3)
The remote server has to publish their own DICOM conformance statement. Are you looking to validate their entire conformance statement?Highness
Regarding query permissions, if you can query at all, why then would the remote server prevent you querying under certain conditions? Usually it just goes: AE TITLE MINE has query permissions or not.Highness
usually is the word, I just need to check, that's the whole point.Patristic
P
4

I think I may simply go with:

TODAY=`date +"%Y%m%d"`
findscu --study --key 0008,0020="$TODAY-" --key 0020,0010=* --key 8,52=STUDY --aetitle MINE --call THEIR dicom.example.com 11112

If this does not work (return empty), I'll check yesterday results.

Patristic answered 18/5, 2014 at 8:51 Comment(1)
I concur, doing a Today query against the database, and looking for valid Study IDs is the way to go. The PACS server must be optimized to run this type of query, the results should be limited, and you should be bound to get a valid response in the results.Copy
A
4

Welcome to DICOM-wonderland.

You are right that you should be very, very, very, very careful to run just random queries on a clinical PACS. I've seen commercial PACses send their whole(!) database as a result of a query which it did not understand. Not a pretty sight. This (and privacy) is one of the reasons that in a lot of hospitals around the world PACS admins are very afraid of giving direct access to their PACS via DICOM.

In general I would say that standardization is not going to help you. So you have to find something which works for you, and which will not get bring the PACS down. No guarantees here.

Just a list of observations from querying PACSes in hospitals:

  • Some are case sensitive in their matching, some are not.
  • Most support some kind of wild card. This normally is a '*'. but I've also seen '%' (since that is a SQL wildcard, and the query is just passed as a SQL string). This is not well-defined I think.
  • The list you will get back might be limited to say the first 500 entries. Or 1000. Or random number between 500 and 1000. Or the whole PACS. You just don't know.
  • DICOM and cancellation do not play well. Cancelling a query is not implemented well. Normally a PACS sees it as a failed transfer, and will retry after some time. And the retry-queue is limited in size, so it might ignore new queries. So always let your STORE-SCP server running to drain this queue.
  • Sometimes queries take minutes, especially for retrieve. The next time it might have been retrieved (from tape?) and be fast for a while.
  • A DICOM query may take a lot of resources from the PACS, depending on the PACS. Don't be suprised if a PACS admin shows up if you experiment a little too much.
  • The queries supported differ very much. Only basic queries are supported by all: list of patients, list of studyID/study instanceuid for patients, list of series per study, retrieve study or series. Unless you get a funky research department which uses Osirix, which does not support patient-level queries but only study-level-queries.

So what I would advise if you want to have something working on any random PACS:

  • Use empty-return-key instead of '*'. This is the DICOM way to retrieve information.
  • Do not use '-cancel'. If you really need to cancel, just close the TCP connection (not supported in DCMTK)
  • Use a query on PatientId, PatientName, Birthdate, StudyDate to get a list of StudyIDs/StudyInstanceUids.

The simplest is just use a fixed StudyID, assuming that it stays in the PACS long enough. If not, think of a limiting query to not overload the PACS (the 'TODAY' suggestion of you fitted that description).

Good luck!

Antilogy answered 22/5, 2014 at 20:35 Comment(1)
It is legal for a StudyID to be empty, therefore one need to use StudyInstanceUID to be portable.Patristic

© 2022 - 2024 — McMap. All rights reserved.