00001 /* 00002 * 00003 * Copyright (C) 1998-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmpstat 00015 * 00016 * Author: Marco Eichelberg 00017 * 00018 * Purpose: 00019 * definitions of constants and macros for pstat module 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:36 $ 00023 * CVS/RCS Revision: $Revision: 1.12 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 #ifndef DVPSDEF_H 00031 #define DVPSDEF_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 00035 #include "dcmtk/oflog/oflog.h" 00036 00037 OFLogger DCM_dcmpstatGetLogger(); 00038 OFLogger DCM_dcmpstatDumpGetLogger(); 00039 OFLogger DCM_dcmpstatLogfileGetLogger(); 00040 00041 #define DCMPSTAT_TRACE(msg) OFLOG_TRACE(DCM_dcmpstatGetLogger(), msg) 00042 #define DCMPSTAT_DEBUG(msg) OFLOG_DEBUG(DCM_dcmpstatGetLogger(), msg) 00043 #define DCMPSTAT_INFO(msg) OFLOG_INFO(DCM_dcmpstatGetLogger(), msg) 00044 #define DCMPSTAT_WARN(msg) OFLOG_WARN(DCM_dcmpstatGetLogger(), msg) 00045 #define DCMPSTAT_ERROR(msg) OFLOG_ERROR(DCM_dcmpstatGetLogger(), msg) 00046 #define DCMPSTAT_FATAL(msg) OFLOG_FATAL(DCM_dcmpstatGetLogger(), msg) 00047 00048 #define DCMPSTAT_DUMP(msg) OFLOG_DEBUG(DCM_dcmpstatDumpGetLogger(), msg) 00049 #define DCMPSTAT_LOGFILE(msg) OFLOG_DEBUG(DCM_dcmpstatLogfileGetLogger(), msg) 00050 00051 /* default for max PDU size */ 00052 #define DEFAULT_MAXPDU 16384 00053 00054 #define DEFAULT_filmDestination "DEFAULT" 00055 #define DEFAULT_filmOrientation "PORTRAIT" 00056 #define DEFAULT_filmSizeID "DEFAULT" 00057 #define DEFAULT_illumination 2000 00058 #define DEFAULT_imageDisplayFormat "STANDARD\\1,1" 00059 #define DEFAULT_imageNumber "1" 00060 #define DEFAULT_magnificationType "DEFAULT" 00061 #define DEFAULT_maxDensity 320 00062 #define DEFAULT_mediumType "DEFAULT" 00063 #define DEFAULT_minDensity 20 00064 #define DEFAULT_numberOfCopies "1" 00065 #define DEFAULT_ownerID "DEFAULT" 00066 #define DEFAULT_patientName "^^^^" 00067 #define DEFAULT_presentationLabel "UNNAMED" 00068 #define DEFAULT_printerStatus "NORMAL" 00069 #define DEFAULT_printerStatusInfo "NORMAL" 00070 #define DEFAULT_priority "MED" 00071 #define DEFAULT_reflectedAmbientLight 10 00072 #define DEFAULT_seriesNumber "1" 00073 #define DEFAULT_shutterPresentationValue 0 00074 #define DEFAULT_specificCharacterSet "ISO_IR 100" 00075 #define DEFAULT_trim "NO" 00076 00077 /* SOP instance UID used by the Print SCP when creating a default IDENTITY Presentation LUT */ 00078 #define WELLKNOWN_IDENTITY_PLUT_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.1" 00079 00080 /* SOP class UID used by the Print SCP when storing a DIMSE log as a DICOM file */ 00081 #define PSTAT_DIMSE_LOG_STORAGE_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.2" 00082 00083 /* size_t value indicating that no index is active or available */ 00084 #define DVPS_IDX_NONE ((size_t)-1) 00085 00086 /* max study count for DB handle creation */ 00087 #define PSTAT_MAXSTUDYCOUNT 200 00088 00089 /* study size for DB handle creation */ 00090 #define PSTAT_STUDYSIZE DB_UpperMaxBytesPerStudy 00091 00092 /* filename suffixes for print jobs */ 00093 #define PRINTJOB_SUFFIX ".job" 00094 #define PRINTJOB_DONE_SUFFIX ".old" 00095 #define PRINTJOB_TEMP_SUFFIX ".tmp" 00096 00097 /* default AETitle for the Presentation State viewer */ 00098 #define PSTAT_AETITLE "DCMPSTAT" 00099 00100 /* default path for database folder */ 00101 #define PSTAT_DBFOLDER "." 00102 00103 /* default path for LUT folder */ 00104 #define PSTAT_LUTFOLDER "." 00105 00106 /* default path for report folder */ 00107 #define PSTAT_REPORTFOLDER "." 00108 00109 /* default path for spool folder */ 00110 #define PSTAT_SPOOLFOLDER "." 00111 00112 /* config file facility constant for high resolution graphics */ 00113 #define L2_HIGHRESOLUTIONGRAPHICS "HIGHRESOLUTIONGRAPHICS" 00114 00115 #define PSTAT_DCM_LogReservation DcmTag(0x0009, 0x0010, EVR_LO) 00116 #define PSTAT_DCM_AcseSequence DcmTag(0x0009, 0x1100, EVR_SQ) 00117 #define PSTAT_DCM_LogSequence DcmTag(0x0009, 0x1200, EVR_SQ) 00118 #define PSTAT_DCM_LogEntryType DcmTag(0x0009, 0x1001, EVR_CS) 00119 #define PSTAT_DCM_LogDate DcmTag(0x0009, 0x1002, EVR_DA) 00120 #define PSTAT_DCM_LogTime DcmTag(0x0009, 0x1003, EVR_TM) 00121 #define PSTAT_DCM_AssociateData DcmTag(0x0009, 0x1004, EVR_OB) 00122 00123 /* --------------- a few macros which avoid copy/paste code --------------- */ 00124 00125 // inserts a copy of a dicom data element into a dataset 00126 #define ADD_TO_DATASET(a_type, a_name) \ 00127 if (result==EC_Normal) \ 00128 { \ 00129 delem = new a_type(a_name); \ 00130 if (delem) dset.insert(delem, OFTrue); else result=EC_MemoryExhausted; \ 00131 } 00132 00133 // inserts a copy of a dicom data element into an item 00134 #define ADD_TO_DATASET2(a_type, a_name) \ 00135 if (result==EC_Normal) \ 00136 { \ 00137 delem = new a_type(a_name); \ 00138 if (delem) ditem->insert(delem, OFTrue); else result=EC_MemoryExhausted; \ 00139 } 00140 00141 // inserts a copy of a dicom data element into an item 00142 #define ADD_TO_PDATASET(a_type, a_name) \ 00143 if (writeresult==EC_Normal) \ 00144 { \ 00145 delem = new a_type(a_name); \ 00146 if (delem) rspDataset->insert(delem, OFTrue); else writeresult=EC_MemoryExhausted; \ 00147 } 00148 00149 // inserts a copy of a repeating element into a dataset, assigns group number 00150 #define ADD_REPEATING_ELEMENT_TO_DATASET(a_type, a_name, a_group) \ 00151 if (result==EC_Normal) \ 00152 { \ 00153 delem = new a_type(a_name); \ 00154 if (delem) \ 00155 { \ 00156 delem->setGTag(a_group); \ 00157 dset.insert(delem, OFTrue); \ 00158 } else result=EC_MemoryExhausted; \ 00159 } 00160 00161 // reads a dicom element from a dataset if present 00162 #define READ_FROM_DATASET(a_type, a_name) \ 00163 stack.clear(); \ 00164 if (EC_Normal == dset.search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) \ 00165 { \ 00166 a_name = *((a_type *)(stack.top())); \ 00167 } 00168 00169 // reads a dicom element from an item if present 00170 #define READ_FROM_DATASET2(a_type, a_name) \ 00171 stack.clear(); \ 00172 if (EC_Normal == item->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) \ 00173 { \ 00174 a_name = *((a_type *)(stack.top())); \ 00175 } 00176 00177 // reads a dicom element from an item if present 00178 #define READ_FROM_PDATASET(a_type, a_name) \ 00179 stack.clear(); \ 00180 if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse))) \ 00181 { \ 00182 a_name = *((a_type *)(stack.top())); \ 00183 } 00184 00185 // assigns a newly generated UID to a dicom element if it is empty 00186 #define SET_UID(a_name) \ 00187 if (result==EC_Normal) \ 00188 { \ 00189 if (a_name.getLength()==0) result = a_name.putString(dcmGenerateUniqueIdentifier(uid)); \ 00190 } 00191 00192 #endif 00193 00194 /* 00195 * $Log: dvpsdef.h,v $ 00196 * Revision 1.12 2010-10-14 13:16:36 joergr 00197 * Updated copyright header. Added reference to COPYRIGHT file. 00198 * 00199 * Revision 1.11 2010-10-07 14:31:35 joergr 00200 * Removed leading underscore characters from preprocessor symbols (reserved). 00201 * 00202 * Revision 1.10 2009-12-15 14:50:49 uli 00203 * Fixes some issues with --logfile and the config's log options. 00204 * 00205 * Revision 1.9 2009-11-24 14:12:57 uli 00206 * Switched to logging mechanism provided by the "new" oflog module. 00207 * 00208 * Revision 1.8 2005-12-08 16:03:41 meichel 00209 * Changed include path schema for all DCMTK header files 00210 * 00211 * Revision 1.7 2002/01/08 10:32:12 joergr 00212 * Corrected spelling of function dcmGenerateUniqueIdentifier(). 00213 * 00214 * Revision 1.6 2001/11/28 13:59:31 joergr 00215 * Check return value of DcmItem::insert() statements where appropriate to 00216 * avoid memory leaks when insert procedure fails. 00217 * 00218 * Revision 1.5 2001/06/01 15:50:15 meichel 00219 * Updated copyright header 00220 * 00221 * Revision 1.4 2000/11/13 10:42:40 joergr 00222 * Added support for Structured Reporting "templates". 00223 * 00224 * Revision 1.3 2000/06/07 13:16:37 meichel 00225 * now using DIMSE status constants and log facilities defined in dcmnet 00226 * 00227 * Revision 1.2 2000/06/02 16:00:45 meichel 00228 * Adapted all dcmpstat classes to use OFConsole for log and error output 00229 * 00230 * Revision 1.1 2000/05/31 12:56:59 meichel 00231 * Moved dcmpstat macros and constants into a common header file 00232 * 00233 * 00234 */