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
00030
00031
00032
00033
00034 #ifndef DATAPRIV_H
00035 #define DATAPRIV_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038
00039 #include "dcmtk/dcmnet/dicom.h"
00040 #include "dcmtk/dcmdata/dcdatset.h"
00041 #include "dcmtk/dcmdata/dcuid.h"
00042 #include "dcmtk/dcmdata/dcdeftag.h"
00043 #include "dcmtk/dcmqrdb/dcmqrdbi.h"
00044
00045 BEGIN_EXTERN_C
00046 #ifdef HAVE_IO_H
00047 #define access my_access // Workaround to make Visual C++ Compiler happy!
00048 #include <io.h>
00049 #undef access
00050 #endif
00051 END_EXTERN_C
00052
00055 enum DB_KEY_TYPE
00056 {
00058 UNIQUE_KEY,
00060 REQUIRED_KEY,
00062 OPTIONAL_KEY
00063 };
00064
00067 enum DB_QUERY_CLASS
00068 {
00070 PATIENT_ROOT,
00072 STUDY_ROOT,
00074 PATIENT_STUDY
00075 };
00076
00079 enum DB_KEY_CLASS
00080 {
00082 DATE_CLASS,
00084 TIME_CLASS,
00086 UID_CLASS,
00088 STRING_CLASS,
00090 OTHER_CLASS
00091 };
00092
00093
00097 #define PATIENT_LEVEL_STRING "PATIENT"
00098 #define STUDY_LEVEL_STRING "STUDY"
00099 #define SERIE_LEVEL_STRING "SERIES"
00100 #define IMAGE_LEVEL_STRING "IMAGE"
00101
00102
00103
00104
00105
00106
00107 #define AE_MAX_LENGTH 128
00108 #define AS_MAX_LENGTH 32
00109 #define AT_MAX_LENGTH 32
00110 #define CS_MAX_LENGTH 128
00111 #define DA_MAX_LENGTH 80
00112 #define DS_MAX_LENGTH 128
00113 #define DT_MAX_LENGTH 208
00114 #define FL_MAX_LENGTH 32
00115 #define FD_MAX_LENGTH 64
00116 #define IS_MAX_LENGTH 96
00117 #define LO_MAX_LENGTH 64
00118 #define LT_MAX_LENGTH 10240
00119 #define PN_MAX_LENGTH 64
00120 #define SH_MAX_LENGTH 16
00121 #define SL_MAX_LENGTH 32
00122 #define SS_MAX_LENGTH 16
00123 #define ST_MAX_LENGTH 1024
00124 #define TM_MAX_LENGTH 128
00125 #define UI_MAX_LENGTH 64
00126 #define UL_MAX_LENGTH 32
00127 #define US_MAX_LENGTH 16
00128 #define CS_LABEL_MAX_LENGTH 16
00129 #define DESCRIPTION_MAX_LENGTH 128
00130
00131 #define DBC_MAXSTRING 256
00132
00133 #define MAX_MAX_STUDIES DB_UpperMaxStudies
00134 #define MAX_NUMBER_OF_IMAGES 10000
00135 #define SIZEOF_IDXRECORD (sizeof (IdxRecord))
00136 #define SIZEOF_STUDYDESC (sizeof (StudyDescRecord) * MAX_MAX_STUDIES)
00137
00141 struct DB_SmallDcmElmt
00142 {
00143 public:
00145 DB_SmallDcmElmt();
00146
00148 char* PValueField ;
00149
00151 Uint32 ValueLength ;
00152
00154 DcmTagKey XTag ;
00155
00156 private:
00158 DB_SmallDcmElmt(const DB_SmallDcmElmt& copy);
00160 DB_SmallDcmElmt& operator=(const DB_SmallDcmElmt& copy);
00161 };
00162
00166 struct DB_ElementList
00167 {
00169 DB_ElementList(): elem(), next(NULL) {}
00170
00172 DB_SmallDcmElmt elem ;
00173
00175 struct DB_ElementList *next ;
00176
00177 private:
00179 DB_ElementList(const DB_ElementList& copy);
00181 DB_ElementList& operator=(const DB_ElementList& copy);
00182 };
00183
00184 struct DB_UidList
00185 {
00186 char *patient ;
00187 char *study ;
00188 char *serie ;
00189 char *image ;
00190 struct DB_UidList *next ;
00191 };
00192
00193 struct DB_CounterList
00194 {
00195 int idxCounter ;
00196 struct DB_CounterList *next ;
00197 };
00198
00199 struct DB_FindAttr
00200 {
00201 DcmTagKey tag ;
00202 DB_LEVEL level ;
00203 DB_KEY_TYPE keyAttr ;
00204 DB_KEY_CLASS keyClass ;
00205
00206
00207 DB_FindAttr(const DcmTagKey& t, DB_LEVEL l, DB_KEY_TYPE kt, DB_KEY_CLASS kc)
00208 : tag(t), level(l), keyAttr(kt), keyClass(kc) { }
00209 };
00210
00211 struct DB_Private_Handle
00212 {
00213 int pidx ;
00214 DB_ElementList *findRequestList ;
00215 DB_ElementList *findResponseList ;
00216 DB_LEVEL queryLevel ;
00217 char indexFilename[DBC_MAXSTRING+1] ;
00218 char storageArea[DBC_MAXSTRING+1] ;
00219 long maxBytesPerStudy ;
00220 long maxStudiesAllowed ;
00221 int idxCounter ;
00222 DB_CounterList *moveCounterList ;
00223 int NumberRemainOperations ;
00224 DB_QUERY_CLASS rootLevel ;
00225 DB_UidList *uidList ;
00226 };
00227
00228 struct StudyDescRecord
00229 {
00230 char StudyInstanceUID [UI_MAX_LENGTH] ;
00231 long StudySize ;
00232 double LastRecordedDate ;
00233 int NumberofRegistratedImages ;
00234 };
00235
00236 struct ImagesofStudyArray
00237 {
00238 int idxCounter ;
00239 double RecordedDate ;
00240 long ImageSize ;
00241 };
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254 #define RECORDIDX_PatientsBirthDate 0
00255 #define RECORDIDX_PatientsSex 1
00256 #define RECORDIDX_PatientsName 2
00257 #define RECORDIDX_PatientID 3
00258 #define RECORDIDX_PatientsBirthTime 4
00259 #define RECORDIDX_OtherPatientIDs 5
00260 #define RECORDIDX_OtherPatientNames 6
00261 #define RECORDIDX_EthnicGroup 7
00262 #define RECORDIDX_NumberofPatientRelatedStudies 8
00263 #define RECORDIDX_NumberofPatientRelatedSeries 9
00264 #define RECORDIDX_NumberofPatientRelatedInstances 10
00265 #define RECORDIDX_StudyDate 11
00266 #define RECORDIDX_StudyTime 12
00267 #define RECORDIDX_StudyID 13
00268 #define RECORDIDX_StudyDescription 14
00269 #define RECORDIDX_NameOfPhysiciansReadingStudy 15
00270 #define RECORDIDX_AccessionNumber 16
00271 #define RECORDIDX_ReferringPhysiciansName 17
00272 #define RECORDIDX_ProcedureDescription 18
00273 #define RECORDIDX_AttendingPhysiciansName 19
00274 #define RECORDIDX_StudyInstanceUID 20
00275 #define RECORDIDX_OtherStudyNumbers 21
00276 #define RECORDIDX_AdmittingDiagnosesDescription 22
00277 #define RECORDIDX_PatientsAge 23
00278 #define RECORDIDX_PatientsSize 24
00279 #define RECORDIDX_PatientsWeight 25
00280 #define RECORDIDX_Occupation 26
00281 #define RECORDIDX_NumberofStudyRelatedSeries 27
00282 #define RECORDIDX_NumberofStudyRelatedInstances 28
00283 #define RECORDIDX_SeriesNumber 29
00284 #define RECORDIDX_SeriesInstanceUID 30
00285 #define RECORDIDX_Modality 31
00286 #define RECORDIDX_ImageNumber 32
00287 #define RECORDIDX_SOPInstanceUID 33
00288 #define RECORDIDX_SeriesDate 34
00289 #define RECORDIDX_SeriesTime 35
00290 #define RECORDIDX_SeriesDescription 36
00291 #define RECORDIDX_ProtocolName 37
00292 #define RECORDIDX_OperatorsName 38
00293 #define RECORDIDX_PerformingPhysiciansName 39
00294 #define RECORDIDX_PresentationLabel 40
00295
00296 #define NBPARAMETERS 41
00297
00298
00303 struct IdxRecord
00304 {
00306 IdxRecord();
00307
00308 char filename [DBC_MAXSTRING+1] ;
00309 char SOPClassUID [UI_MAX_LENGTH+1] ;
00310 double RecordedDate ;
00311 int ImageSize ;
00312
00313 DB_SmallDcmElmt param [NBPARAMETERS] ;
00314
00315 char PatientsBirthDate [DA_MAX_LENGTH+1] ;
00316 char PatientsSex [CS_MAX_LENGTH+1] ;
00317 char PatientsName [PN_MAX_LENGTH+1] ;
00318 char PatientID [LO_MAX_LENGTH+1] ;
00319 char PatientsBirthTime [TM_MAX_LENGTH+1] ;
00320 char OtherPatientIDs [LO_MAX_LENGTH+1] ;
00321 char OtherPatientNames [PN_MAX_LENGTH+1] ;
00322 char EthnicGroup [SH_MAX_LENGTH+1] ;
00323 char NumberofPatientRelatedStudies [IS_MAX_LENGTH+1] ;
00324 char NumberofPatientRelatedSeries [IS_MAX_LENGTH+1] ;
00325 char NumberofPatientRelatedInstances [IS_MAX_LENGTH+1] ;
00326
00327 char StudyDate [DA_MAX_LENGTH+1] ;
00328 char StudyTime [TM_MAX_LENGTH+1] ;
00329 char StudyID [CS_MAX_LENGTH+1] ;
00330 char StudyDescription [LO_MAX_LENGTH+1] ;
00331 char NameOfPhysiciansReadingStudy [PN_MAX_LENGTH+1] ;
00332
00333 char AccessionNumber [CS_MAX_LENGTH+1] ;
00334 char ReferringPhysiciansName [PN_MAX_LENGTH+1] ;
00335 char ProcedureDescription [LO_MAX_LENGTH+1] ;
00336 char AttendingPhysiciansName [PN_MAX_LENGTH+1] ;
00337 char StudyInstanceUID [UI_MAX_LENGTH+1] ;
00338 char OtherStudyNumbers [IS_MAX_LENGTH+1] ;
00339 char AdmittingDiagnosesDescription [LO_MAX_LENGTH+1] ;
00340 char PatientsAge [AS_MAX_LENGTH+1] ;
00341 char PatientsSize [DS_MAX_LENGTH+1] ;
00342 char PatientsWeight [DS_MAX_LENGTH+1] ;
00343 char Occupation [SH_MAX_LENGTH+1] ;
00344 char NumberofStudyRelatedSeries [IS_MAX_LENGTH+1] ;
00345 char NumberofStudyRelatedInstances [IS_MAX_LENGTH+1] ;
00346
00347 char SeriesNumber [IS_MAX_LENGTH+1] ;
00348 char SeriesInstanceUID [UI_MAX_LENGTH+1] ;
00349 char Modality [CS_MAX_LENGTH+1] ;
00350
00351 char ImageNumber [IS_MAX_LENGTH+1] ;
00352 char SOPInstanceUID [UI_MAX_LENGTH+1] ;
00353
00354 char SeriesDate [DA_MAX_LENGTH+1] ;
00355 char SeriesTime [TM_MAX_LENGTH+1] ;
00356 char SeriesDescription [LO_MAX_LENGTH+1] ;
00357 char ProtocolName [LO_MAX_LENGTH+1] ;
00358 char OperatorsName [PN_MAX_LENGTH+1] ;
00359 char PerformingPhysiciansName [PN_MAX_LENGTH+1] ;
00360 char PresentationLabel [CS_LABEL_MAX_LENGTH+1] ;
00361
00362 DVIFhierarchyStatus hstat;
00363
00364
00365 char InstanceDescription [DESCRIPTION_MAX_LENGTH+1] ;
00366
00367 private:
00368 IdxRecord(const IdxRecord& copy);
00369 IdxRecord& operator=(const IdxRecord& copy);
00370 };
00371
00372
00373 #endif
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388