The following code snippet successfully retrieved study information from a GE MRI scanner:
Code: Select all
OFString QueryFileName = "QueryInput.dcm";
DcmFileFormat QueryFile;
QueryFile.getDataset()->putAndInsertString(DCM_QueryRetrieveLevel, "STUDY");
QueryFile.getDataset()->putAndInsertString(DCM_StudyDate, "");
QueryFile.getDataset()->putAndInsertString(DCM_StudyTime, "");
QueryFile.getDataset()->putAndInsertString(DCM_AccessionNumber, "");
QueryFile.getDataset()->putAndInsertString(DCM_PatientName, "");
QueryFile.getDataset()->putAndInsertString(DCM_PatientID, "*bobo*");
QueryFile.getDataset()->putAndInsertString(DCM_StudyID, "");
OFCondition result = QueryFile.saveFile(QueryFileName.c_str(), EXS_LittleEndianImplicit,EET_UndefinedLength, EGL_withoutGL);
OFList<OFString> QueryFileNameList;
QueryFileNameList.push_back(QueryFileName);
OFList<OFString> lOverrideKeys;
DcmFindSCU * FindSCU = new DcmFindSCU();
result = FindSCU->initializeNetwork(10);
result = FindSCU->performQuery(PeerIPAddress,
PeerPort,
"FINDSCU",
PeerAETitle,
UID_FINDStudyRootQueryRetrieveInformationModel,
EXS_LittleEndianImplicit,
DIMSE_NONBLOCKING,
2,
ASC_DEFAULTMAXPDU,
OFFalse,
OFFalse,
1,
OFTrue,
500,
&lOverrideKeys,
NULL,
&QueryFileNameList);
FindSCU->dropNetwork();
delete FindSCU;
Code: Select all
DcmSCU * DicomSCU = new DcmSCU();
DicomSCU->setAETitle("FINDSCU");
DicomSCU->setPeerAETitle(PeerAETitle);
DicomSCU->setPeerHostName(PeerIPAddress);
DicomSCU->setPeerPort(PeerPort);
DicomSCU->setDIMSEBlockingMode(DIMSE_NONBLOCKING);
DicomSCU->setDIMSETimeout(2);
DicomSCU->setMaxReceivePDULength(ASC_DEFAULTMAXPDU);
OFList<OFString> TransferSyntaxes;
TransferSyntaxes.push_back(UID_LittleEndianImplicitTransferSyntax);
DicomSCU->addPresentationContext(UID_FINDStudyRootQueryRetrieveInformationModel, TransferSyntaxes);
OFCondition result = DicomSCU->initNetwork();
result = DicomSCU->negotiateAssociation();
T_ASC_PresentationContextID cxID = DicomSCU->findPresentationContextID(UID_FINDStudyRootQueryRetrieveInformationModel, "");
DcmDataset findParams;
findParams.putAndInsertString(DCM_QueryRetrieveLevel, "STUDY");
findParams.putAndInsertString(DCM_StudyDate, "");
findParams.putAndInsertString(DCM_StudyTime, "");
findParams.putAndInsertString(DCM_AccessionNumber, "");
findParams.putAndInsertString(DCM_PatientName, "");
findParams.putAndInsertString(DCM_PatientID, "*bobo*");
findParams.putAndInsertString(DCM_StudyID, "");
FINDResponses responses;
result = DicomSCU->sendFINDRequest(cxID, &findParams, &responses);
DicomSCU->closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
DcmDataset *dset;
OFListIterator(FINDResponse*) it = responses.begin();
while (it != responses.end())
{
FINDResponse* rsp = *it;
dset = rsp->m_dataset;
if (dset != NULL)
{
OFString PatientName;
result = dset->findAndGetOFString(DCM_PatientName, PatientName);
}
it++;
}
Can someone please show me the difference that I am not seeing?
Sean