OFFIS DCMTK  Version 3.6.0
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
DSRDocumentTreeNode Class Reference

Base class for content items. More...

Inheritance diagram for DSRDocumentTreeNode:
[legend]
Collaboration diagram for DSRDocumentTreeNode:
[legend]

Public Member Functions

 DSRDocumentTreeNode (const E_RelationshipType relationshipType, const E_ValueType valueType)
 constructor.
 
virtual ~DSRDocumentTreeNode ()
 destructor
 
virtual void clear ()
 clear all member variables.
 
virtual OFBool isValid () const
 check whether the content item is valid.
 
virtual OFBool isShort (const size_t flags) const
 check whether the content is short.
 
virtual OFCondition print (STD_NAMESPACE ostream &stream, const size_t flags) const
 print content item.
 
virtual OFCondition read (DcmItem &dataset, const DSRIODConstraintChecker *constraintChecker, const size_t flags)
 read content item from dataset.
 
virtual OFCondition write (DcmItem &dataset, DcmStack *markedItems=NULL)
 write content item to dataset.
 
virtual OFCondition readXML (const DSRXMLDocument &doc, DSRXMLCursor cursor, const E_DocumentType documentType, const size_t flags)
 read general XML document tree node data
 
virtual OFCondition writeXML (STD_NAMESPACE ostream &stream, const size_t flags) const
 write content item in XML format
 
virtual OFCondition renderHTML (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, const size_t nestingLevel, size_t &annexNumber, const size_t flags) const
 render content item in HTML/XHTML format.
 
OFBool isSigned ()
 check whether content item is digitally signed.
 
OFBool isMarked () const
 check whether content item is marked.
 
void setMark (const OFBool flag)
 mark/unmark the current content item.
 
OFBool isReferenceTarget () const
 check whether the current content item is target of a by-reference relationship
 
void setReferenceTarget (const OFBool isTarget=OFTrue)
 specify whether the current content item is target of a by-reference relationship
 
OFBool hasChildNodes () const
 check whether the current content item has any children
 
OFBool hasSiblingNodes () const
 check whether the current content item has any siblings
 
size_t getNodeID () const
 get ID of the current tree node
 
E_RelationshipType getRelationshipType () const
 get relationship type of the current content item
 
E_ValueType getValueType () const
 get value type of the current content item
 
const DSRCodedEntryValuegetConceptName () const
 get reference to the concept name
 
OFCondition getConceptName (DSRCodedEntryValue &conceptName) const
 get copy of the concept name.
 
virtual OFCondition setConceptName (const DSRCodedEntryValue &conceptName)
 set the concept name.
 
const OFStringgetObservationDateTime () const
 get observation date time.
 
virtual OFCondition setObservationDateTime (const OFString &observationDateTime)
 set observation date time.
 
OFCondition getTemplateIdentification (OFString &templateIdentifier, OFString &mappingResource) const
 get template identifier and mapping resource.
 
virtual OFCondition setTemplateIdentification (const OFString &templateIdentifier, const OFString &mappingResource)
 set template identifier and mapping resource.
 
void removeSignatures ()
 remove digital signatures from content item.
 
- Public Member Functions inherited from DSRTreeNode
 DSRTreeNode ()
 default constructor
 
virtual ~DSRTreeNode ()
 destructor
 

Protected Member Functions

DSRCodedEntryValuegetConceptNamePtr ()
 get pointer to the concept name
 
OFCondition createAndAppendNewNode (DSRDocumentTreeNode *&previousNode, const E_RelationshipType relationshipType, const E_ValueType valueType, const DSRIODConstraintChecker *constraintChecker=NULL)
 create a new node and append it to the current one
 
virtual OFCondition readContentItem (DcmItem &dataset)
 read content item (value) from dataset.
 
virtual OFCondition writeContentItem (DcmItem &dataset) const
 write content item (value) to dataset.
 
virtual OFCondition readXMLContentItem (const DSRXMLDocument &doc, DSRXMLCursor cursor)
 read content item specific XML data.
 
virtual OFCondition renderHTMLContentItem (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, const size_t nestingLevel, size_t &annexNumber, const size_t flags) const
 render content item (value) in HTML/XHTML format.
 
void writeXMLItemStart (STD_NAMESPACE ostream &stream, const size_t flags, const OFBool closingBracket=OFTrue) const
 write common item start (XML tag)
 
void writeXMLItemEnd (STD_NAMESPACE ostream &stream, const size_t flags) const
 write common item start (XML tag)
 
OFCondition readSRDocumentContentModule (DcmItem &dataset, const DSRIODConstraintChecker *constraintChecker, const size_t flags)
 read SR document content module
 
OFCondition writeSRDocumentContentModule (DcmItem &dataset, DcmStack *markedItems)
 write SR document content module
 
OFCondition readDocumentRelationshipMacro (DcmItem &dataset, const DSRIODConstraintChecker *constraintChecker, const OFString &posString, const size_t flags)
 read document relationship macro
 
OFCondition writeDocumentRelationshipMacro (DcmItem &dataset, DcmStack *markedItems)
 write document relationship macro
 
OFCondition readDocumentContentMacro (DcmItem &dataset, const OFString &posString, const size_t flags)
 read document content macro
 
OFCondition writeDocumentContentMacro (DcmItem &dataset) const
 write document content macro
 
OFCondition readContentSequence (DcmItem &dataset, const DSRIODConstraintChecker *constraintChecker, const OFString &posString, const size_t flags)
 read content sequence
 
OFCondition writeContentSequence (DcmItem &dataset, DcmStack *markedItems) const
 write content sequence
 
OFCondition renderHTMLConceptName (STD_NAMESPACE ostream &docStream, const size_t flags) const
 render concept name in HTML/XHTML format.
 
OFCondition renderHTMLChildNodes (STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, const size_t nestingLevel, size_t &annexNumber, const size_t flags) const
 render child nodes in HTML/XHTML format
 

Static Protected Member Functions

static const OFStringgetRelationshipText (const E_RelationshipType relationshipType, OFString &relationshipText, const size_t flags)
 convert relationship type into a text used for HTML rendering
 

Private Member Functions

 DSRDocumentTreeNode (const DSRDocumentTreeNode &)
 
DSRDocumentTreeNodeoperator= (const DSRDocumentTreeNode &)
 

Private Attributes

OFBool MarkFlag
 flag indicating whether the content item is marked (e.g. used for digital signatures)
 
OFBool ReferenceTarget
 flag indicating whether the content item is referenced (by-reference relationship)
 
const E_RelationshipType RelationshipType
 relationship type to the parent node (associated DICOM VR=CS, mandatory)
 
const E_ValueType ValueType
 value type (associated DICOM VR=CS, mandatory)
 
DSRCodedEntryValue ConceptName
 concept name (VR=SQ, conditional)
 
OFString ObservationDateTime
 observation date and time (VR=DT, conditional)
 
OFString TemplateIdentifier
 template identifier (VR=CS, mandatory in ContentTemplateSequence)
 
OFString MappingResource
 mapping resource (VR=CS, mandatory in ContentTemplateSequence)
 
DcmSequenceOfItems MACParameters
 MAC parameters sequence (VR=SQ, optional)
 
DcmSequenceOfItems DigitalSignatures
 digital signatures sequence (VR=SQ, optional)
 

Friends

class DSRContentItem
 

Additional Inherited Members

- Protected Types inherited from DSRTypes
enum  E_DocumentType {
  DT_invalid, DT_unknown = DT_invalid, DT_BasicTextSR, DT_EnhancedSR,
  DT_ComprehensiveSR, DT_KeyObjectSelectionDocument, DT_MammographyCadSR, DT_ChestCadSR,
  DT_ColonCadSR, DT_ProcedureLog, DT_XRayRadiationDoseSR, DT_SpectaclePrescriptionReport,
  DT_MacularGridThicknessAndVolumeReport, DT_ImplantationPlanSRDocument, DT_last = DT_ImplantationPlanSRDocument
}
 SR document types. More...
 
enum  E_RelationshipType {
  RT_invalid, RT_unknown, RT_isRoot, RT_contains,
  RT_hasObsContext, RT_hasAcqContext, RT_hasConceptMod, RT_hasProperties,
  RT_inferredFrom, RT_selectedFrom, RT_last = RT_selectedFrom
}
 SR relationship types. More...
 
enum  E_ValueType {
  VT_invalid, VT_Text, VT_Code, VT_Num,
  VT_DateTime, VT_Date, VT_Time, VT_UIDRef,
  VT_PName, VT_SCoord, VT_SCoord3D, VT_TCoord,
  VT_Composite, VT_Image, VT_Waveform, VT_Container,
  VT_byReference, VT_last = VT_byReference
}
 SR value types. More...
 
enum  E_GraphicType {
  GT_invalid, GT_unknown = GT_invalid, GT_Point, GT_Multipoint,
  GT_Polyline, GT_Circle, GT_Ellipse, GT_last = GT_Ellipse
}
 SR graphic types. More...
 
enum  E_GraphicType3D {
  GT3_invalid, GT3_unknown = GT3_invalid, GT3_Point, GT3_Multipoint,
  GT3_Polyline, GT3_Polygon, GT3_Ellipse, GT3_Ellipsoid,
  GT3_last = GT3_Ellipsoid
}
 SR graphic types (3D). More...
 
enum  E_TemporalRangeType {
  TRT_invalid, TRT_unknown = TRT_invalid, TRT_Point, TRT_Multipoint,
  TRT_Segment, TRT_Multisegment, TRT_Begin, TRT_End,
  TRT_last = TRT_End
}
 SR temporal range types. More...
 
enum  E_ContinuityOfContent { COC_invalid, COC_Separate, COC_Continuous, COC_last = COC_Continuous }
 SR continuity of content flag. More...
 
enum  E_PreliminaryFlag { PF_invalid, PF_Preliminary, PF_Final, PF_last = PF_Final }
 SR document preliminary flag. More...
 
enum  E_CompletionFlag { CF_invalid, CF_Partial, CF_Complete, CF_last = CF_Complete }
 SR document completion flag. More...
 
enum  E_VerificationFlag { VF_invalid, VF_Unverified, VF_Verified, VF_last = VF_Verified }
 SR document verification flag. More...
 
enum  E_CharacterSet {
  CS_invalid, CS_unknown = CS_invalid, CS_ASCII, CS_Latin1,
  CS_Latin2, CS_Latin3, CS_Latin4, CS_Cyrillic,
  CS_Arabic, CS_Greek, CS_Hebrew, CS_Latin5,
  CS_Japanese, CS_Thai, CS_UTF8, CS_last = CS_UTF8
}
 Specific character set. More...
 
enum  E_AddMode { AM_afterCurrent, AM_beforeCurrent, AM_belowCurrent }
 Add node mode. More...
 
- Protected Attributes inherited from DSRTreeNode
DSRTreeNodePrev
 pointer to previous tree node (if any)
 
DSRTreeNodeNext
 pointer to next tree node (if any)
 
DSRTreeNodeDown
 pointer to first child node (if any)
 
const size_t Ident
 unique identifier (created automatically)
 
- Static Protected Attributes inherited from DSRTypes
static const size_t RF_readDigitalSignatures
 read digital signatures from dataset
 
static const size_t RF_acceptUnknownRelationshipType
 accept unknown/missing relationship type
 
static const size_t RF_ignoreRelationshipConstraints
 ignore relationship constraints for this document class
 
static const size_t RF_ignoreContentItemErrors
 do not abort on content item errors (e.g. missing value type specific attributes)
 
static const size_t RF_skipInvalidContentItems
 do not abort when detecting an invalid content item, skip invalid sub-tree instead
 
static const size_t RF_showCurrentlyProcessedItem
 show the currently processed content item (e.g. "1.2.3")
 
static const size_t HF_neverExpandChildrenInline
 external: never expand child nodes inline
 
static const size_t HF_alwaysExpandChildrenInline
 external: always expand child nodes inline
 
static const size_t HF_renderInlineCodes
 external: render codes even if they appear inline
 
static const size_t HF_useCodeDetailsTooltip
 external: render code details as a tooltip (not with HTML 3.2)
 
static const size_t HF_renderConceptNameCodes
 external: render concept name codes (default: code meaning only)
 
static const size_t HF_renderNumericUnitCodes
 external: render the code of the numeric measurement unit
 
static const size_t HF_useCodeMeaningAsUnit
 external: use code meaning for the numeric measurement unit (default: code value)
 
static const size_t HF_renderPatientTitle
 external: use patient information as document title (default: document type)
 
static const size_t HF_renderNoDocumentHeader
 external: render no general document information (header)
 
static const size_t HF_renderDcmtkFootnote
 external: render dcmtk/dcmsr comment at the end of the document
 
static const size_t HF_renderFullData
 external: render the full data of all content items
 
static const size_t HF_renderSectionTitlesInline
 external: render section titles inline (default: separate paragraph)
 
static const size_t HF_copyStyleSheetContent
 external: copy Cascading Style Sheet (CSS) content to HTML file
 
static const size_t HF_HTML32Compatibility
 external: output compatible to HTML version 3.2 (default: 4.01)
 
static const size_t HF_XHTML11Compatibility
 external: output compatible to XHTML version 1.1 (default: HTML 4.01)
 
static const size_t HF_addDocumentTypeReference
 external: add explicit reference to HTML document type (DTD)
 
static const size_t HF_omitGeneratorMetaElement
 external: omit generator meta element referring to the DCMTK
 
static const size_t HF_renderItemsSeparately
 internal: render items separately (for container with SEPARATE flag)
 
static const size_t HF_renderItemInline
 internal: expand items inline when they are short and have no child nodes
 
static const size_t HF_currentlyInsideAnnex
 internal: content item is rendered fully inside the annex
 
static const size_t HF_createFootnoteReferences
 internal: create footnote references
 
static const size_t HF_convertNonASCIICharacters
 internal: convert non-ASCII characters (> #127) to &#nnn;
 
static const size_t HF_renderAllCodes
 shortcut: render all codes
 
static const size_t HF_internalUseOnly
 shortcut: filter all flags that are only used internally
 
static const size_t XF_writeEmptyTags
 write: write all tags even if their value is empty
 
static const size_t XF_writeTemplateIdentification
 write: write template identification information (TID and mapping resource)
 
static const size_t XF_alwaysWriteItemIdentifier
 write: always write item identifier "id", not only when item is referenced
 
static const size_t XF_codeComponentsAsAttribute
 write: encode code value, coding scheme designator and coding scheme version as attribute instead of element text
 
static const size_t XF_relationshipTypeAsAttribute
 write: encode relationship type as attribute instead of element text
 
static const size_t XF_valueTypeAsAttribute
 write: encode value type as attribute instead of element text
 
static const size_t XF_templateIdentifierAsAttribute
 write: encode template identifier as attribute instead of element text
 
static const size_t XF_useDcmsrNamespace
 write: add DCMSR namespace declaration to the XML output
 
static const size_t XF_addSchemaReference
 write: add Schema reference to XML document
 
static const size_t XF_validateSchema
 read: validate content of XML document against Schema
 
static const size_t XF_templateElementEnclosesItems
 read/write: template identification element encloses content items
 
static const size_t XF_encodeEverythingAsAttribute
 shortcut: combines all XF_xxxAsAttribute write flags (see above)
 
static const size_t PF_printItemPosition
 print item position ("1.2.3") instead of line indentation
 
static const size_t PF_shortenLongItemValues
 shorten long item value (e.g. long texts)
 
static const size_t PF_printSOPInstanceUID
 print SOP instance UID of referenced objects
 
static const size_t PF_printConceptNameCodes
 print coding scheme designator/version and code value of concept names
 
static const size_t PF_printNoDocumentHeader
 print no general document information (header)
 
static const size_t PF_printTemplateIdentification
 print template identification (TID and mapping resource)
 
static const size_t PF_printAllCodes
 shortcut: print all codes
 
static const size_t CM_updatePositionString
 update the position string using the node ID
 
static const size_t CM_updateNodeID
 update the node ID using the position string
 
static const size_t CM_resetReferenceTargetFlag
 reset the reference target flag for all nodes
 

Detailed Description

Base class for content items.

Definition at line 54 of file dsrdoctn.h.

Constructor & Destructor Documentation

DSRDocumentTreeNode::DSRDocumentTreeNode ( const E_RelationshipType  relationshipType,
const E_ValueType  valueType 
)

constructor.

The 'relationshipType' and 'valueType' can never be changed after the tree node has been created (therefore, the corresponding member variables are declared "const").

Parameters
relationshipTypetype of relationship to the parent tree node. Should not be RT_invalid and RT_isRoot only for the root node.
valueTypevalue type of the associated content item. Should not be VT_invalid.

Member Function Documentation

virtual void DSRDocumentTreeNode::clear ( )
virtual
OFCondition DSRDocumentTreeNode::createAndAppendNewNode ( DSRDocumentTreeNode *&  previousNode,
const E_RelationshipType  relationshipType,
const E_ValueType  valueType,
const DSRIODConstraintChecker constraintChecker = NULL 
)
protected

create a new node and append it to the current one

Parameters
previousNodereference to the pointer to the previous node (sibling). Used to decide whether the new node is a child (value=NULL) or a sibling (!=NULL). NB: The value might be modified inside this method (to store a reference to the previous node).
relationshipTyperelationship type of the new node with regard to the current one
valueTypevalue type of node to be added
constraintCheckerchecks relationship content constraints of the associated IOD
Returns
status, EC_Normal if successful, an error code otherwise
const DSRCodedEntryValue& DSRDocumentTreeNode::getConceptName ( ) const
inline

get reference to the concept name

Returns
reference to the concept name (code, might be empty/invalid)

Definition at line 263 of file dsrdoctn.h.

References ConceptName.

OFCondition DSRDocumentTreeNode::getConceptName ( DSRCodedEntryValue conceptName) const

get copy of the concept name.

Code describing the concept represented by this content item. Also conveys the value of document title and section headings in documents.

Parameters
conceptNamereference to a variable where the code should be stored
Returns
status, EC_Normal if successful, an error code otherwise
DSRCodedEntryValue* DSRDocumentTreeNode::getConceptNamePtr ( )
inlineprotected

get pointer to the concept name

Returns
pointer to the concept name (never NULL)

Definition at line 343 of file dsrdoctn.h.

References ConceptName.

size_t DSRDocumentTreeNode::getNodeID ( ) const
inline

get ID of the current tree node

Returns
ID of the current tree node (should never be 0)

Definition at line 239 of file dsrdoctn.h.

References DSRTreeNode::Ident.

const OFString& DSRDocumentTreeNode::getObservationDateTime ( ) const
inline

get observation date time.

This is the date and time on which this content item was completed. Might be empty if the date and time do not differ from the content date and time, see DSRDocument.

Returns
observation date and time of current content item (might be empty/invalid)

Definition at line 291 of file dsrdoctn.h.

References ObservationDateTime.

static const OFString& DSRDocumentTreeNode::getRelationshipText ( const E_RelationshipType  relationshipType,
OFString relationshipText,
const size_t  flags 
)
staticprotected

convert relationship type into a text used for HTML rendering

Parameters
relationshipTypetype of relationship to be converted
relationshipTextreference to string variable where the resulting text should be stored. Value is cleared if 'relationshipType' is invalid or not supported.
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
reference to the 'relationshipText' string (might be empty)
E_RelationshipType DSRDocumentTreeNode::getRelationshipType ( ) const
inline

get relationship type of the current content item

Returns
relationship type of the current content item (might be RT_invalid)

Definition at line 247 of file dsrdoctn.h.

References RelationshipType.

OFCondition DSRDocumentTreeNode::getTemplateIdentification ( OFString templateIdentifier,
OFString mappingResource 
) const

get template identifier and mapping resource.

This value pair identifies the template that was used to create this content item (and its children). According to the DICOM standard it is "required if a template was used to define the content of this Item, and the template consists of a single CONTAINER with nested content, and it is the outermost invocation of a set of nested templates that start with the same CONTAINER." However, this condition is currently not checked. The identification is valid if both values are either present (non-empty) or absent (empty).

Parameters
templateIdentifieridentifier of the template (might be empty)
mappingResourcemapping resource that defines the template (might be empty)
Returns
status, EC_Normal if successful, an error code otherwise
E_ValueType DSRDocumentTreeNode::getValueType ( ) const
inline

get value type of the current content item

Returns
value type of the current content item (might be VT_invalid)

Definition at line 255 of file dsrdoctn.h.

References ValueType.

OFBool DSRDocumentTreeNode::hasChildNodes ( ) const
inline

check whether the current content item has any children

Returns
OFTrue if there are any child nodes, OFFalse otherwise

Definition at line 223 of file dsrdoctn.h.

References DSRTreeNode::Down.

OFBool DSRDocumentTreeNode::hasSiblingNodes ( ) const
inline

check whether the current content item has any siblings

Returns
OFTrue if there are any sibling nodes, OFFalse otherwise

Definition at line 231 of file dsrdoctn.h.

References DSRTreeNode::Next, and DSRTreeNode::Prev.

OFBool DSRDocumentTreeNode::isMarked ( ) const
inline

check whether content item is marked.

Use method 'setMark' to mark and unmark the current content item. Pointers to the DICOM dataset/item of marked content items are added to the optional stack when calling the 'write' method. This mechanism can e.g. be used to digitally sign particular content items.

Returns
OFTrue if content item is marked, OFFalse otherwise

Definition at line 190 of file dsrdoctn.h.

References MarkFlag.

OFBool DSRDocumentTreeNode::isReferenceTarget ( ) const
inline

check whether the current content item is target of a by-reference relationship

Returns
OFTrue if the content item is target, OFFalse otherwise

Definition at line 207 of file dsrdoctn.h.

References ReferenceTarget.

virtual OFBool DSRDocumentTreeNode::isShort ( const size_t  flags) const
virtual

check whether the content is short.

This method is used to check whether the rendered output of this content item can be expanded inline or not (used for renderHTML()). This base class always returns OFTrue.

Parameters
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
OFTrue if the content is short, OFFalse otherwise

Reimplemented in DSRTextTreeNode, DSRContainerTreeNode, DSRImageTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, and DSRWaveformTreeNode.

OFBool DSRDocumentTreeNode::isSigned ( )
inline

check whether content item is digitally signed.

A content item is signed if the DigitalSignaturesSequence exists. This sequence is read from the dataset if present and the 'signature' flag for the 'read' method is turned on.

Returns
OFTrue if content item is signed, OFFalse otherwise

Definition at line 178 of file dsrdoctn.h.

References DcmSequenceOfItems::card(), and DigitalSignatures.

virtual OFBool DSRDocumentTreeNode::isValid ( ) const
virtual

check whether the content item is valid.

The content item is valid if the relationship type and the value type are both not invalid.

Returns
OFTrue if tree node is valid, OFFalse otherwise

Reimplemented in DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRTimeTreeNode, DSRUIDRefTreeNode, DSRContainerTreeNode, DSRCodeTreeNode, DSRCompositeTreeNode, DSRImageTreeNode, DSRNumTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, and DSRWaveformTreeNode.

virtual OFCondition DSRDocumentTreeNode::print ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const
virtual

print content item.

The output of a content item depends on its value type. This general method prints only those parts which all derived classes (= value types) do have in common, i.e. the type of relationship, the value type and the (optional) concept name. A typical output looks like this: has concept mod CODE: (,,"Concept")

Parameters
streamoutput stream to which the content item should be printed
flagsflag used to customize the output (see DSRTypes::PF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRTextTreeNode, DSRContainerTreeNode, DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRImageTreeNode, DSRPNameTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, DSRTimeTreeNode, DSRUIDRefTreeNode, DSRWaveformTreeNode, DSRCodeTreeNode, DSRNumTreeNode, and DSRCompositeTreeNode.

virtual OFCondition DSRDocumentTreeNode::read ( DcmItem dataset,
const DSRIODConstraintChecker constraintChecker,
const size_t  flags 
)
virtual

read content item from dataset.

A number of readXXX() methods are called (see "protected" part) in order to retrieve all possibly nested content items from the dataset.

Parameters
datasetDICOM dataset from which the content item should be read
constraintCheckerchecks relationship content constraints of the associated IOD
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRDocumentTreeNode::readContentItem ( DcmItem dataset)
protectedvirtual

read content item (value) from dataset.

This method does nothing for this base class, but derived classes overwrite it to read the contents according to their value type.

Parameters
datasetDICOM dataset from which the content item should be read
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRContainerTreeNode, DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRTimeTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRImageTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, DSRUIDRefTreeNode, DSRWaveformTreeNode, DSRCodeTreeNode, DSRNumTreeNode, and DSRCompositeTreeNode.

OFCondition DSRDocumentTreeNode::readContentSequence ( DcmItem dataset,
const DSRIODConstraintChecker constraintChecker,
const OFString posString,
const size_t  flags 
)
protected

read content sequence

Parameters
datasetDICOM dataset from which the data should be read
constraintCheckerchecks relationship content constraints of the associated IOD
posStringlocation of the current content item (e.g. "1.2.3")
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::readDocumentContentMacro ( DcmItem dataset,
const OFString posString,
const size_t  flags 
)
protected

read document content macro

Parameters
datasetDICOM dataset from which the data should be read
posStringlocation of the current content item (e.g. "1.2.3")
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::readDocumentRelationshipMacro ( DcmItem dataset,
const DSRIODConstraintChecker constraintChecker,
const OFString posString,
const size_t  flags 
)
protected

read document relationship macro

Parameters
datasetDICOM dataset from which the data should be read
constraintCheckerchecks relationship content constraints of the associated IOD
posStringlocation of the current content item (e.g. "1.2.3")
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::readSRDocumentContentModule ( DcmItem dataset,
const DSRIODConstraintChecker constraintChecker,
const size_t  flags 
)
protected

read SR document content module

Parameters
datasetDICOM dataset from which the data should be read
constraintCheckerchecks relationship content constraints of the associated IOD
flagsflag used to customize the reading process (see DSRTypes::RF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRDocumentTreeNode::readXML ( const DSRXMLDocument doc,
DSRXMLCursor  cursor,
const E_DocumentType  documentType,
const size_t  flags 
)
virtual

read general XML document tree node data

Parameters
docdocument containing the XML file content
cursorcursor pointing to the starting node
documentTypetype of the document to be read (used for debug output only)
flagsoptional flag used to customize the reading process (see DSRTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRDocumentTreeNode::readXMLContentItem ( const DSRXMLDocument doc,
DSRXMLCursor  cursor 
)
protectedvirtual

read content item specific XML data.

This method does nothing for this base class, but derived classes overwrite it to read the contents according to their value type.

Parameters
docdocument containing the XML file content
cursorcursor pointing to the starting node
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRContainerTreeNode, DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRTimeTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRImageTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, DSRUIDRefTreeNode, DSRWaveformTreeNode, DSRCodeTreeNode, DSRNumTreeNode, and DSRCompositeTreeNode.

void DSRDocumentTreeNode::removeSignatures ( )

remove digital signatures from content item.

This method clears the MACParametersSequence and the DigitalSignaturesSequence for the current content item which have been filled during reading.

virtual OFCondition DSRDocumentTreeNode::renderHTML ( STD_NAMESPACE ostream &  docStream,
STD_NAMESPACE ostream &  annexStream,
const size_t  nestingLevel,
size_t &  annexNumber,
const size_t  flags 
) const
virtual

render content item in HTML/XHTML format.

After rendering the current content item all child nodes (if any) are also rendered (see renderHTMLChildNodes() for details).

Parameters
docStreamoutput stream to which the main HTML/XHTML document is written
annexStreamoutput stream to which the HTML/XHTML document annex is written
nestingLevelcurrent nesting level. Used to render section headings.
annexNumberreference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRContainerTreeNode.

OFCondition DSRDocumentTreeNode::renderHTMLChildNodes ( STD_NAMESPACE ostream &  docStream,
STD_NAMESPACE ostream &  annexStream,
const size_t  nestingLevel,
size_t &  annexNumber,
const size_t  flags 
) const
protected

render child nodes in HTML/XHTML format

Parameters
docStreamoutput stream to which the main HTML/XHTML document is written
annexStreamoutput stream to which the HTML/XHTML document annex is written
nestingLevelcurrent nesting level. Used to render section headings.
annexNumberreference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::renderHTMLConceptName ( STD_NAMESPACE ostream &  docStream,
const size_t  flags 
) const
protected

render concept name in HTML/XHTML format.

If the optional observation datetime field is valid (not empty) it is also rendered.

Parameters
docStreamoutput stream to which the main HTML/XHTML document is written
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRDocumentTreeNode::renderHTMLContentItem ( STD_NAMESPACE ostream &  docStream,
STD_NAMESPACE ostream &  annexStream,
const size_t  nestingLevel,
size_t &  annexNumber,
const size_t  flags 
) const
protectedvirtual

render content item (value) in HTML/XHTML format.

This method does nothing for this base class, but derived classes overwrite it to render the contents according to their value type.

Parameters
docStreamoutput stream to which the main HTML/XHTML document is written
annexStreamoutput stream to which the HTML/XHTML document annex is written
nestingLevelcurrent nesting level. Used to render section headings.
annexNumberreference to the variable where the current annex number is stored. Value is increased automatically by 1 after a new entry has been added.
flagsflag used to customize the output (see DSRTypes::HF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRContainerTreeNode, DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRTimeTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRImageTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, DSRUIDRefTreeNode, DSRWaveformTreeNode, DSRCodeTreeNode, DSRNumTreeNode, and DSRCompositeTreeNode.

virtual OFCondition DSRDocumentTreeNode::setConceptName ( const DSRCodedEntryValue conceptName)
virtual

set the concept name.

Code describing the concept represented by this content item. Also conveys the value of document title and section headings in documents. If the new code is invalid the current one is not replaced. An empty code can be used to clear the current concept name.

Parameters
conceptNamecode to be set as the new concept name (checked before set)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRByReferenceTreeNode.

void DSRDocumentTreeNode::setMark ( const OFBool  flag)
inline

mark/unmark the current content item.

See explanation for method 'isMarked' for details.

Parameters
flagmark item if OFTrue, unmark otherwise

Definition at line 199 of file dsrdoctn.h.

References MarkFlag.

virtual OFCondition DSRDocumentTreeNode::setObservationDateTime ( const OFString observationDateTime)
virtual

set observation date time.

This is the date and time on which this content item was completed. Might be empty if the date and time do not differ from the content date and time, see DSRDocument. Please use the correct DICOM format (YYYYMMDDHHMMSS) or an empty string to clear the current value. Currently no check is performed on the parameter value!

Parameters
observationDateTimevalue to be set (might be an empty string)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRByReferenceTreeNode.

void DSRDocumentTreeNode::setReferenceTarget ( const OFBool  isTarget = OFTrue)
inline

specify whether the current content item is target of a by-reference relationship

Parameters
isTargetOFTrue if the content item is target (default), OFFalse otherwise

Definition at line 215 of file dsrdoctn.h.

References ReferenceTarget.

virtual OFCondition DSRDocumentTreeNode::setTemplateIdentification ( const OFString templateIdentifier,
const OFString mappingResource 
)
virtual

set template identifier and mapping resource.

The identification is valid if both values are either present (non-empty) or absent (empty). See getTemplateIdentification() for details.

Parameters
templateIdentifieridentifier of the template to be set (VR=CS)
mappingResourcemapping resource that defines the template (VR=CS)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRByReferenceTreeNode.

virtual OFCondition DSRDocumentTreeNode::write ( DcmItem dataset,
DcmStack markedItems = NULL 
)
virtual

write content item to dataset.

A number of writeXXX() methods are called (see "protected" part) in order to write all possibly nested content items to the dataset.

Parameters
datasetDICOM dataset to which the content item should be written
markedItemsoptional stack where pointers to all 'marked' content items (DICOM datasets/items) are added to during the write process. Can be used to digitally sign parts of the document tree.
Returns
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRDocumentTreeNode::writeContentItem ( DcmItem dataset) const
protectedvirtual

write content item (value) to dataset.

This method does nothing for this base class, but derived classes overwrite it to write the contents according to their value type.

Parameters
datasetDICOM dataset to which the content item should be written
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRContainerTreeNode, DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRTimeTreeNode, DSRPNameTreeNode, DSRTextTreeNode, DSRImageTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, DSRUIDRefTreeNode, DSRWaveformTreeNode, DSRCodeTreeNode, DSRNumTreeNode, and DSRCompositeTreeNode.

OFCondition DSRDocumentTreeNode::writeContentSequence ( DcmItem dataset,
DcmStack markedItems 
) const
protected

write content sequence

Parameters
datasetDICOM dataset to which the data should be written
markedItemsoptional stack where pointers to all 'marked' content items (DICOM datasets/items) are added to during the write process.
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::writeDocumentContentMacro ( DcmItem dataset) const
protected

write document content macro

Parameters
datasetDICOM dataset to which the data should be written
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::writeDocumentRelationshipMacro ( DcmItem dataset,
DcmStack markedItems 
)
protected

write document relationship macro

Parameters
datasetDICOM dataset to which the data should be written
markedItemsoptional stack where pointers to all 'marked' content items (DICOM datasets/items) are added to during the write process.
Returns
status, EC_Normal if successful, an error code otherwise
OFCondition DSRDocumentTreeNode::writeSRDocumentContentModule ( DcmItem dataset,
DcmStack markedItems 
)
protected

write SR document content module

Parameters
datasetDICOM dataset to which the data should be written
markedItemsoptional stack where pointers to all 'marked' content items (DICOM datasets/items) are added to during the write process.
Returns
status, EC_Normal if successful, an error code otherwise
virtual OFCondition DSRDocumentTreeNode::writeXML ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const
virtual

write content item in XML format

Parameters
streamoutput stream to which the XML document is written
flagsflag used to customize the output (see DSRTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented in DSRTextTreeNode, DSRContainerTreeNode, DSRByReferenceTreeNode, DSRDateTreeNode, DSRDateTimeTreeNode, DSRImageTreeNode, DSRPNameTreeNode, DSRSCoord3DTreeNode, DSRSCoordTreeNode, DSRTCoordTreeNode, DSRTimeTreeNode, DSRUIDRefTreeNode, DSRWaveformTreeNode, DSRCodeTreeNode, DSRNumTreeNode, and DSRCompositeTreeNode.

void DSRDocumentTreeNode::writeXMLItemEnd ( STD_NAMESPACE ostream &  stream,
const size_t  flags 
) const
protected

write common item start (XML tag)

Parameters
streamoutput stream to which the XML document is written
flagsflag used to customize the output (see DSRTypes::XF_xxx)
void DSRDocumentTreeNode::writeXMLItemStart ( STD_NAMESPACE ostream &  stream,
const size_t  flags,
const OFBool  closingBracket = OFTrue 
) const
protected

write common item start (XML tag)

Parameters
streamoutput stream to which the XML document is written
flagsflag used to customize the output (see DSRTypes::XF_xxx)
closingBracketwrite closing bracket of XML start tag if OFTrue, otherwise the bracket has to be closed in the calling method

The documentation for this class was generated from the following file:


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