com.pixelmed.dicom

## Class ContentItemWithReference

- java.lang.Object
- - com.pixelmed.dicom.ContentItem
  - - com.pixelmed.dicom.ContentItemWithReference

All Implemented Interfaces:
  javax.swing.tree.TreeNode

    public class ContentItemWithReference
    extends ContentItem

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`.

See Also:
  `ContentItem`, `ContentItemFactory`, `ContentItemWithValue`, `StructuredReport`, `StructuredReportBrowser`

### Field Summary

Fields
`protected java.lang.String` `referencedContentItemIdentifier`

### Fields inherited from class com.pixelmed.dicom.ContentItem

`relationshipType`

### Constructor Summary

Constructors
`protected` `ContentItemWithReference(ContentItem p, AttributeList l)` Construct a content item for a list of attributes, and add it as a child of the specified parent.
`` `ContentItemWithReference(ContentItem p, java.lang.String relationshipType, java.lang.String referencedContentItemIdentifier)` Construct a content item of a specified type and relationship, creating a new `AttributeList`, and add it as a child of the specified parent.

### Method Summary

Methods
`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.
`java.lang.String` `getConceptValue()` Get a string representation of the value of the concept.
`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` `toString()` Get a human-readable string representation of the content item.

### Methods inherited from class com.pixelmed.dicom.ContentItem

`addChild, addSibling, children, contentItemNameMatchesCodeValueAndCodingSchemeDesignator, getAllowsChildren, getAttributeList, getChildAt, getChildCount, getConceptName, getConceptNameAndValue, getConceptNameCodeMeaning, getConceptNameCodeValue, getConceptNameCodingSchemeDesignator, getGraphicData, getGraphicType, getIndex, getNamedChild, getNamedChild, getParent, getParentAsContentItem, getReferencedSOPClassUID, getReferencedSOPInstanceUID, getRelationshipType, getSingleStringValueOrNull, getSingleStringValueOrNullOfNamedChild, getSingleStringValueOrNullOfNamedChild, getValueType, isLeaf`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### referencedContentItemIdentifier

    protected java.lang.String referencedContentItemIdentifier

### Constructor Detail

#### ContentItemWithReference

    protected ContentItemWithReference(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`.

Parameters:
  `p` - the parent
  `l` - the list of attributes

#### ContentItemWithReference

    public ContentItemWithReference(ContentItem p,
                            java.lang.String relationshipType,
                            java.lang.String referencedContentItemIdentifier)
                             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.

Parameters:
  `p` - the parent
  `relationshipType` - added only if not null or zero length
  `referencedContentItemIdentifier` -
Throws:
  `DicomException`

### Method Detail

#### getConceptValue

    public java.lang.String getConceptValue()

Get a string representation of the value of the concept.

Always returns an empty string for a `ContentItemWithReference`.

Specified by:
  `getConceptValue` in class `ContentItem`
Returns:
  a String representation of the name and value, or an empty string

#### getReferencedContentItemIdentifier

    public java.lang.String getReferencedContentItemIdentifier()

Get the Referenced Content Item Identifier, if present.

Overrides:
  `getReferencedContentItemIdentifier` in class `ContentItem`
Returns:
  the period (not backslash) delimited item references, or an empty string

#### getReferencedContentItemIdentifierArray

    public int[] getReferencedContentItemIdentifierArray()

Get the Referenced Content Item Identifier, if present.

Overrides:
  `getReferencedContentItemIdentifierArray` in class `ContentItem`
Returns:
  an array of integers representing the separated components of the Referenced Content Item Identifier, including the first (root) identifier of 1, or null if none or empty

#### toString

    public java.lang.String toString()

Get a human-readable string representation of the content item.

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  the string representation of the content item

#### contentItemNameMatchesCodeValueAndCodingSchemeDesignator

    public 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. This is more robust than checking code meaning, which may have synomyms, and there is no need to also test code meaning. Does NOT follow references.

Specified by:
  `contentItemNameMatchesCodeValueAndCodingSchemeDesignator` in class `ContentItem`
Parameters:
  `csdWanted` -
  `cvWanted` -
Returns:
  true if matches