# Query worked but retrieve didn't

**URL:** <https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928>\
**Category:** Support\
**Created:** [August 23, 2017, 4:30am UTC](https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928 "2017-08-23T04:30:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ningrong\_Ye](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@Ningrong\_Ye](https://discourse.slicer.org/u/Ningrong_Ye)\
**Post date:** [August 23, 2017, 4:30am UTC](https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928/1 "2017-08-23T04:30:46Z")

</div>

Operating system: Windows7 and Linux Redhat7  
Slicer version: Slicer-4.7.0  
Expected behavior: query and retrieve  
Actual behavior: query work and retrieve not.  
first I install Slicer 4.7 in Linux Redhat7, use it to connect with hospital’s PACS,  
query work, I can receive all the patient data, but retrieve did.  
when I click “retrieve” terminal shown:  
About to retrieve 1.2.840.11\*\*\*\*.523\*\*\*.500.\*\*\*_ **.20170822132** _ from PACS\_IP  
Starting to retrieve  
Starting moveStudy  
Negotiating Association  
I: Requesting Association  
I: Association Accepted (Max Send PDV: 28660)  
Setting Retrieve Parameters  
Sending Move Request  
I: Sending C-MOVE Request (MsgID 1)  
I: Received C-MOVE Response (Failed: IdentifierDoesNotMatchSOPClass)  
setting value to 0  
E: Identifier does not match SOP class in C-MOVE response  
MOVE response receveid with status: Failed: IdentifierDoesNotMatchSOPClass  
MOVE request failed, server does report error  
MOVE request failed: Status Detail:  
# Dicom-Data-Set  
# Used TransferSyntax: Little Endian Implicit  
(0000,0901) AT (0000,0600) # 4, 1 OffendingElement  
(0000,0902) LO [MOVE\_REQUEST\_IMPROPERLY\_FORMATED] # 32, 1 ErrorComment’

then I try Steve Pieper’s suggestion:

> [@Query and Retrieve](https://discourse.slicer.org/t/query-and-retrieve/378/4):
>
> A couple suggestions:
> 
> check if CGET is supported on your scanner. If not, you need to be running the Listener on the Slicer side and your scanner needs to be configured to be able to send to it.
> 
> the Slicer listener runs as an independent process (storescp) so you can use our OS tools to look at that process to see what the command line arguments are and use the DCMTK documentation to understand how those map to what your scanner expects.
> 
> Often debugging is easiest by using the command line tools independent of Slicer to confirm all the settings and then copy them to Slicer.
> 
> Here are some notes about using dcmtk command line tools for storage, query:
> 
> [CTSC:ARRA:Mockup - NAMIC Wiki](https://www.na-mic.org/Wiki/index.php/CTSC:ARRA:Mockup#PACS)
> 
> And a test at the CTK level that shows how the communication works and it might give you some clues:

I try both cget and cmove, both not work.  
then I install dcmtk,  
this time findscu also work well, but movescu didn’t, the script is as follow:  
`./movescu --patient --key 0020,000d=1.2.840.113619.2.327.3.1695 *****.707.15********.459 --output-directory /home1/try --write-file --aetitle My_NAME --call PACS_NAME PACS_IP PORT`  
Result is:  
`W: Move response with error status (Failed: IdentifierDoesNotMatchSOPClass)`

Then I try to use windows version: Slicer-4.7.0  
This time also install another software **Radiant** to test is there is something wrong with PACS server.  
But with the same setting, Radiant can query and retrieve all the image. but Slicer still can only query.  
When come to retrieve,  
Slicer the terminal shows:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/a/7acc367963261f248706e69e7793b2d9a153bd28.png)

I will greatly appreciate any response.

Thanks

Regards

Ningrong

---

<div class="post-metadata">

**Author:** ![Ningrong\_Ye](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@Ningrong\_Ye](https://discourse.slicer.org/u/Ningrong_Ye)\
**Post date:** [August 23, 2017, 4:32am UTC](https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928/2 "2017-08-23T04:32:26Z")

</div>

Hi all,  
I’m using Redhat7, installed Slicer-4.7.0-2017-08-16-linux-amd64

Here is my problem,  
I try to query from our hospital’s server.  
I work, I can get all patients data.  
But, I can’t retrieve any from the server.(I try both C-get and C-move both are not work )  
from terminal I found:

```
I: Requesting Association
I: Association Accepted (Max Send PDV: 28660)
Setting Retrieve Parameters
Sending Move Request
I: Sending C-MOVE Request (MsgID 1)
I: Received C-MOVE Response (Failed: IdentifierDoesNotMatchSOPClass)
setting value to 0
E: Identifier does not match SOP class in C-MOVE response
MOVE response receveid with status: Failed: IdentifierDoesNotMatchSOPClass
MOVE request failed, server does report error
MOVE request failed: Status Detail: 
# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0000,0901) AT (0000,0600) # 4, 1 OffendingElement
(0000,0902) LO [MOVE_REQUEST_IMPROPERLY_FORMATED] # 32, 1 ErrorComment

```

then I try to use Steve Pieper’s advice

> [@Query and Retrieve](https://discourse.slicer.org/t/query-and-retrieve/378/4):
>
> A couple suggestions:
> 
> check if CGET is supported on your scanner. If not, you need to be running the Listener on the Slicer side and your scanner needs to be configured to be able to send to it.
> 
> the Slicer listener runs as an independent process (storescp) so you can use our OS tools to look at that process to see what the command line arguments are and use the DCMTK documentation to understand how those map to what your scanner expects.
> 
> Often debugging is easiest by using the command line tools independent of Slicer to confirm all the settings and then copy them to Slicer.
> 
> Here are some notes about using dcmtk command line tools for storage, query:
> 
> [CTSC:ARRA:Mockup - NAMIC Wiki](https://www.na-mic.org/Wiki/index.php/CTSC:ARRA:Mockup#PACS)
> 
> And a test at the CTK level that shows how the communication works and it might give you some clues:

I download and install dcmtk,  
Also findscu works, but movescu not;  
here is the script:  
` movescu --patient --key 0020,000d=1.2.840.113619.2.327.3.1695170825.707.1503019605.111 --output-directory /home1/try --write-file --aetitle MYAT --call SERVER IP_address Port`  
result is:  
` W: Move response with error status (Failed: IdentifierDoesNotMatchSOPClass)`

I will appreciate any suggestions.  
Thanks  
Ningrong

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 23, 2017, 8:50pm UTC](https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928/3 "2017-08-23T20:50:03Z")

</div>

Hi Ningrong -

Were you also running `storescp`? The way these DIMSE commands work is that the `movescu` (move user) requests that the data be sent to a `storescp` (store provider).

Slicer runs a `storescp` process (controlled by the Listener button) and configured in the query dialog. But your server (the move provider) needs to be appropriately configured to allow it to send to Slicer’s `storescp`.

Diagnosing these things is notoriously painful.

there are some hopefully helpful resources on the wiki:

[https://www.slicer.org/wiki/Documentation/Nightly/Modules/DICOM#References](https://www.slicer.org/wiki/Documentation/Nightly/Modules/DICOM#References)

This is a great book on the topic:

> **[Digital Imaging and Communications in Medicine (DICOM): A Practical Introduction and Survival Guide](https://www.amazon.com/Digital-Imaging-Communications-Medicine-DICOM/dp/3642108490/ref=dp_ob_title_bk)**
>
> 4.6 out of 5 stars, 
>   
>   
>   
> $118.99

Hope that helps,  
Steve

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 17, 2020, 11:22am UTC](https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928/4 "2020-01-17T11:22:01Z")

</div>

I succeed connect the GEPACS and but nothing happon when click the retrieve. And the erro information was “no valid presetation contexts”. What should I do next step for retrieve and never installing other software for security?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 17, 2020, 2:29pm UTC](https://discourse.slicer.org/t/query-worked-but-retrieve-didnt/928/5 "2020-01-17T14:29:03Z")

</div>

Query-retrieve can go wrong at many levels. I would recommend to debug with DCMTK’s standalone command-line applications first ([https://support.dcmtk.org/docs/mod\_dcmnet.html](https://support.dcmtk.org/docs/mod_dcmnet.html)) and once everything works, we can help transferring that configuration to work within Slicer.
