Modality Worklist data is not received.

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
minhosoft
Posts: 3
Joined: Mon, 2017-12-04, 15:20

Modality Worklist data is not received.

#1 Post by minhosoft »

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.

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Modality Worklist data is not received.

#2 Post by Michael Onken »

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

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

Re: Modality Worklist data is not received.

#3 Post by minhosoft »

Thank you for answer.

But it is not a solution.

There seems to be another problem.

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

Re: Modality Worklist data is not received.

#4 Post by minhosoft »

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();
}
}

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Modality Worklist data is not received.

#5 Post by Michael Onken »

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

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Modality Worklist data is not received.

#6 Post by J. Riesmeier »

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: Select all

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.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest