00001 /* 00002 * 00003 * Copyright (C) 2000-2003, 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: dcmsr 00019 * 00020 * Author: Joerg Riesmeier 00021 * 00022 * Purpose: 00023 * classes: DSRDocumentTree 00024 * 00025 * Last Update: $Author: joergr $ 00026 * Update Date: $Date: 2003/09/15 14:18:54 $ 00027 * CVS/RCS Revision: $Revision: 1.13 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 00035 #ifndef DSRDOCTR_H 00036 #define DSRDOCTR_H 00037 00038 #include "osconfig.h" /* make sure OS specific configuration is included first */ 00039 00040 #include "dsrtree.h" 00041 #include "dsrdoctn.h" 00042 #include "dsrcitem.h" 00043 00044 #include "dcitem.h" 00045 00046 00047 /*-----------------------* 00048 * forward declaration * 00049 *-----------------------*/ 00050 00051 class DSRIODConstraintChecker; 00052 00053 00054 /*---------------------* 00055 * class declaration * 00056 *---------------------*/ 00057 00060 class DSRDocumentTree 00061 : public DSRTree 00062 { 00063 00064 public: 00065 00069 DSRDocumentTree(const E_DocumentType documentType); 00070 00073 virtual ~DSRDocumentTree(); 00074 00078 virtual void clear(); 00079 00086 virtual OFBool isValid() const; 00087 00092 void setLogStream(OFConsole *stream); 00093 00099 OFCondition print(ostream &stream, 00100 const size_t flags = 0); 00101 00111 OFCondition read(DcmItem &dataset, 00112 const E_DocumentType documentType, 00113 const size_t flags = 0); 00114 00123 OFCondition write(DcmItem &dataset, 00124 DcmStack *markedItems = NULL); 00125 00132 OFCondition readXML(const DSRXMLDocument &doc, 00133 DSRXMLCursor cursor, 00134 const size_t flags); 00135 00141 OFCondition writeXML(ostream &stream, 00142 const size_t flags); 00143 00150 OFCondition renderHTML(ostream &docStream, 00151 ostream &annexStream, 00152 const size_t flags = 0); 00153 00157 E_DocumentType getDocumentType() const 00158 { 00159 return DocumentType; 00160 } 00161 00168 OFCondition changeDocumentType(const E_DocumentType documentType); 00169 00183 OFBool canAddContentItem(const E_RelationshipType relationshipType, 00184 const E_ValueType valueType, 00185 const E_AddMode addMode = AM_afterCurrent); 00186 00193 OFBool canAddByReferenceRelationship(const E_RelationshipType relationshipType, 00194 const E_ValueType targetValueType); 00195 00206 size_t addContentItem(const E_RelationshipType relationshipType, 00207 const E_ValueType valueType, 00208 const E_AddMode addMode = AM_afterCurrent); 00209 00218 size_t addByReferenceRelationship(const E_RelationshipType relationshipType, 00219 const size_t referencedNodeID); 00220 00228 size_t removeCurrentContentItem(); 00229 00234 DSRContentItem &getCurrentContentItem(); 00235 00242 void unmarkAllContentItems(); 00243 00248 void removeSignatures(); 00249 00250 00251 protected: 00252 00262 virtual size_t addNode(DSRDocumentTreeNode *node, 00263 const E_AddMode addMode = AM_afterCurrent); 00264 00272 virtual size_t removeNode(); 00273 00288 OFCondition checkByReferenceRelationships(const OFBool updateString = OFFalse, 00289 const OFBool updateNodeID = OFFalse); 00290 00291 00292 private: 00293 00301 virtual size_t addNode(DSRTreeNode *node, 00302 const E_AddMode addMode = AM_afterCurrent); 00303 00305 E_DocumentType DocumentType; 00307 OFConsole *LogStream; 00309 DSRContentItem CurrentContentItem; 00311 DSRIODConstraintChecker *ConstraintChecker; 00312 00313 00314 // --- declaration of default/copy constructor and assignment operator 00315 00316 DSRDocumentTree(); 00317 DSRDocumentTree(const DSRDocumentTree &); 00318 DSRDocumentTree &operator=(const DSRDocumentTree &); 00319 }; 00320 00321 00322 #endif 00323 00324 00325 /* 00326 * CVS/RCS Log: 00327 * $Log: dsrdoctr.h,v $ 00328 * Revision 1.13 2003/09/15 14:18:54 joergr 00329 * Introduced new class to facilitate checking of SR IOD relationship content 00330 * constraints. Replaced old implementation distributed over numerous classes. 00331 * 00332 * Revision 1.12 2003/08/07 12:35:27 joergr 00333 * Added readXML functionality. 00334 * Updated documentation to get rid of doxygen warnings. 00335 * 00336 * Revision 1.11 2002/04/11 13:02:34 joergr 00337 * Corrected typo and/or enhanced documentation. 00338 * 00339 * Revision 1.10 2001/11/09 16:10:49 joergr 00340 * Added preliminary support for Mammography CAD SR. 00341 * 00342 * Revision 1.9 2001/09/26 13:04:07 meichel 00343 * Adapted dcmsr to class OFCondition 00344 * 00345 * Revision 1.8 2001/04/03 08:24:01 joergr 00346 * Added new command line option: ignore relationship content constraints 00347 * specified for each SR document class. 00348 * 00349 * Revision 1.7 2001/01/25 11:48:43 joergr 00350 * Corrected typos / enhanced comments. 00351 * 00352 * Revision 1.6 2001/01/18 15:53:34 joergr 00353 * Added support for digital signatures. 00354 * 00355 * Revision 1.5 2000/11/07 18:14:29 joergr 00356 * Enhanced support for by-reference relationships. 00357 * 00358 * Revision 1.4 2000/11/01 16:23:20 joergr 00359 * Added support for conversion to XML. 00360 * 00361 * Revision 1.3 2000/10/18 17:02:57 joergr 00362 * Added doc++ comments. 00363 * 00364 * Revision 1.2 2000/10/16 16:31:45 joergr 00365 * Added doc++ comments. 00366 * 00367 * Revision 1.1 2000/10/13 07:49:26 joergr 00368 * Added new module 'dcmsr' providing access to DICOM structured reporting 00369 * documents (supplement 23). Doc++ documentation not yet completed. 00370 * 00371 * 00372 */