public abstract class ContentItem
extends java.lang.Object
implements javax.swing.tree.TreeNode
An abstract class for representing a node in an internal representation of a structured reporting
tree (an instance of StructuredReport
).
The constructor is protected. Instances of specific types of content items should normally be created by using
the ContentItemFactory
.
ContentItemFactory
,
ContentItemWithValue
,
ContentItemWithReference
,
StructuredReport
,
StructuredReportBrowser
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
observationDateTime |
protected java.lang.String |
observationUID |
protected java.lang.String |
relationshipType |
Modifier | Constructor and Description |
---|---|
protected |
ContentItem(ContentItem p,
AttributeList l)
Construct a content item for a list of attributes, and add it as a child of the specified parent.
|
protected |
ContentItem(ContentItem p,
java.lang.String relationshipType)
Construct a content item of a specified type and relationship, creating a new
AttributeList , and add it as a child of the specified parent. |
protected |
ContentItem(ContentItem p,
java.lang.String relationshipType,
java.lang.String observationDateTime,
java.lang.String observationUID)
Construct a content item of a specified type and relationship, creating a new
AttributeList , and add it as a child of the specified parent. |
Modifier and Type | Method and Description |
---|---|
void |
addChild(ContentItem child)
Add a child to this content item.
|
void |
addSibling(ContentItem sibling)
Add a sibling to this content item (a child to the parent of this content item).
|
java.util.Enumeration |
children()
Returns the children of this node as an
Enumeration . |
static boolean |
contentItemNameMatchesCodeValueAndCodingSchemeDesignator(ContentItem ci,
java.lang.String cvWanted,
java.lang.String csdWanted)
Test if the coded concept name of the content item matches the specified code value and coding scheme designator.
|
abstract boolean |
contentItemNameMatchesCodeValueAndCodingSchemeDesignator(java.lang.String cvWanted,
java.lang.String csdWanted)
Test if the coded concept name of the content item matches the specified code value and coding scheme designator.
|
boolean |
getAllowsChildren()
Always returns true, since children may always be added.
|
AttributeList |
getAttributeList()
Get the attribute list of this content item.
|
javax.swing.tree.TreeNode |
getChildAt(int index)
Returns the child at the specified index.
|
int |
getChildCount()
Return the number of children that this node contains.
|
CodedSequenceItem |
getConceptName()
Get the Concept Name.
|
java.lang.String |
getConceptNameAndValue()
Get a string representation of the concept name and the value of the concept.
|
java.lang.String |
getConceptNameCodeMeaning()
Get the value of the code meaning of the Concept Name as a string, if present and applicable.
|
java.lang.String |
getConceptNameCodeValue()
Get the value of the code value of the Concept Name as a string, if present and applicable.
|
java.lang.String |
getConceptNameCodingSchemeDesignator()
Get the value of the coding scheme designator of the Concept Name as a string, if present and applicable.
|
abstract java.lang.String |
getConceptValue()
Get a string representation of the value of the concept.
|
float[] |
getGraphicData()
Get the Graphic Data of this content item, if present and applicable.
|
java.lang.String |
getGraphicType()
Get the Graphic Type of this content item, if present and applicable.
|
int |
getIndex(javax.swing.tree.TreeNode child)
Returns the index of the specified child from amongst this node's children, if present.
|
ContentItem |
getNamedChild(CodedSequenceItem item)
Retrieve the named child as defined by its ConceptName
The code meaning of the concept is ignored, and only the code value and coding scheme designator are compared in the search.
|
ContentItem |
getNamedChild(java.lang.String codingSchemeDesignator,
java.lang.String codeValue)
Retrieve the named child as defined by its ConceptName
|
java.lang.String |
getObservationDateTime()
Get the ObservationDateTime of this content item.
|
java.lang.String |
getObservationUID()
Get the ObservationUID of this content item.
|
javax.swing.tree.TreeNode |
getParent()
Returns the parent node of this node.
|
ContentItem |
getParentAsContentItem()
Get the parent content item of this content item.
|
java.lang.String |
getPositionInTreeToUseAsReferencedContentItemIdentifier()
Get the position in the tree relative to the top parent as a String to use as a Referenced Content Item Identifier.
|
java.lang.String |
getReferencedContentItemIdentifier()
Get the Referenced Content Item Identifier, if present.
|
int[] |
getReferencedContentItemIdentifierArray()
Get the Referenced Content Item Identifier, if present.
|
java.lang.String |
getReferencedSOPClassUID()
Get the Referenced SOP Class UID of this content item, if present and applicable.
|
java.lang.String |
getReferencedSOPInstanceUID()
Get the Referenced SOP Instance UID of this content item, if present and applicable.
|
java.lang.String |
getRelationshipType()
Get the relationship type of this content item.
|
java.lang.String |
getSingleStringValueOrNull()
Retrieve the string value of self
|
static java.lang.String |
getSingleStringValueOrNullOfNamedChild(ContentItem parent,
java.lang.String codingSchemeDesignator,
java.lang.String codeValue)
Retrieve the string value of the named child as defined by its ConceptName
|
java.lang.String |
getSingleStringValueOrNullOfNamedChild(java.lang.String codingSchemeDesignator,
java.lang.String codeValue)
Retrieve the string value of the named child as defined by its ConceptName
|
java.lang.String |
getValueType()
Get the value type of this content item.
|
boolean |
isLeaf()
Returns true if the receiver is a leaf (has no children).
|
protected java.lang.String observationDateTime
protected java.lang.String observationUID
protected java.lang.String relationshipType
protected ContentItem(ContentItem p, AttributeList l)
Construct a content item for a list of attributes, and add it as a child of the specified parent.
The constructor is protected. Instances of specific types of content items should normally be created by using
the ContentItemFactory
.
p
- the parentl
- the list of attributesprotected ContentItem(ContentItem p, java.lang.String relationshipType) throws DicomException
Construct a content item of a specified type and relationship, creating a new AttributeList
, and add it as a child of the specified parent.
The constructor is protected. Instances of specific types of content items should normally be created by using
the ContentItemFactory
.
p
- the parentrelationshipType
- added only if not null or zero lengthDicomException
- if error in DICOM encodingprotected ContentItem(ContentItem p, java.lang.String relationshipType, java.lang.String observationDateTime, java.lang.String observationUID) throws DicomException
Construct a content item of a specified type and relationship, creating a new AttributeList
, and add it as a child of the specified parent.
The constructor is protected. Instances of specific types of content items should normally be created by using
the ContentItemFactory
.
p
- the parentrelationshipType
- added only if not null or zero lengthobservationDateTime
- Observation DateTime, added only if not null or zero lengthobservationUID
- Observation UID, added only if not null or zero lengthDicomException
- if error in DICOM encodingpublic void addChild(ContentItem child)
Add a child to this content item.
child
- the child content item to addpublic void addSibling(ContentItem sibling) throws DicomException
Add a sibling to this content item (a child to the parent of this content item).
sibling
- the sibling content item to addDicomException
- thrown if there is no parentpublic java.util.Enumeration children()
Returns the children of this node as an Enumeration
.
children
in interface javax.swing.tree.TreeNode
public static boolean contentItemNameMatchesCodeValueAndCodingSchemeDesignator(ContentItem ci, java.lang.String cvWanted, java.lang.String csdWanted)
ci
- the content item to checkcsdWanted
- the coding scheme designator of the coded concept name wantedcvWanted
- the code value of the coded concept name wantedpublic abstract boolean contentItemNameMatchesCodeValueAndCodingSchemeDesignator(java.lang.String cvWanted, java.lang.String csdWanted)
csdWanted
- the coding scheme designator wantedcvWanted
- the code value wantedpublic boolean getAllowsChildren()
Always returns true, since children may always be added.
getAllowsChildren
in interface javax.swing.tree.TreeNode
public AttributeList getAttributeList()
Get the attribute list of this content item.
public javax.swing.tree.TreeNode getChildAt(int index)
Returns the child at the specified index.
getChildAt
in interface javax.swing.tree.TreeNode
index
- the index of the child to be returned, numbered from 0TreeNode
at the specified indexpublic int getChildCount()
Return the number of children that this node contains.
getChildCount
in interface javax.swing.tree.TreeNode
public CodedSequenceItem getConceptName()
Get the Concept Name.
public java.lang.String getConceptNameAndValue()
Get a string representation of the concept name and the value of the concept.
The exact form of the returned string is specific to the type of ContentItem.
public java.lang.String getConceptNameCodeMeaning()
Get the value of the code meaning of the Concept Name as a string, if present and applicable.
public java.lang.String getConceptNameCodeValue()
Get the value of the code value of the Concept Name as a string, if present and applicable.
public java.lang.String getConceptNameCodingSchemeDesignator()
Get the value of the coding scheme designator of the Concept Name as a string, if present and applicable.
public abstract java.lang.String getConceptValue()
Get a string representation of the value of the concept.
The exact form of the returned string is specific to the type of ContentItem.
public float[] getGraphicData()
Get the Graphic Data of this content item, if present and applicable.
public java.lang.String getGraphicType()
Get the Graphic Type of this content item, if present and applicable.
public int getIndex(javax.swing.tree.TreeNode child)
Returns the index of the specified child from amongst this node's children, if present.
getIndex
in interface javax.swing.tree.TreeNode
child
- the child to search for amongst this node's childrenpublic ContentItem getNamedChild(CodedSequenceItem item)
item
- the coded sequence item of the concept name wantedpublic ContentItem getNamedChild(java.lang.String codingSchemeDesignator, java.lang.String codeValue)
codingSchemeDesignator
- the coding scheme designatorcodeValue
- the code valuepublic java.lang.String getObservationDateTime()
Get the ObservationDateTime of this content item.
public java.lang.String getObservationUID()
Get the ObservationUID of this content item.
public javax.swing.tree.TreeNode getParent()
Returns the parent node of this node.
getParent
in interface javax.swing.tree.TreeNode
public ContentItem getParentAsContentItem()
Get the parent content item of this content item.
This method saves the caller from having to cast the value returned from TreeNode.getParent()
.
public java.lang.String getPositionInTreeToUseAsReferencedContentItemIdentifier()
Get the position in the tree relative to the top parent as a String to use as a Referenced Content Item Identifier.
Returns a valid result only if the entire parent content tree back to the root has already been populated.
public java.lang.String getReferencedContentItemIdentifier()
Get the Referenced Content Item Identifier, if present.
public int[] getReferencedContentItemIdentifierArray()
Get the Referenced Content Item Identifier, if present.
public java.lang.String getReferencedSOPClassUID()
Get the Referenced SOP Class UID of this content item, if present and applicable.
public java.lang.String getReferencedSOPInstanceUID()
Get the Referenced SOP Instance UID of this content item, if present and applicable.
public java.lang.String getRelationshipType()
Get the relationship type of this content item.
public java.lang.String getSingleStringValueOrNull()
public static java.lang.String getSingleStringValueOrNullOfNamedChild(ContentItem parent, java.lang.String codingSchemeDesignator, java.lang.String codeValue)
parent
- the parentcodingSchemeDesignator
- the coding scheme designatorcodeValue
- the code valuepublic java.lang.String getSingleStringValueOrNullOfNamedChild(java.lang.String codingSchemeDesignator, java.lang.String codeValue)
codingSchemeDesignator
- the coding scheme designatorcodeValue
- the code valuepublic java.lang.String getValueType()
Get the value type of this content item.
public boolean isLeaf()
Returns true if the receiver is a leaf (has no children).
isLeaf
in interface javax.swing.tree.TreeNode