OFFIS DCMTK  Version 3.6.0
dsrdoctr.h
1 /*
2  *
3  * Copyright (C) 2000-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: dcmsr
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose:
19  * classes: DSRDocumentTree
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:16:32 $
23  * CVS/RCS Revision: $Revision: 1.23 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 
31 #ifndef DSRDOCTR_H
32 #define DSRDOCTR_H
33 
34 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
35 
36 #include "dcmtk/dcmsr/dsrtree.h"
37 #include "dcmtk/dcmsr/dsrdoctn.h"
38 #include "dcmtk/dcmsr/dsrcitem.h"
39 
40 #include "dcmtk/dcmdata/dcitem.h"
41 
42 
43 /*-----------------------*
44  * forward declaration *
45  *-----------------------*/
46 
48 
49 
50 /*---------------------*
51  * class declaration *
52  *---------------------*/
53 
57  : public DSRTree
58 {
59 
60  public:
61 
65  DSRDocumentTree(const E_DocumentType documentType);
66 
69  virtual ~DSRDocumentTree();
70 
74  virtual void clear();
75 
82  virtual OFBool isValid() const;
83 
89  OFCondition print(STD_NAMESPACE ostream &stream,
90  const size_t flags = 0);
91 
101  OFCondition read(DcmItem &dataset,
102  const E_DocumentType documentType,
103  const size_t flags = 0);
104 
113  OFCondition write(DcmItem &dataset,
114  DcmStack *markedItems = NULL);
115 
123  DSRXMLCursor cursor,
124  const size_t flags);
125 
131  OFCondition writeXML(STD_NAMESPACE ostream &stream,
132  const size_t flags);
133 
140  OFCondition renderHTML(STD_NAMESPACE ostream &docStream,
141  STD_NAMESPACE ostream &annexStream,
142  const size_t flags = 0);
143 
148  {
149  return DocumentType;
150  }
151 
158  OFCondition changeDocumentType(const E_DocumentType documentType);
159 
173  OFBool canAddContentItem(const E_RelationshipType relationshipType,
174  const E_ValueType valueType,
175  const E_AddMode addMode = AM_afterCurrent);
176 
183  OFBool canAddByReferenceRelationship(const E_RelationshipType relationshipType,
184  const E_ValueType targetValueType);
185 
196  size_t addContentItem(const E_RelationshipType relationshipType,
197  const E_ValueType valueType,
198  const E_AddMode addMode = AM_afterCurrent);
199 
208  size_t addByReferenceRelationship(const E_RelationshipType relationshipType,
209  const size_t referencedNodeID);
210 
218  size_t removeCurrentContentItem();
219 
225 
236  size_t gotoNamedNode(const DSRCodedEntryValue &conceptName,
237  const OFBool startFromRoot = OFTrue,
238  const OFBool searchIntoSub = OFTrue);
239 
248  size_t gotoNextNamedNode(const DSRCodedEntryValue &conceptName,
249  const OFBool searchIntoSub = OFTrue);
250 
257  void unmarkAllContentItems();
258 
263  void removeSignatures();
264 
265 
266  protected:
267 
277  virtual size_t addNode(DSRDocumentTreeNode *node,
278  const E_AddMode addMode = AM_afterCurrent);
279 
287  virtual size_t removeNode();
288 
303  OFCondition checkByReferenceRelationships(const size_t mode = 0,
304  const size_t flags = 0);
305 
310 
311 
312  private:
313 
321  virtual size_t addNode(DSRTreeNode *node,
322  const E_AddMode addMode = AM_afterCurrent);
323 
330 
331 
332  // --- declaration of default/copy constructor and assignment operator
333 
334  DSRDocumentTree();
336  DSRDocumentTree &operator=(const DSRDocumentTree &);
337 };
338 
339 
340 #endif
341 
342 
343 /*
344  * CVS/RCS Log:
345  * $Log: dsrdoctr.h,v $
346  * Revision 1.23 2010-10-14 13:16:32 joergr
347  * Updated copyright header. Added reference to COPYRIGHT file.
348  *
349  * Revision 1.22 2009-10-13 14:57:50 uli
350  * Switched to logging mechanism provided by the "new" oflog module.
351  *
352  * Revision 1.21 2008-05-19 09:46:40 joergr
353  * Reset flag for all content items whether they are target of a by-reference
354  * relationship (required for an reproducible behavior).
355  * Changed parameters of checkByReferenceRelationships() method.
356  *
357  * Revision 1.20 2007/11/15 16:33:30 joergr
358  * Added support for output in XHTML 1.1 format.
359  *
360  * Revision 1.19 2007/05/11 14:50:05 joergr
361  * Enhanced debug output when detecting by-reference relationships to non-
362  * existing content items.
363  *
364  * Revision 1.18 2006/08/15 16:40:03 meichel
365  * Updated the code in module dcmsr to correctly compile when
366  * all standard C++ classes remain in namespace std.
367  *
368  * Revision 1.17 2006/05/11 09:18:21 joergr
369  * Moved containsExtendedCharacters() from dcmsr to dcmdata module.
370  *
371  * Revision 1.16 2005/12/08 16:05:01 meichel
372  * Changed include path schema for all DCMTK header files
373  *
374  * Revision 1.15 2005/07/27 16:36:38 joergr
375  * Added methods that allow to go to a named node, i.e. using a given concept
376  * name.
377  *
378  * Revision 1.14 2004/11/22 16:39:09 meichel
379  * Added method that checks if the SR document contains non-ASCII characters
380  * in any of the strings affected by SpecificCharacterSet.
381  *
382  * Revision 1.13 2003/09/15 14:18:54 joergr
383  * Introduced new class to facilitate checking of SR IOD relationship content
384  * constraints. Replaced old implementation distributed over numerous classes.
385  *
386  * Revision 1.12 2003/08/07 12:35:27 joergr
387  * Added readXML functionality.
388  * Updated documentation to get rid of doxygen warnings.
389  *
390  * Revision 1.11 2002/04/11 13:02:34 joergr
391  * Corrected typo and/or enhanced documentation.
392  *
393  * Revision 1.10 2001/11/09 16:10:49 joergr
394  * Added preliminary support for Mammography CAD SR.
395  *
396  * Revision 1.9 2001/09/26 13:04:07 meichel
397  * Adapted dcmsr to class OFCondition
398  *
399  * Revision 1.8 2001/04/03 08:24:01 joergr
400  * Added new command line option: ignore relationship content constraints
401  * specified for each SR document class.
402  *
403  * Revision 1.7 2001/01/25 11:48:43 joergr
404  * Corrected typos / enhanced comments.
405  *
406  * Revision 1.6 2001/01/18 15:53:34 joergr
407  * Added support for digital signatures.
408  *
409  * Revision 1.5 2000/11/07 18:14:29 joergr
410  * Enhanced support for by-reference relationships.
411  *
412  * Revision 1.4 2000/11/01 16:23:20 joergr
413  * Added support for conversion to XML.
414  *
415  * Revision 1.3 2000/10/18 17:02:57 joergr
416  * Added doc++ comments.
417  *
418  * Revision 1.2 2000/10/16 16:31:45 joergr
419  * Added doc++ comments.
420  *
421  * Revision 1.1 2000/10/13 07:49:26 joergr
422  * Added new module 'dcmsr' providing access to DICOM structured reporting
423  * documents (supplement 23). Doc++ documentation not yet completed.
424  *
425  *
426  */


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