20 #define QT_NO_CAST_TO_ASCII 23 #include "dcmtk/dcmtls/tlstrans.h" 24 #include "dcmtk/dcmtls/tlslayer.h" 48 d->
socket =
new QTcpSocket(
this);
66 OFList<OFString> overrideKeys;
67 overrideKeys.push_back ( ( QString (
"QueryRetrieveLevel=" ) + QString (
"" "PATIENT" "" ) ).toUtf8().data() );
68 overrideKeys.push_back ( ( QString (
"PatientName=" ) + patientName ).toUtf8().data() );
71 overrideKeys.push_back ( QString (
"PatientID" ).toUtf8().data() );
72 overrideKeys.push_back ( QString (
"PatientSex=" + patientSex ).toUtf8().data() );
73 overrideKeys.push_back ( QString (
"PatientBirthDate" ).toUtf8().data() );
81 this->
findStudiesScu ( patientName,
"*", QDate ( 1900,01,01 ).toString (
"yyyyMMdd" ),QDate::currentDate().toString (
"yyyyMMdd" ) );
86 this->
findStudiesScu ( patientName, studyDescription, QDate ( 1900,01,01 ).toString (
"yyyyMMdd" ),QDate::currentDate().toString (
"yyyyMMdd" ) );
91 OFList<OFString> overrideKeys;
92 overrideKeys.push_back ( ( QString (
"QueryRetrieveLevel=" ) + QString (
"" "STUDY" "" ) ).toUtf8().data() );
93 overrideKeys.push_back ( ( QString (
"PatientName=" ) + patientName ).toUtf8().data() );
94 overrideKeys.push_back ( ( QString (
"StudyDescription=" ) + studyDescription ).toUtf8().data() );
95 overrideKeys.push_back ( QString (
"StudyDate=" + startDate +
"-" + endDate ).toUtf8().data() );
98 overrideKeys.push_back ( QString (
"StudyInstanceUID" ).toUtf8().data() );
106 this->
findSeriesScu ( patientName, studyUID,
"*",
"*",
"*" );
111 this->
findSeriesScu ( patientName, studyUID, studyDescription,
"*", modality );
114 void QtDcmFindScu::findSeriesScu (
const QString &patientName,
const QString &studyUID,
const QString &studyDescription,
const QString &serieDescription,
const QString &modality)
116 OFList<OFString> overrideKeys;
117 overrideKeys.push_back ( ( QString (
"QueryRetrieveLevel=" ) + QString (
"" "SERIES" "" ) ).toUtf8().data() );
118 overrideKeys.push_back ( ( QString (
"PatientName=" ) + patientName ).toUtf8().data() );
119 overrideKeys.push_back ( QString (
"StudyInstanceUID=" + studyUID ).toUtf8().data() );
120 overrideKeys.push_back ( QString (
"StudyDescription=" + studyDescription ).toUtf8().data() );
121 overrideKeys.push_back ( ( QString (
"SeriesDescription=" ) + serieDescription ).toUtf8().data() );
122 overrideKeys.push_back ( QString (
"Modality=" + modality ).toUtf8().data() );
125 overrideKeys.push_back ( QString (
"StudyDate" ).toUtf8().data() );
128 overrideKeys.push_back ( QString (
"SeriesInstanceUID" ).toUtf8().data() );
129 overrideKeys.push_back ( QString (
"InstitutionName" ).toUtf8().data() );
130 overrideKeys.push_back ( QString (
"InstitutionAddress" ).toUtf8().data() );
131 overrideKeys.push_back ( QString (
"PerformingPhysicianName" ).toUtf8().data() );
132 overrideKeys.push_back ( QString (
"AcquisitionNumber" ).toUtf8().data() );
133 overrideKeys.push_back ( QString (
"NumberOfSeriesRelatedInstances" ).toUtf8().data() );
140 OFList<OFString> overrideKeys;
141 overrideKeys.push_back ( ( QString (
"QueryRetrieveLevel=" ) + QString (
"" "IMAGE" "" ) ).toUtf8().data() );
142 overrideKeys.push_back ( QString (
"SeriesInstanceUID=" + seriesUID ).toUtf8().data() );
145 overrideKeys.push_back ( QString (
"SOPInstanceUID" ).toUtf8().data() );
146 overrideKeys.push_back ( QString (
"InstanceNumber" ).toUtf8().data() );
153 OFList<OFString> overrideKeys;
154 overrideKeys.push_back ( ( QString (
"QueryRetrieveLevel=" ) + QString (
"" "IMAGE" "" ) ).toUtf8().data() );
159 overrideKeys.push_back ( QString (
"SOPInstanceUID="+ imageUID ).toUtf8().data() );
167 d->
socket->setSocketOption ( QAbstractSocket::LowDelayOption, 1 );
169 if ( d->
socket->waitForConnected ( timeout ) ) {
170 d->
socket->disconnectFromHost();
183 OFList<OFString> fileNameList;
185 OFList<OFString> keys = overrideKeys;
202 UID_FINDPatientRootQueryRetrieveInformationModel, EXS_Unknown,
203 DIMSE_BLOCKING, 0, ASC_DEFAULTMAXPDU,
false,
false, 1,
false, -1, &keys, &callback, &fileNameList ).bad() ) {
207 if ( findscu.dropNetwork().bad() ) {
QString port() const
PACS server port getter (QtDcm only ports between 1000 and 100000)
void findImagesScu(const QString &seriesUID)
static QtDcmPreferences * instance()
bool doQuery(const OFList< OFString > &overrideKeys, QtDcmFindCallback::cbType level)
QtDcmServer currentPacs() const
QString aetitle() const
PACS AETitle getter.
static QtDcmManager * instance()
QtDcmFindScu(QObject *parent=0)
This class is in charge of the different process (dcm2nii), pacs query/retrieve (dcm4chee), temporary directory creation and removing, PACS server settings.
void findPatientsScu(const QString &patientName)
void displayErrorMessage(const QString &message)
Convenience method that display error message in a QMessageBox window.
QString aetitle() const
QtDcm local AETitle getter.
bool checkServerConnection(int timeout=10000)
test if the current selected pacs is available returns false if timeout (10sec) is reached ...
void findStudiesScu(const QString &patientName)
void findImageScu(const QString &imageUID)
void findSeriesScu(const QString &patientName, const QString &studyUID)
QString address() const
PACS server hostname getter.