00001 /* 00002 * 00003 * Copyright (C) 1993-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmqrdb 00019 * 00020 * Author: Marco Eichelberg / Didier Lemoine / Gilles Mevel 00021 * 00022 * Purpose: enums and structures used for the database index file 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:04:24 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.2 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef DATAPRIV_H 00035 #define DATAPRIV_H 00036 00037 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 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 ** Maximum size of things to put in db records. 00104 ** Some values will have vm>1 thus these maximums are 00105 ** intended to leave enough space for most common uses. 00106 */ 00107 #define AE_MAX_LENGTH 128 /* Application Entity */ 00108 #define AS_MAX_LENGTH 32 /* Age String */ 00109 #define AT_MAX_LENGTH 32 /* Attribute Tag */ 00110 #define CS_MAX_LENGTH 128 /* Code String */ 00111 #define DA_MAX_LENGTH 80 /* Date */ 00112 #define DS_MAX_LENGTH 128 /* Decimal String */ 00113 #define DT_MAX_LENGTH 208 /* Date Time */ 00114 #define FL_MAX_LENGTH 32 /* FLoating point single */ 00115 #define FD_MAX_LENGTH 64 /* Floating point Double */ 00116 #define IS_MAX_LENGTH 96 /* Integer String */ 00117 #define LO_MAX_LENGTH 64 /* Long String */ 00118 #define LT_MAX_LENGTH 10240 /* Long Text */ 00119 #define PN_MAX_LENGTH 64 /* Person Name */ 00120 #define SH_MAX_LENGTH 16 /* Short String */ 00121 #define SL_MAX_LENGTH 32 /* Signed Long */ 00122 #define SS_MAX_LENGTH 16 /* Signed Short */ 00123 #define ST_MAX_LENGTH 1024 /* Short Text */ 00124 #define TM_MAX_LENGTH 128 /* Time */ 00125 #define UI_MAX_LENGTH 64 /* Unique Identifier */ 00126 #define UL_MAX_LENGTH 32 /* Unsigned Long */ 00127 #define US_MAX_LENGTH 16 /* Unsigned Short */ 00128 #define CS_LABEL_MAX_LENGTH 16 /* Code String - Presentation Label */ 00129 #define DESCRIPTION_MAX_LENGTH 128 /* Not related to any particular DICOM attribute */ 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 /* to passify some C++ compilers */ 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 /* the following constants define which array element 00245 * of the param[] array in the IdxRecord structure 00246 * is linked to which value field in the IdxRecord. 00247 * numbers must be continuous, starting with 0. 00248 * 00249 * The constant NBPARAMETERS must contain the number 00250 * of array elements to be referenced in param[] 00251 * (= highest index +1) 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 // Not related to any particular DICOM attribute ! 00365 char InstanceDescription [DESCRIPTION_MAX_LENGTH+1] ; 00366 00367 private: 00368 /* undefined */ IdxRecord(const IdxRecord& copy); 00369 /* undefined */ IdxRecord& operator=(const IdxRecord& copy); 00370 }; 00371 00372 00373 #endif 00374 00375 /* 00376 * CVS Log 00377 * $Log: dcmqridx.h,v $ 00378 * Revision 1.2 2005/12/08 16:04:24 meichel 00379 * Changed include path schema for all DCMTK header files 00380 * 00381 * Revision 1.1 2005/03/30 13:34:50 meichel 00382 * Initial release of module dcmqrdb that will replace module imagectn. 00383 * It provides a clear interface between the Q/R DICOM front-end and the 00384 * database back-end. The imagectn code has been re-factored into a minimal 00385 * class structure. 00386 * 00387 * 00388 */