com.pixelmed.dicom

## Class ContentItemWithValue

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

- All Implemented Interfaces:
    javax.swing.tree.TreeNode
  Direct Known Subclasses:
    ContentItemFactory.CodeContentItem, ContentItemFactory.CompositeContentItem, ContentItemFactory.ContainerContentItem, ContentItemFactory.NumericContentItem, ContentItemFactory.SpatialCoordinates3DContentItem, ContentItemFactory.SpatialCoordinatesContentItem, ContentItemFactory.StringContentItem, ContentItemFactory.TemporalCoordinatesContentItem, ContentItemFactory.UnrecognizedContentItem

      public abstract class ContentItemWithValue
      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`, `ContentItemWithReference`, `StructuredReport`, `StructuredReportBrowser`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CodedSequenceItem` | `conceptName`
    `protected java.lang.String` | `referencedContentItemIdentifier`
    `protected java.lang.String` | `valueType`

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

      `relationshipType`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ContentItemWithValue(ContentItem p, AttributeList l)` Construct a content item for a list of attributes, and add it as a child of the specified parent.
    `protected` | `ContentItemWithValue(ContentItem p, java.lang.String valueType, java.lang.String relationshipType, CodedSequenceItem conceptName)` 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

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `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.
    `java.lang.String` | `getValueType()` Get the value type of this content item.
    `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, getGraphicData, getGraphicType, getIndex, getNamedChild, getNamedChild, getParent, getParentAsContentItem, getPositionInTreeToUseAsReferencedContentItemIdentifier, getReferencedContentItemIdentifier, getReferencedContentItemIdentifierArray, getReferencedSOPClassUID, getReferencedSOPInstanceUID, getRelationshipType, getSingleStringValueOrNull, getSingleStringValueOrNullOfNamedChild, getSingleStringValueOrNullOfNamedChild, isLeaf`

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

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

- - ### Field Detail

    - #### valueType

          protected java.lang.String valueType

    - #### conceptName

          protected CodedSequenceItem conceptName

    - #### referencedContentItemIdentifier

          protected java.lang.String referencedContentItemIdentifier

  - ### Constructor Detail

    - #### ContentItemWithValue

          protected ContentItemWithValue(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

    - #### ContentItemWithValue

          protected ContentItemWithValue(ContentItem p,
                                         java.lang.String valueType,
                                         java.lang.String relationshipType,
                                         CodedSequenceItem conceptName)
                                  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`.

      Parameters:
        `p` - the parent
        `valueType` - value type
        `relationshipType` - added only if not null or zero length
        `conceptName` - coded concept name
      Throws:
        `DicomException` - if error in DICOM encoding

  - ### Method Detail

    - #### getValueType

          public java.lang.String getValueType()

      Get the value type of this content item.

      Overrides:
        `getValueType` in class `ContentItem`
      Returns:
        the value type (the string used in the DICOM standard in the Value Type attribute)

    - #### getConceptNameAndValue

          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.

      Overrides:
        `getConceptNameAndValue` in class `ContentItem`
      Returns:
        a String representation of the name and value, or an empty string

    - #### getConceptValue

          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.

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

    - #### getConceptName

          public CodedSequenceItem getConceptName()

      Get the Concept Name.

      Overrides:
        `getConceptName` in class `ContentItem`
      Returns:
        the Concept Name

    - #### getConceptNameCodeMeaning

          public java.lang.String getConceptNameCodeMeaning()

      Get the value of the code meaning of the Concept Name as a string, if present and applicable.

      Overrides:
        `getConceptNameCodeMeaning` in class `ContentItem`
      Returns:
        the code meaning of the Concept Name, or an empty string

    - #### getConceptNameCodeValue

          public java.lang.String getConceptNameCodeValue()

      Get the value of the code value of the Concept Name as a string, if present and applicable.

      Overrides:
        `getConceptNameCodeValue` in class `ContentItem`
      Returns:
        the code value of the Concept Name, or an empty string

    - #### getConceptNameCodingSchemeDesignator

          public java.lang.String getConceptNameCodingSchemeDesignator()

      Get the value of the coding scheme designator of the Concept Name as a string, if present and applicable.

      Overrides:
        `getConceptNameCodingSchemeDesignator` in class `ContentItem`
      Returns:
        the coding scheme designator of the Concept Name, or an empty string

    - #### 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)

      Description copied from class: `ContentItem`
      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:
        `cvWanted` - the code value wanted
        `csdWanted` - the coding scheme designator wanted
      Returns:
        true if matches