00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef DSRDOCTR_H
00036 #define DSRDOCTR_H
00037
00038 #include "osconfig.h"
00039
00040 #include "dsrtree.h"
00041 #include "dsrdoctn.h"
00042 #include "dsrcitem.h"
00043
00044 #include "dcitem.h"
00045
00046
00047
00048
00049
00050
00051 class DSRIODConstraintChecker;
00052
00053
00054
00055
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
00315
00316 DSRDocumentTree();
00317 DSRDocumentTree(const DSRDocumentTree &);
00318 DSRDocumentTree &operator=(const DSRDocumentTree &);
00319 };
00320
00321
00322 #endif
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372