DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sun, 2018-01-21, 09:40

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon, 2017-12-04, 16:18 
Offline

Joined: Mon, 2017-12-04, 15:20
Posts: 3
Hi,

I need help.

We implemented a program to import the modality work list using the DcmSCU class as follows.

DcmSCU scu;
scu.setAETitle("AETitle");
scu.setPeerAETitle("Bunny");
scu.setPeerHostName("127.0.0.1");
scu.setPeerPort(3000);
scu.setConnectionTimeout(3);

OFList<OFString> ts;
ts.push_back(UID_LittleEndianExplicitTransferSyntax);
ts.push_back(UID_BigEndianExplicitTransferSyntax);
ts.push_back(UID_LittleEndianImplicitTransferSyntax);
scu.addPresentationContext(UID_VerificationSOPClass, ts);
scu.addPresentationContext(UID_FINDModalityWorklistInformationModel, ts);

OFCondition cond = scu.initNetwork();
if (cond.good())
{
cond = scu.negotiateAssociation();
if (cond.good())
{
T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDModalityWorklistInformationModel, scu);
if (presID != 0)
{
char szDate[256];
SYSTEMTIME tLocalTime;
GetLocalTime(&tLocalTime);
sprintf_s(szDate, 256, "%04u%02u%02u", tLocalTime.wYear, tLocalTime.wMonth, tLocalTime.wDay);

DcmDataset req;
cond = req.putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "PATIENT");

DcmSequenceOfItems *pSequence = new DcmSequenceOfItems(DCM_ScheduledProcedureStepSequence);
DcmItem *pDcmItem = new DcmItem;

cond = pDcmItem->putAndInsertOFStringArray(DCM_Modality, "CR");
cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledProcedureStepStartDate, szDate);

cond = pSequence->insert(pDcmItem);
cond = req.insert(pSequence, OFTrue);

OFList<QRResponse*> findResponses;
cond = scu.sendFINDRequest(presID, &req, &findResponses);
if (cond.good())
{
OFListIterator(QRResponse*) study;
for (study = findResponses.begin(); study != findResponses.end(); study++)
{
if ((*study)->m_dataset != NULL)
{
// There's no branching here.
}
}
}

while (!findResponses.empty())
{
delete findResponses.front();
findResponses.pop_front();
}
}
}
}

scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);

Finally, the query succeeds.

However, there is no data.

What's wrong?

Thank you.

-----------------------------------------------------------------------------------------
P.S
DcmFindSCU :: performQuery also succeeds in the query but fails to fetch data.
Programs using the LEADTOOLS SDK will import data normally.


Top
 Profile  
 
PostPosted: Mon, 2017-12-04, 19:28 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1661
Location: Oldenburg, Germany
Hi

You should remove the line:
cond = req.putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "PATIENT");

... and try again. Above line only makes sense in the Query/Retrieve protocol. At least this is what I see on first sight.

Best,
Michael


Top
 Profile  
 
PostPosted: Tue, 2017-12-05, 03:18 
Offline

Joined: Mon, 2017-12-04, 15:20
Posts: 3
Thank you for answer.

But it is not a solution.

There seems to be another problem.


Top
 Profile  
 
PostPosted: Tue, 2017-12-05, 11:02 
Offline

Joined: Mon, 2017-12-04, 15:20
Posts: 3
I succeeded in getting the worklist by modifying the following.

T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDModalityWorklistInformationModel, scu);
if (presID != 0)
{
DcmDataset req;
cond = req.putAndInsertOFStringArray(DCM_AccessionNumber, "");
cond = req.putAndInsertOFStringArray(DCM_ReferringPhysicianName, "");
cond = req.putAndInsertOFStringArray(DCM_PatientName, "");
cond = req.putAndInsertOFStringArray(DCM_PatientID, "");
cond = req.putAndInsertOFStringArray(DCM_PatientBirthDate, "");
cond = req.putAndInsertOFStringArray(DCM_PatientSex, "");
cond = req.putAndInsertOFStringArray(DCM_StudyInstanceUID, "");
cond = req.putAndInsertOFStringArray(DCM_RequestedProcedureDescription, "");
cond = req.putAndInsertOFStringArray(DCM_CurrentPatientLocation, "");
cond = req.putAndInsertOFStringArray(DCM_PatientInstitutionResidence, "");
cond = req.putAndInsertOFStringArray(DCM_RequestedProcedureComments, "");

DcmSequenceOfItems *pSequence = new DcmSequenceOfItems(DCM_ScheduledProcedureStepSequence);
DcmItem *pDcmItem = new DcmItem;

cond = pDcmItem->putAndInsertOFStringArray(DCM_Modality, "CR");
cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledStationAETitle, "");
char szDate[256];
SYSTEMTIME tLocalTime;
GetLocalTime(&tLocalTime);
sprintf_s(szDate, 256, "%04u%02u%02u-%04u%02u%02u", tLocalTime.wYear, tLocalTime.wMonth, tLocalTime.wDay, tLocalTime.wYear, tLocalTime.wMonth, tLocalTime.wDay);
cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledProcedureStepStartDate, szDate);
cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledProcedureStepStartTime, "");

cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledProcedureStepDescription, "");
cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledProcedureStepID, "");
cond = pDcmItem->putAndInsertOFStringArray(DCM_ScheduledStationName, "");

cond = pSequence->insert(pDcmItem);
cond = req.insert(pSequence, OFTrue);

OFList<QRResponse*> findResponses;
cond = scu.sendFINDRequest(presID, &req, &findResponses);
if (cond.good())
{
OFListIterator(QRResponse*) study;
for (study = findResponses.begin(); study != findResponses.end(); study++)
{
if ((*study)->m_dataset != NULL)
{
// Received data
}
}
}

while (!findResponses.empty())
{
delete findResponses.front();
findResponses.pop_front();
}
}


Top
 Profile  
 
PostPosted: Tue, 2017-12-05, 15:54 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1661
Location: Oldenburg, Germany
Congrats, whatever the problem was... it should never be a problem asking more or less information (attributes), there is no minimum list of attributes that have to be requested, so it's surprising that adding more query attributes work

Best,
Michael


Top
 Profile  
 
PostPosted: Tue, 2017-12-05, 17:02 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
Furthermore, there is no need to pass a date range for ScheduledProcedureStepStartDate; a single date (e.g. the current one) is sufficient.

Instead of the following code lines
Code:
char   szDate[256];
SYSTEMTIME   tLocalTime;
GetLocalTime(&tLocalTime);
sprintf_s(szDate, 256, "%04u%02u%02u", tLocalTime.wYear, tLocalTime.wMonth, tLocalTime.wDay);

you could also simply call DcmDate::getCurrentDate(), which is also portable.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group