SOLVED: Creating a FIND-RSP sequence

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Juan Bravo
Posts: 17
Joined: Tue, 2006-05-09, 10:07
Location: Málaga, Spain
Contact:

SOLVED: Creating a FIND-RSP sequence

#1 Post by Juan Bravo »

Hello,

I've a trouble when trying to compose answers
for a FIND query. I've modified DIMSE_findProvider
for just generating a standard response to any find
query.

This is the pseudocode,


bzero((char*)&rsp, sizeof(rsp));

// FIRST RESPONSE
rsp.DimseStatus = 65280; // STATUS_Pending
rspIds = new DcmDataset;
DU_putStringDOElement(rspIds, DcmTagKey(16,4128), "Response1");
DU_putStringDOElement(rspIds, DcmTagKey(16,4224), "Response1");
DIMSE_sendFindResponse(assoc, presIdCmd, request, &rsp, rspIds, statusDetail);
delete rspIds;

// SECOND RESPONSE
rsp.DimseStatus = 65280; // STATUS_Pending
rspIds = new DcmDataset;
DU_putStringDOElement(rspIds, DcmTagKey(16,4128), "Response2");
DU_putStringDOElement(rspIds, DcmTagKey(16,4224), "Response2");
DIMSE_sendFindResponse(assoc, presIdCmd, request, &rsp, rspIds, statusDetail);
delete rspIds;

// THIRD RESPONSE
rsp.DimseStatus = 65280; // STATUS_Pending
rspIds = new DcmDataset;
DU_putStringDOElement(rspIds, DcmTagKey(16,4128), "Response3");
DU_putStringDOElement(rspIds, DcmTagKey(16,4224), "Response3");
DIMSE_sendFindResponse(assoc, presIdCmd, request, &rsp, rspIds, statusDetail);
delete rspIds;

// LAST RESPONSE
rsp.DimseStatus = 0; // STATUS_Success
DIMSE_sendFindResponse(assoc, presIdCmd, request, &rsp, rspIds, statusDetail);



With this code, I get the following response by
using FINDSCU,

RESPONSE: 1 (Pending)
# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0010,1020) DS [Response1 ] # 10, 1 PatientsSize
(0010,1080) LO [Response1 ] # 10, 1 MilitaryRank
--------
RESPONSE: 2 (Pending)
# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0010,1020) DS [Response2 ] # 10, 1 PatientsSize
(0010,1080) LO [Response2 ] # 10, 1 MilitaryRank
--------
RESPONSE: 3 (Pending)
# Dicom-Data-Set
# Used TransferSyntax: LittleEndianExplicit
(0010,1020) DS [Response3 ] # 10, 1 PatientsSize
(0010,1080) LO [Response3 ] # 10, 1 MilitaryRank
--------
findscu: Find Failed, query keys:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0008,0052) CS [PATIENT ] # 8, 1 QueryRetrieveLevel
(0010,0010) PN [testing ] # 10, 1 PatientsName
(0010,0020) LO (no value available) # 0, 0 PatientID
0006:0317 Peer aborted Association (or never connected)


I get all the responses perfectly, but fail when attempting to
set the last message flags. What I'm doing wrong? Thanks ;)
Last edited by Juan Bravo on Mon, 2006-07-24, 08:47, edited 1 time in total.

Juan Bravo
Posts: 17
Joined: Tue, 2006-05-09, 10:07
Location: Málaga, Spain
Contact:

#2 Post by Juan Bravo »

This is the correct pseudocode,

// LAST RESPONSE
rsp.DimseStatus = 0; // STATUS_Success
rspIds=NULL;
DIMSE_sendFindResponse(assoc, presIdCmd, request, &rsp, rspIds, statusDetail);

I forgot to clear pointer adress!

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 1 guest