00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef DATAPRIV_H
00030 #define DATAPRIV_H
00031
00032 #include "dcmtk/config/osconfig.h"
00033
00034 #include "dcmtk/dcmnet/dicom.h"
00035 #include "dcmtk/dcmdata/dcdatset.h"
00036 #include "dcmtk/dcmdata/dcuid.h"
00037 #include "dcmtk/dcmdata/dcdeftag.h"
00038 #include "dcmtk/dcmqrdb/dcmqrdbi.h"
00039
00040 BEGIN_EXTERN_C
00041 #ifdef HAVE_IO_H
00042 #define access my_access // Workaround to make Visual C++ Compiler happy!
00043 #include <io.h>
00044 #undef access
00045 #endif
00046 END_EXTERN_C
00047
00050 enum DB_KEY_TYPE
00051 {
00053 UNIQUE_KEY,
00055 REQUIRED_KEY,
00057 OPTIONAL_KEY
00058 };
00059
00062 enum DB_QUERY_CLASS
00063 {
00065 PATIENT_ROOT,
00067 STUDY_ROOT,
00069 PATIENT_STUDY
00070 };
00071
00074 enum DB_KEY_CLASS
00075 {
00077 DATE_CLASS,
00079 TIME_CLASS,
00081 UID_CLASS,
00083 STRING_CLASS,
00085 OTHER_CLASS
00086 };
00087
00088
00092 #define PATIENT_LEVEL_STRING "PATIENT"
00093 #define STUDY_LEVEL_STRING "STUDY"
00094 #define SERIE_LEVEL_STRING "SERIES"
00095 #define IMAGE_LEVEL_STRING "IMAGE"
00096
00097
00098
00099
00100
00101
00102 #define AE_MAX_LENGTH 128
00103 #define AS_MAX_LENGTH 32
00104 #define AT_MAX_LENGTH 32
00105 #define CS_MAX_LENGTH 128
00106 #define DA_MAX_LENGTH 80
00107 #define DS_MAX_LENGTH 128
00108 #define DT_MAX_LENGTH 208
00109 #define FL_MAX_LENGTH 32
00110 #define FD_MAX_LENGTH 64
00111 #define IS_MAX_LENGTH 96
00112 #define LO_MAX_LENGTH 64
00113 #define LT_MAX_LENGTH 10240
00114 #define PN_MAX_LENGTH 64
00115 #define SH_MAX_LENGTH 16
00116 #define SL_MAX_LENGTH 32
00117 #define SS_MAX_LENGTH 16
00118 #define ST_MAX_LENGTH 1024
00119 #define TM_MAX_LENGTH 128
00120 #define UI_MAX_LENGTH 64
00121 #define UL_MAX_LENGTH 32
00122 #define US_MAX_LENGTH 16
00123 #define CS_LABEL_MAX_LENGTH 16
00124 #define DESCRIPTION_MAX_LENGTH 128
00125
00126 #define DBC_MAXSTRING 256
00127
00128 #define MAX_MAX_STUDIES DB_UpperMaxStudies
00129 #define MAX_NUMBER_OF_IMAGES 10000
00130 #define SIZEOF_IDXRECORD (sizeof (IdxRecord))
00131 #define SIZEOF_STUDYDESC (sizeof (StudyDescRecord) * MAX_MAX_STUDIES)
00132
00136 struct DB_SmallDcmElmt
00137 {
00138 public:
00140 DB_SmallDcmElmt();
00141
00143 char* PValueField ;
00144
00146 Uint32 ValueLength ;
00147
00149 DcmTagKey XTag ;
00150
00151 private:
00153 DB_SmallDcmElmt(const DB_SmallDcmElmt& copy);
00155 DB_SmallDcmElmt& operator=(const DB_SmallDcmElmt& copy);
00156 };
00157
00161 struct DB_ElementList
00162 {
00164 DB_ElementList(): elem(), next(NULL) {}
00165
00167 DB_SmallDcmElmt elem ;
00168
00170 struct DB_ElementList *next ;
00171
00172 private:
00174 DB_ElementList(const DB_ElementList& copy);
00176 DB_ElementList& operator=(const DB_ElementList& copy);
00177 };
00178
00179 struct DB_UidList
00180 {
00181 char *patient ;
00182 char *study ;
00183 char *serie ;
00184 char *image ;
00185 struct DB_UidList *next ;
00186 };
00187
00188 struct DB_CounterList
00189 {
00190 int idxCounter ;
00191 struct DB_CounterList *next ;
00192 };
00193
00194 struct DB_FindAttr
00195 {
00196 DcmTagKey tag ;
00197 DB_LEVEL level ;
00198 DB_KEY_TYPE keyAttr ;
00199 DB_KEY_CLASS keyClass ;
00200
00201
00202 DB_FindAttr(const DcmTagKey& t, DB_LEVEL l, DB_KEY_TYPE kt, DB_KEY_CLASS kc)
00203 : tag(t), level(l), keyAttr(kt), keyClass(kc) { }
00204 };
00205
00206 struct DB_Private_Handle
00207 {
00208 int pidx ;
00209 DB_ElementList *findRequestList ;
00210 DB_ElementList *findResponseList ;
00211 DB_LEVEL queryLevel ;
00212 char indexFilename[DBC_MAXSTRING+1] ;
00213 char storageArea[DBC_MAXSTRING+1] ;
00214 long maxBytesPerStudy ;
00215 long maxStudiesAllowed ;
00216 int idxCounter ;
00217 DB_CounterList *moveCounterList ;
00218 int NumberRemainOperations ;
00219 DB_QUERY_CLASS rootLevel ;
00220 DB_UidList *uidList ;
00221
00222 DB_Private_Handle()
00223 : pidx(0)
00224 , findRequestList(NULL)
00225 , findResponseList(NULL)
00226 , queryLevel(STUDY_LEVEL)
00227
00228
00229 , maxBytesPerStudy(0)
00230 , maxStudiesAllowed(0)
00231 , idxCounter(0)
00232 , moveCounterList(NULL)
00233 , NumberRemainOperations(0)
00234 , rootLevel(STUDY_ROOT)
00235 , uidList(NULL)
00236 {
00237 }
00238 };
00239
00244 struct StudyDescRecord
00245 {
00247 char StudyInstanceUID [UI_MAX_LENGTH] ;
00248
00250 long StudySize ;
00251
00253 double LastRecordedDate ;
00254
00256 int NumberofRegistratedImages ;
00257 };
00258
00259 struct ImagesofStudyArray
00260 {
00261 int idxCounter ;
00262 double RecordedDate ;
00263 long ImageSize ;
00264 };
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 #define RECORDIDX_PatientBirthDate 0
00278 #define RECORDIDX_PatientSex 1
00279 #define RECORDIDX_PatientName 2
00280 #define RECORDIDX_PatientID 3
00281 #define RECORDIDX_PatientBirthTime 4
00282 #define RECORDIDX_OtherPatientIDs 5
00283 #define RECORDIDX_OtherPatientNames 6
00284 #define RECORDIDX_EthnicGroup 7
00285 #define RECORDIDX_NumberofPatientRelatedStudies 8
00286 #define RECORDIDX_NumberofPatientRelatedSeries 9
00287 #define RECORDIDX_NumberofPatientRelatedInstances 10
00288 #define RECORDIDX_StudyDate 11
00289 #define RECORDIDX_StudyTime 12
00290 #define RECORDIDX_StudyID 13
00291 #define RECORDIDX_StudyDescription 14
00292 #define RECORDIDX_NameOfPhysiciansReadingStudy 15
00293 #define RECORDIDX_AccessionNumber 16
00294 #define RECORDIDX_ReferringPhysicianName 17
00295 #define RECORDIDX_ProcedureDescription 18
00296 #define RECORDIDX_AttendingPhysiciansName 19
00297 #define RECORDIDX_StudyInstanceUID 20
00298 #define RECORDIDX_OtherStudyNumbers 21
00299 #define RECORDIDX_AdmittingDiagnosesDescription 22
00300 #define RECORDIDX_PatientAge 23
00301 #define RECORDIDX_PatientSize 24
00302 #define RECORDIDX_PatientWeight 25
00303 #define RECORDIDX_Occupation 26
00304 #define RECORDIDX_NumberofStudyRelatedSeries 27
00305 #define RECORDIDX_NumberofStudyRelatedInstances 28
00306 #define RECORDIDX_SeriesNumber 29
00307 #define RECORDIDX_SeriesInstanceUID 30
00308 #define RECORDIDX_Modality 31
00309 #define RECORDIDX_ImageNumber 32
00310 #define RECORDIDX_SOPInstanceUID 33
00311 #define RECORDIDX_SeriesDate 34
00312 #define RECORDIDX_SeriesTime 35
00313 #define RECORDIDX_SeriesDescription 36
00314 #define RECORDIDX_ProtocolName 37
00315 #define RECORDIDX_OperatorsName 38
00316 #define RECORDIDX_PerformingPhysicianName 39
00317 #define RECORDIDX_PresentationLabel 40
00318
00319 #define NBPARAMETERS 41
00320
00321
00326 struct IdxRecord
00327 {
00329 IdxRecord();
00330
00331 char filename [DBC_MAXSTRING+1] ;
00332 char SOPClassUID [UI_MAX_LENGTH+1] ;
00333 double RecordedDate ;
00334 int ImageSize ;
00335
00336 DB_SmallDcmElmt param [NBPARAMETERS] ;
00337
00338 char PatientBirthDate [DA_MAX_LENGTH+1] ;
00339 char PatientSex [CS_MAX_LENGTH+1] ;
00340 char PatientName [PN_MAX_LENGTH+1] ;
00341 char PatientID [LO_MAX_LENGTH+1] ;
00342 char PatientBirthTime [TM_MAX_LENGTH+1] ;
00343 char OtherPatientIDs [LO_MAX_LENGTH+1] ;
00344 char OtherPatientNames [PN_MAX_LENGTH+1] ;
00345 char EthnicGroup [SH_MAX_LENGTH+1] ;
00346 char NumberofPatientRelatedStudies [IS_MAX_LENGTH+1] ;
00347 char NumberofPatientRelatedSeries [IS_MAX_LENGTH+1] ;
00348 char NumberofPatientRelatedInstances [IS_MAX_LENGTH+1] ;
00349
00350 char StudyDate [DA_MAX_LENGTH+1] ;
00351 char StudyTime [TM_MAX_LENGTH+1] ;
00352 char StudyID [CS_MAX_LENGTH+1] ;
00353 char StudyDescription [LO_MAX_LENGTH+1] ;
00354 char NameOfPhysiciansReadingStudy [PN_MAX_LENGTH+1] ;
00355
00356 char AccessionNumber [CS_MAX_LENGTH+1] ;
00357 char ReferringPhysicianName [PN_MAX_LENGTH+1] ;
00358 char ProcedureDescription [LO_MAX_LENGTH+1] ;
00359 char AttendingPhysiciansName [PN_MAX_LENGTH+1] ;
00360 char StudyInstanceUID [UI_MAX_LENGTH+1] ;
00361 char OtherStudyNumbers [IS_MAX_LENGTH+1] ;
00362 char AdmittingDiagnosesDescription [LO_MAX_LENGTH+1] ;
00363 char PatientAge [AS_MAX_LENGTH+1] ;
00364 char PatientSize [DS_MAX_LENGTH+1] ;
00365 char PatientWeight [DS_MAX_LENGTH+1] ;
00366 char Occupation [SH_MAX_LENGTH+1] ;
00367 char NumberofStudyRelatedSeries [IS_MAX_LENGTH+1] ;
00368 char NumberofStudyRelatedInstances [IS_MAX_LENGTH+1] ;
00369
00370 char SeriesNumber [IS_MAX_LENGTH+1] ;
00371 char SeriesInstanceUID [UI_MAX_LENGTH+1] ;
00372 char Modality [CS_MAX_LENGTH+1] ;
00373
00374 char ImageNumber [IS_MAX_LENGTH+1] ;
00375 char SOPInstanceUID [UI_MAX_LENGTH+1] ;
00376
00377 char SeriesDate [DA_MAX_LENGTH+1] ;
00378 char SeriesTime [TM_MAX_LENGTH+1] ;
00379 char SeriesDescription [LO_MAX_LENGTH+1] ;
00380 char ProtocolName [LO_MAX_LENGTH+1] ;
00381 char OperatorsName [PN_MAX_LENGTH+1] ;
00382 char PerformingPhysicianName [PN_MAX_LENGTH+1] ;
00383 char PresentationLabel [CS_LABEL_MAX_LENGTH+1] ;
00384
00385 DVIFhierarchyStatus hstat;
00386
00387
00388 char InstanceDescription [DESCRIPTION_MAX_LENGTH+1] ;
00389
00390 private:
00391 IdxRecord(const IdxRecord& copy);
00392 IdxRecord& operator=(const IdxRecord& copy);
00393 };
00394
00395
00396 #endif
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427