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.
Modality Worklist data is not received.
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Modality Worklist data is not received.
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
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
Re: Modality Worklist data is not received.
Thank you for answer.
But it is not a solution.
There seems to be another problem.
But it is not a solution.
There seems to be another problem.
Re: Modality Worklist data is not received.
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();
}
}
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();
}
}
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Modality Worklist data is not received.
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
Best,
Michael
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Modality Worklist data is not received.
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
you could also simply call DcmDate::getCurrentDate(), which is also portable.
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);
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest