knopkem / dicomweb-proxy

A proxy to translate between dicomweb and traditional dicom dimse services (PACS communication)
Other
71 stars 20 forks source link

Query works but retreive data fail... #124

Closed mrtesloni closed 1 year ago

mrtesloni commented 1 year ago

I tested dicomweb-proxy from git master branch. I was tried to pair it with dcm4chee-arc-light docker based. Query works without problems. But when I select the study I want to see in the OHIF Viewer the transfer starts but quickly stops with an error status of "D: DIMSE Status : 0xa900: Failed: Identifier does not match SOP Class" [no PatientID passed in request to Dicom Server].

I: Sending C-GET Request
D: ===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type                  : C-GET RQ
D: Presentation Context ID       : 1
D: Message ID                    : 1
D: Affected SOP Class UID        : GETPatientRootQueryRetrieveInformationModel
D: Data Set                      : present
D: Priority                      : medium
D: -----------------------------------------------------------------
D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Explicit
D: (0008,0052) CS [SERIES]                                 #   6, 1 QueryRetrieveLevel
D: (0020,000d) UI [1.3.76.2.2.2.688.16.1071.20101115202822] #  40, 1 StudyInstanceUID
D: (0020,000e) UI [1.3.76.2.2.2.688.16.1071.0.20101115202822.1] #  44, 1 SeriesInstanceUID
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-GET Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-GET RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 1
D: Affected SOP Class UID        : none
D: Remaining Suboperations       : none
D: Completed Suboperations       : none
D: Failed Suboperations          : none
D: Warning Suboperations         : none
D: Data Set                      : none
D: DIMSE Status                  : 0xa900: Failed: Identifier does not match SOP Class
D: ======================= END DIMSE MESSAGE =======================
D: Response has status detail:
D: 
D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Implicit
D: (0000,0901) AT (0010,0020)                              #   4, 1 OffendingElement
D: (0000,0902) LO [Missing PatientID (0010,0020)]          #  30, 1 ErrorComment
D: 
D: Handling C-GET Response
E: Identifier does not match SOP class
I: Releasing Association
D: Cleaning up internal association and network structures
13:04:21.227 INFO  fetch finished: 1.3.76.2.2.2.688.16.1071.20101115202822/1.3.76.2.2.2.688.16.1071.0.20101115202822.1
13:04:21.227 INFO  parsing series 1.3.76.2.2.2.688.16.1071.0.20101115202822.1
13:04:21.228 ERROR file does not exist: /home/mrtesloni/dicomweb-proxy/data/1.3.76.2.2.2.688.16.1071.20101115202822/1.3.76.2.2.2.688.0.1071.1.0.20101115203055
13:04:21.228 ERROR 

I also tried with C-move, but I got a similar error.

I: Sending C-MOVE Request
D: ===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type                  : C-MOVE RQ
D: Presentation Context ID       : 1
D: Message ID                    : 1
D: Affected SOP Class UID        : MOVEStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: Priority                      : medium
D: Move Destination              : PROXY
D: -----------------------------------------------------------------
D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Explicit
D: (0008,0052) CS [SERIES]                                 #   6, 1 QueryRetrieveLevel
D: (0020,000d) UI [1.3.76.2.2.2.688.16.1071.20101115202822] #  40, 1 StudyInstanceUID
D: (0020,000e) UI [1.3.76.2.2.2.688.16.1071.0.20101115202822.1] #  44, 1 SeriesInstanceUID
D: ======================= END DIMSE MESSAGE =======================
E: Failed receiving DIMSE response: 0006:0317 Peer aborted Association (or never connected)
I: Aborting Association
E: Association Abort Failed: 0006:0303 DUL Finite State Machine Error: No action defined, state 1 event 14
D: Cleaning up internal association and network structures
12:40:31.402 INFO  fetch finished: 1.3.76.2.2.2.688.16.1071.20101115202822/1.3.76.2.2.2.688.16.1071.0.20101115202822.1
12:40:31.403 INFO  parsing series 1.3.76.2.2.2.688.16.1071.0.20101115202822.1
12:40:31.404 ERROR file does not exist: /home/mrtesloni/dicomweb-proxy/data/1.3.76.2.2.2.688.16.1071.20101115202822/1.3.76.2.2.2.688.0.1071.1.0.20101115203055
12:40:31.404 ERROR 

Then I tried using the latest OHIF Viewer as per your instructions from git and the result was the same. Where am I wrong? What do I have to do in order for dicomweb-proxy to send the required PatientID? Sincerely Yours Rade

mrtesloni commented 1 year ago

After several days (>10) of trying to find where problem really is, 45 minutes after I open this issue we found that we have mismatch in AETITLE record in dcm4chee-arc-light. I'm closing this issue, but I'm leaving some pointers for others to look out for when they start getting crazy errors like the one that plagued us.

the problem arose because in the PACS system the proxy was described with the localhost address instead of the real ip address it was on (it was on the same computer, but it is strange that the errors disappeared when both on the PACS and on the proxy the other side was described with full IP address).

And for dcm4chee-arc You must use C-MOVE for retrieving images... :(

knopkem commented 1 year ago

Hi, Just some late comments. Regarding the localhost issue: I suspect that this comes from a problem of IP4 vs IP6. Node 18 changed how to resolve 'localhost' and now refers to IP6 instead of IP4 as before. This means it listens on ::1/128 instead of 127.0.0.1, so when the PACs still uses IP4 than they can't communicate. To prevent this you should write the localhost IP address (127.0.0.1) in the config. Other remark: dcm4chee-arc supports dicomweb natively and will be faster than the proxy, so I recommend to use it directly. Will try to test CGet with it as it should work. Cheers Michael