1 /* 2 * 3 * Copyright (C) 1998-2018, OFFIS e.V. 4 * All rights reserved. See COPYRIGHT file for details. 5 * 6 * This software and supporting documentation were developed by 7 * 8 * OFFIS e.V. 9 * R&D Division Health 10 * Escherweg 2 11 * D-26121 Oldenburg, Germany 12 * 13 * 14 * Module: dcmpstat 15 * 16 * Author: Marco Eichelberg 17 * 18 * Purpose: 19 * definitions of constants and macros for pstat module 20 * 21 */ 22 23 #ifndef DVPSDEF_H 24 #define DVPSDEF_H 25 26 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 27 28 #include "dcmtk/dcmpstat/dpdefine.h" 29 #include "dcmtk/oflog/oflog.h" 30 31 extern DCMTK_DCMPSTAT_EXPORT OFLogger DCM_dcmpstatLogger; 32 extern DCMTK_DCMPSTAT_EXPORT OFLogger DCM_dcmpstatDumpLogger; 33 extern DCMTK_DCMPSTAT_EXPORT OFLogger DCM_dcmpstatLogfileLogger; 34 35 #define DCMPSTAT_TRACE(msg) OFLOG_TRACE(DCM_dcmpstatLogger, msg) 36 #define DCMPSTAT_DEBUG(msg) OFLOG_DEBUG(DCM_dcmpstatLogger, msg) 37 #define DCMPSTAT_INFO(msg) OFLOG_INFO(DCM_dcmpstatLogger, msg) 38 #define DCMPSTAT_WARN(msg) OFLOG_WARN(DCM_dcmpstatLogger, msg) 39 #define DCMPSTAT_ERROR(msg) OFLOG_ERROR(DCM_dcmpstatLogger, msg) 40 #define DCMPSTAT_FATAL(msg) OFLOG_FATAL(DCM_dcmpstatLogger, msg) 41 42 #define DCMPSTAT_DUMP(msg) OFLOG_DEBUG(DCM_dcmpstatDumpLogger, msg) 43 #define DCMPSTAT_LOGFILE(msg) OFLOG_DEBUG(DCM_dcmpstatLogfileLogger, msg) 44 45 /* default for max PDU size */ 46 #define DEFAULT_MAXPDU 16384 47 48 #define DEFAULT_filmDestination "DEFAULT" 49 #define DEFAULT_filmOrientation "PORTRAIT" 50 #define DEFAULT_filmSizeID "DEFAULT" 51 #define DEFAULT_illumination 2000 52 #define DEFAULT_imageDisplayFormat "STANDARD\\1,1" 53 #define DEFAULT_imageNumber "1" 54 #define DEFAULT_magnificationType "DEFAULT" 55 #define DEFAULT_maxDensity 320 56 #define DEFAULT_mediumType "DEFAULT" 57 #define DEFAULT_minDensity 20 58 #define DEFAULT_numberOfCopies "1" 59 #define DEFAULT_ownerID "DEFAULT" 60 #define DEFAULT_patientName "^^^^" 61 #define DEFAULT_presentationLabel "UNNAMED" 62 #define DEFAULT_printerStatus "NORMAL" 63 #define DEFAULT_printerStatusInfo "NORMAL" 64 #define DEFAULT_priority "MED" 65 #define DEFAULT_reflectedAmbientLight 10 66 #define DEFAULT_seriesNumber "1" 67 #define DEFAULT_shutterPresentationValue 0 68 #define DEFAULT_specificCharacterSet "ISO_IR 100" 69 #define DEFAULT_trim "NO" 70 71 /* SOP instance UID used by the Print SCP when creating a default IDENTITY Presentation LUT */ 72 #define WELLKNOWN_IDENTITY_PLUT_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.1" 73 74 /* SOP class UID used by the Print SCP when storing a DIMSE log as a DICOM file */ 75 #define PSTAT_DIMSE_LOG_STORAGE_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.2" 76 77 /* size_t value indicating that no index is active or available */ 78 #define DVPS_IDX_NONE ((size_t)-1) 79 80 /* max study count for DB handle creation */ 81 #define PSTAT_MAXSTUDYCOUNT 200 82 83 /* study size for DB handle creation */ 84 #define PSTAT_STUDYSIZE DB_UpperMaxBytesPerStudy 85 86 /* filename suffixes for print jobs */ 87 #define PRINTJOB_SUFFIX ".job" 88 #define PRINTJOB_DONE_SUFFIX ".old" 89 #define PRINTJOB_TEMP_SUFFIX ".tmp" 90 91 /* default AETitle for the Presentation State viewer */ 92 #define PSTAT_AETITLE "DCMPSTAT" 93 94 /* default path for database folder */ 95 #define PSTAT_DBFOLDER "." 96 97 /* default path for LUT folder */ 98 #define PSTAT_LUTFOLDER "." 99 100 /* default path for report folder */ 101 #define PSTAT_REPORTFOLDER "." 102 103 /* default path for spool folder */ 104 #define PSTAT_SPOOLFOLDER "." 105 106 /* config file facility constant for high resolution graphics */ 107 #define L2_HIGHRESOLUTIONGRAPHICS "HIGHRESOLUTIONGRAPHICS" 108 109 #define PSTAT_DCM_LogReservation DcmTag(0x0009, 0x0010, EVR_LO) 110 #define PSTAT_DCM_AcseSequence DcmTag(0x0009, 0x1100, EVR_SQ) 111 #define PSTAT_DCM_LogSequence DcmTag(0x0009, 0x1200, EVR_SQ) 112 #define PSTAT_DCM_LogEntryType DcmTag(0x0009, 0x1001, EVR_CS) 113 #define PSTAT_DCM_LogDate DcmTag(0x0009, 0x1002, EVR_DA) 114 #define PSTAT_DCM_LogTime DcmTag(0x0009, 0x1003, EVR_TM) 115 #define PSTAT_DCM_AssociateData DcmTag(0x0009, 0x1004, EVR_OB) 116 117 /* --------------- a few macros which avoid copy/paste code --------------- */ 118 119 // inserts a copy of a dicom data element into a dataset 120 #define ADD_TO_DATASET(a_type, a_name) \ 121 if (result==EC_Normal) \ 122 { \ 123 delem = new a_type(a_name); \ 124 if (delem) dset.insert(delem, OFTrue); else result=EC_MemoryExhausted; \ 125 } 126 127 // inserts a copy of a dicom data element into an item 128 #define ADD_TO_DATASET2(a_type, a_name) \ 129 if (result==EC_Normal) \ 130 { \ 131 delem = new a_type(a_name); \ 132 if (delem) ditem->insert(delem, OFTrue); else result=EC_MemoryExhausted; \ 133 } 134 135 // inserts a copy of a dicom data element into an item 136 #define ADD_TO_PDATASET(a_type, a_name) \ 137 if (writeresult==EC_Normal) \ 138 { \ 139 delem = new a_type(a_name); \ 140 if (delem) rspDataset->insert(delem, OFTrue); else writeresult=EC_MemoryExhausted; \ 141 } 142 143 // inserts a copy of a repeating element into a dataset, assigns group number 144 #define ADD_REPEATING_ELEMENT_TO_DATASET(a_type, a_name, a_group) \ 145 if (result==EC_Normal) \ 146 { \ 147 delem = new a_type(a_name); \ 148 if (delem) \ 149 { \ 150 delem->setGTag(a_group); \ 151 dset.insert(delem, OFTrue); \ 152 } else result=EC_MemoryExhausted; \ 153 } 154 155 // reads a dicom element from a dataset if present 156 #define READ_FROM_DATASET(a_type, an_ident, a_name) \ 157 stack.clear(); \ 158 if ((EC_Normal == dset.search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \ 159 { \ 160 a_name = *((a_type *)(stack.top())); \ 161 } 162 163 // reads a dicom element from an item if present 164 #define READ_FROM_DATASET2(a_type, an_ident, a_name) \ 165 stack.clear(); \ 166 if ((EC_Normal == item->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \ 167 { \ 168 a_name = *((a_type *)(stack.top())); \ 169 } 170 171 // reads a dicom element from an item if present 172 #define READ_FROM_PDATASET(a_type, an_ident, a_name) \ 173 stack.clear(); \ 174 if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \ 175 { \ 176 a_name = *((a_type *)(stack.top())); \ 177 } 178 179 // assigns a newly generated UID to a dicom element if it is empty 180 #define SET_UID(a_name) \ 181 if (result==EC_Normal) \ 182 { \ 183 if (a_name.getLength()==0) result = a_name.putString(dcmGenerateUniqueIdentifier(uid)); \ 184 } 185 186 #endif 187