OFFIS DCMTK  Version 3.6.0
dvpsdef.h
1 /*
2  *
3  * Copyright (C) 1998-2010, 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  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:16:36 $
23  * CVS/RCS Revision: $Revision: 1.12 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DVPSDEF_H
31 #define DVPSDEF_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 
35 #include "dcmtk/oflog/oflog.h"
36 
37 OFLogger DCM_dcmpstatGetLogger();
38 OFLogger DCM_dcmpstatDumpGetLogger();
39 OFLogger DCM_dcmpstatLogfileGetLogger();
40 
41 #define DCMPSTAT_TRACE(msg) OFLOG_TRACE(DCM_dcmpstatGetLogger(), msg)
42 #define DCMPSTAT_DEBUG(msg) OFLOG_DEBUG(DCM_dcmpstatGetLogger(), msg)
43 #define DCMPSTAT_INFO(msg) OFLOG_INFO(DCM_dcmpstatGetLogger(), msg)
44 #define DCMPSTAT_WARN(msg) OFLOG_WARN(DCM_dcmpstatGetLogger(), msg)
45 #define DCMPSTAT_ERROR(msg) OFLOG_ERROR(DCM_dcmpstatGetLogger(), msg)
46 #define DCMPSTAT_FATAL(msg) OFLOG_FATAL(DCM_dcmpstatGetLogger(), msg)
47 
48 #define DCMPSTAT_DUMP(msg) OFLOG_DEBUG(DCM_dcmpstatDumpGetLogger(), msg)
49 #define DCMPSTAT_LOGFILE(msg) OFLOG_DEBUG(DCM_dcmpstatLogfileGetLogger(), msg)
50 
51 /* default for max PDU size */
52 #define DEFAULT_MAXPDU 16384
53 
54 #define DEFAULT_filmDestination "DEFAULT"
55 #define DEFAULT_filmOrientation "PORTRAIT"
56 #define DEFAULT_filmSizeID "DEFAULT"
57 #define DEFAULT_illumination 2000
58 #define DEFAULT_imageDisplayFormat "STANDARD\\1,1"
59 #define DEFAULT_imageNumber "1"
60 #define DEFAULT_magnificationType "DEFAULT"
61 #define DEFAULT_maxDensity 320
62 #define DEFAULT_mediumType "DEFAULT"
63 #define DEFAULT_minDensity 20
64 #define DEFAULT_numberOfCopies "1"
65 #define DEFAULT_ownerID "DEFAULT"
66 #define DEFAULT_patientName "^^^^"
67 #define DEFAULT_presentationLabel "UNNAMED"
68 #define DEFAULT_printerStatus "NORMAL"
69 #define DEFAULT_printerStatusInfo "NORMAL"
70 #define DEFAULT_priority "MED"
71 #define DEFAULT_reflectedAmbientLight 10
72 #define DEFAULT_seriesNumber "1"
73 #define DEFAULT_shutterPresentationValue 0
74 #define DEFAULT_specificCharacterSet "ISO_IR 100"
75 #define DEFAULT_trim "NO"
76 
77 /* SOP instance UID used by the Print SCP when creating a default IDENTITY Presentation LUT */
78 #define WELLKNOWN_IDENTITY_PLUT_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.1"
79 
80 /* SOP class UID used by the Print SCP when storing a DIMSE log as a DICOM file */
81 #define PSTAT_DIMSE_LOG_STORAGE_UID "1.2.276.0.7230010.3.4.1915765545.18030.917282194.2"
82 
83 /* size_t value indicating that no index is active or available */
84 #define DVPS_IDX_NONE ((size_t)-1)
85 
86 /* max study count for DB handle creation */
87 #define PSTAT_MAXSTUDYCOUNT 200
88 
89 /* study size for DB handle creation */
90 #define PSTAT_STUDYSIZE DB_UpperMaxBytesPerStudy
91 
92 /* filename suffixes for print jobs */
93 #define PRINTJOB_SUFFIX ".job"
94 #define PRINTJOB_DONE_SUFFIX ".old"
95 #define PRINTJOB_TEMP_SUFFIX ".tmp"
96 
97 /* default AETitle for the Presentation State viewer */
98 #define PSTAT_AETITLE "DCMPSTAT"
99 
100 /* default path for database folder */
101 #define PSTAT_DBFOLDER "."
102 
103 /* default path for LUT folder */
104 #define PSTAT_LUTFOLDER "."
105 
106 /* default path for report folder */
107 #define PSTAT_REPORTFOLDER "."
108 
109 /* default path for spool folder */
110 #define PSTAT_SPOOLFOLDER "."
111 
112 /* config file facility constant for high resolution graphics */
113 #define L2_HIGHRESOLUTIONGRAPHICS "HIGHRESOLUTIONGRAPHICS"
114 
115 #define PSTAT_DCM_LogReservation DcmTag(0x0009, 0x0010, EVR_LO)
116 #define PSTAT_DCM_AcseSequence DcmTag(0x0009, 0x1100, EVR_SQ)
117 #define PSTAT_DCM_LogSequence DcmTag(0x0009, 0x1200, EVR_SQ)
118 #define PSTAT_DCM_LogEntryType DcmTag(0x0009, 0x1001, EVR_CS)
119 #define PSTAT_DCM_LogDate DcmTag(0x0009, 0x1002, EVR_DA)
120 #define PSTAT_DCM_LogTime DcmTag(0x0009, 0x1003, EVR_TM)
121 #define PSTAT_DCM_AssociateData DcmTag(0x0009, 0x1004, EVR_OB)
122 
123 /* --------------- a few macros which avoid copy/paste code --------------- */
124 
125 // inserts a copy of a dicom data element into a dataset
126 #define ADD_TO_DATASET(a_type, a_name) \
127 if (result==EC_Normal) \
128 { \
129  delem = new a_type(a_name); \
130  if (delem) dset.insert(delem, OFTrue); else result=EC_MemoryExhausted; \
131 }
132 
133 // inserts a copy of a dicom data element into an item
134 #define ADD_TO_DATASET2(a_type, a_name) \
135 if (result==EC_Normal) \
136 { \
137  delem = new a_type(a_name); \
138  if (delem) ditem->insert(delem, OFTrue); else result=EC_MemoryExhausted; \
139 }
140 
141 // inserts a copy of a dicom data element into an item
142 #define ADD_TO_PDATASET(a_type, a_name) \
143 if (writeresult==EC_Normal) \
144 { \
145  delem = new a_type(a_name); \
146  if (delem) rspDataset->insert(delem, OFTrue); else writeresult=EC_MemoryExhausted; \
147 }
148 
149 // inserts a copy of a repeating element into a dataset, assigns group number
150 #define ADD_REPEATING_ELEMENT_TO_DATASET(a_type, a_name, a_group) \
151 if (result==EC_Normal) \
152 { \
153  delem = new a_type(a_name); \
154  if (delem) \
155  { \
156  delem->setGTag(a_group); \
157  dset.insert(delem, OFTrue); \
158  } else result=EC_MemoryExhausted; \
159 }
160 
161 // reads a dicom element from a dataset if present
162 #define READ_FROM_DATASET(a_type, a_name) \
163 stack.clear(); \
164 if (EC_Normal == dset.search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) \
165 { \
166  a_name = *((a_type *)(stack.top())); \
167 }
168 
169 // reads a dicom element from an item if present
170 #define READ_FROM_DATASET2(a_type, a_name) \
171 stack.clear(); \
172 if (EC_Normal == item->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) \
173 { \
174  a_name = *((a_type *)(stack.top())); \
175 }
176 
177 // reads a dicom element from an item if present
178 #define READ_FROM_PDATASET(a_type, a_name) \
179 stack.clear(); \
180 if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse))) \
181 { \
182  a_name = *((a_type *)(stack.top())); \
183 }
184 
185 // assigns a newly generated UID to a dicom element if it is empty
186 #define SET_UID(a_name) \
187 if (result==EC_Normal) \
188 { \
189  if (a_name.getLength()==0) result = a_name.putString(dcmGenerateUniqueIdentifier(uid)); \
190 }
191 
192 #endif
193 
194 /*
195  * $Log: dvpsdef.h,v $
196  * Revision 1.12 2010-10-14 13:16:36 joergr
197  * Updated copyright header. Added reference to COPYRIGHT file.
198  *
199  * Revision 1.11 2010-10-07 14:31:35 joergr
200  * Removed leading underscore characters from preprocessor symbols (reserved).
201  *
202  * Revision 1.10 2009-12-15 14:50:49 uli
203  * Fixes some issues with --logfile and the config's log options.
204  *
205  * Revision 1.9 2009-11-24 14:12:57 uli
206  * Switched to logging mechanism provided by the "new" oflog module.
207  *
208  * Revision 1.8 2005-12-08 16:03:41 meichel
209  * Changed include path schema for all DCMTK header files
210  *
211  * Revision 1.7 2002/01/08 10:32:12 joergr
212  * Corrected spelling of function dcmGenerateUniqueIdentifier().
213  *
214  * Revision 1.6 2001/11/28 13:59:31 joergr
215  * Check return value of DcmItem::insert() statements where appropriate to
216  * avoid memory leaks when insert procedure fails.
217  *
218  * Revision 1.5 2001/06/01 15:50:15 meichel
219  * Updated copyright header
220  *
221  * Revision 1.4 2000/11/13 10:42:40 joergr
222  * Added support for Structured Reporting "templates".
223  *
224  * Revision 1.3 2000/06/07 13:16:37 meichel
225  * now using DIMSE status constants and log facilities defined in dcmnet
226  *
227  * Revision 1.2 2000/06/02 16:00:45 meichel
228  * Adapted all dcmpstat classes to use OFConsole for log and error output
229  *
230  * Revision 1.1 2000/05/31 12:56:59 meichel
231  * Moved dcmpstat macros and constants into a common header file
232  *
233  *
234  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2