In
part I of this post, I was in a meeting with a customer reviewing their workstation code and while sitting there I was thinking to myself, why should my customers have to deal with so many details of the DICOM Q/R Service when all they really want is to retrieve a study just like they would have downloaded a zip file from a web site. And thus, later, back in my office I decided to extended the DICOM Toolkit API to include a C-MOVE method that will take care of everything including the incoming association. In today’s post I’m going to use the new MoveAndStore method to talk about the DICOM Query/Retrieve service. We’ll start at the end and then work our way backwards.
C-MOVE is a DICOM command that means this: The calling AE (we) ask the called AE (the PACS) to send all the DICOM Instances that match the identifier to the target AE.
If you're looking for a High-Performance DICOM Server with Query/Retrieve SCP check HRZ's DICOM Server solution.
Here’s how you ask a PACS to send you the DICOM images with RZDCX (version 2.0.1.9).
public void MoveAndStore()
{
// Create an object with the query
matching criteria (Identifier)
DCXOBJ query = new DCXOBJ();
DCXELM e = new DCXELM();
e.Init((int)DICOM_TAGS_ENUM.patientName);
e.Value = DOE^JOHN";
query.insertElement(e);
e.Init((int)DICOM_TAGS_ENUM.patientID);
e.Value = @"123456789";
query.insertElement(e);
// Create an accepter to handle the
incomming association
DCXACC accepter = new
DCXACC();
accepter.StoreDirectory = @".\MoveAndStore";
Directory.CreateDirectory(accepter.StoreDirectory);
// Create a requester and run the query
DCXREQ requester = new
DCXREQ();
requester.MoveAndStore(
MyAETitle, // The AE title
that issue the C-MOVE
IS_AE, // The PACS AE title
IS_Host, // The PACS IP address
IS_port, // The PACS listener port
MyAETitle, // The AE title
to send the
query, // The matching criteria
104, // The port to receive the results
accepter); // The accepter
to handle the results
}
Behind this rather short function hides a lot of DICOM networking and when it returns we should have all the matching objects stored in the directory “.\MoveAndStore”. Readers with some practical DICOM experience probably expect me to say that it can also fail. In that case MoveAndStore throws an exception with the error code and description. Sometimes you would have to set the detailed logging on and start reading logs like we did in
chapter 5 of this tutorial on
DICOM networking and in some later post we will look together at a DICOM log of a Q/R transaction.
The following diagram, taken from part 2 of the DICOM standard, is commonly seen in DICOM Conformance Statements as the Data Flow diagram of the Q/R Service. These diagrams and their notation are defined by the standard in part 2 that specify the DICOM Conformance Statement – a standard document that every application vendor should provide and that describes how they implemented the standard in their product. At some point we will get to how to read and write these documents.

The vertical dashed line represents the DICOM Protocol Interface between the two applications (it is usually a single dashed line but in this example it got a bit messed up). The arrows accros the interface represents DICOM associations. The arrow points from the application that initiates the association (the requester) to the application that responds to it (the responder or accepter). The upper part of the diagram shows the control chanel where the C-MOVE request is sent and statuses are reported back by the PACS. The lower part of the diagram shows the data chanel where the DICOM instances are sent to the client.