Package com.pixelmed.dicom

## Class ContentItemFactory.NumericContentItem

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

- All Implemented Interfaces:
    `javax.swing.tree.TreeNode`
  Enclosing class:
    ContentItemFactory

      public class ContentItemFactory.NumericContentItem
      extends ContentItemWithValue

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.lang.Double` | `floatingPointValue` |
    `protected java.lang.String` | `numericValue` |
    `protected CodedSequenceItem` | `qualifier` |
    `protected java.lang.Long` | `rationalDenominatorValue` |
    `protected java.lang.Integer` | `rationalNumeratorValue` |
    `protected CodedSequenceItem` | `units` |

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

      `conceptName, referencedContentItemIdentifier, valueType`

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

      `observationDateTime, observationUID, relationshipType`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NumericContentItem​(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, double floatingPointValue, CodedSequenceItem units)` |
    `NumericContentItem​(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, int numerator, long denominator, CodedSequenceItem units, java.lang.String observationDateTime, java.lang.String observationUID)` |
    `NumericContentItem​(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, CodedSequenceItem qualifier)` | Construct numeric content item with empty `MeasuredValueSequence` with qualifier explaining why it is empty.
    `NumericContentItem​(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, CodedSequenceItem units, CodedSequenceItem qualifier)` |

    `NumericContentItem​(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, java.lang.Double floatingPointValue, java.lang.Integer rationalNumeratorValue, java.lang.Long rationalDenominatorValue, CodedSequenceItem units, CodedSequenceItem qualifier, java.lang.String observationDateTime, java.lang.String observationUID)`

    `NumericContentItem​(ContentItem parent, AttributeList list)` |
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, double floatingPointValue, CodedSequenceItem units)` |
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, int numerator, long denominator, CodedSequenceItem units)` |
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, CodedSequenceItem qualifier)` | Construct SR numeric content item with empty `MeasuredValueSequence` with qualifier explaining why it is empty.
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, CodedSequenceItem units)` |
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, CodedSequenceItem units, CodedSequenceItem qualifier)` |
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, java.lang.Double floatingPointValue, java.lang.Integer rationalNumeratorValue, java.lang.Long rationalDenominatorValue, CodedSequenceItem units, CodedSequenceItem qualifier)` |
    `NumericContentItem​(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, java.lang.Double floatingPointValue, java.lang.Integer rationalNumeratorValue, java.lang.Long rationalDenominatorValue, CodedSequenceItem units, CodedSequenceItem qualifier, java.lang.String observationDateTime, java.lang.String observationUID)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `constructOnlyQualifier​(CodedSequenceItem qualifier)` |
    `protected void` | `doCommonConstructorStuff​(boolean isNotSR, java.lang.String numericValue, CodedSequenceItem units, CodedSequenceItem qualifier, java.lang.Double floatingPointValue, java.lang.Integer rationalNumeratorValue, java.lang.Long rationalDenominatorValue)` |
    `java.lang.String` | `getConceptNameAndValue()` | Get a string representation of the concept name and the value of the concept.
    `java.lang.String` | `getConceptValue()` | Get a string representation of the value of the concept.
    `double` | `getFloatingPointValue()` |
    `java.lang.String` | `getNumericValue()` |
    `CodedSequenceItem` | `getQualifier()` |
    `long` | `getRationalDenominatorValue()` |
    `int` | `getRationalNumeratorValue()` |
    `CodedSequenceItem` | `getUnits()` |
    `boolean` | `hasFloatingPointValue()` |
    `boolean` | `hasRationalValue()` |
    `java.lang.String` | `toString()` | Get a human-readable string representation of the content item.

    - ### Methods inherited from class com.pixelmed.dicom.ContentItemWithValue

      `contentItemNameMatchesCodeValueAndCodingSchemeDesignator, getConceptName, getConceptNameCodeMeaning, getConceptNameCodeValue, getConceptNameCodingSchemeDesignator, getValueType`

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

      `addChild, addSibling, children, contentItemNameMatchesCodeValueAndCodingSchemeDesignator, getAllowsChildren, getAttributeList, getChildAt, getChildCount, getGraphicData, getGraphicType, getIndex, getNamedChild, getNamedChild, getObservationDateTime, getObservationUID, getParent, getParentAsContentItem, getPositionInTreeToUseAsReferencedContentItemIdentifier, getReferencedContentItemIdentifier, getReferencedContentItemIdentifierArray, getReferencedSOPClassUID, getReferencedSOPInstanceUID, getRelationshipType, getSingleStringValueOrNull, getSingleStringValueOrNullOfNamedChild, getSingleStringValueOrNullOfNamedChild, isLeaf`

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

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

- - ### Field Detail

    - #### numericValue

          protected java.lang.String numericValue

    - #### floatingPointValue

          protected java.lang.Double floatingPointValue

    - #### rationalNumeratorValue

          protected java.lang.Integer rationalNumeratorValue

    - #### rationalDenominatorValue

          protected java.lang.Long rationalDenominatorValue

    - #### units

          protected CodedSequenceItem units

    - #### qualifier

          protected CodedSequenceItem qualifier

  - ### Constructor Detail

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    AttributeList list)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `list` - the list of attributes for this content item
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    boolean isNotSR,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    double floatingPointValue,
                                    CodedSequenceItem units)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `floatingPointValue` - will be converted to string
        `units` - code for the units
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    double floatingPointValue,
                                    CodedSequenceItem units)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `floatingPointValue` - will be converted to string
        `units` - code for the units
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    boolean isNotSR,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    int numerator,
                                    long denominator,
                                    CodedSequenceItem units,
                                    java.lang.String observationDateTime,
                                    java.lang.String observationUID)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numerator` - integer numerator
        `denominator` - integer denominator
        `units` - code for the units
        `observationDateTime` - Observation DateTime (or null or empty if none)
        `observationUID` - Observation UID (or null or empty if none)
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    int numerator,
                                    long denominator,
                                    CodedSequenceItem units)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numerator` - integer numerator
        `denominator` - integer denominator
        `units` - code for the units
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    boolean isNotSR,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    java.lang.String numericValue,
                                    CodedSequenceItem units,
                                    CodedSequenceItem qualifier)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numericValue` - numeric value as decimal string
        `units` - code for the units
        `qualifier` - code for qualifier
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    java.lang.String numericValue,
                                    CodedSequenceItem units)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numericValue` - numeric value as decimal string
        `units` - code for the units
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    java.lang.String numericValue,
                                    CodedSequenceItem units,
                                    CodedSequenceItem qualifier)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numericValue` - numeric value as decimal string
        `units` - code for the units
        `qualifier` - code for qualifier
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    boolean isNotSR,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    java.lang.String numericValue,
                                    java.lang.Double floatingPointValue,
                                    java.lang.Integer rationalNumeratorValue,
                                    java.lang.Long rationalDenominatorValue,
                                    CodedSequenceItem units,
                                    CodedSequenceItem qualifier,
                                    java.lang.String observationDateTime,
                                    java.lang.String observationUID)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numericValue` - numeric value as decimal string
        `floatingPointValue` - numeric value as floating point
        `rationalNumeratorValue` - integer numerator
        `rationalDenominatorValue` - integer denominator
        `units` - code for the units
        `qualifier` - code for qualifier
        `observationDateTime` - Observation DateTime (or null or empty if none)
        `observationUID` - Observation UID (or null or empty if none)
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    java.lang.String numericValue,
                                    java.lang.Double floatingPointValue,
                                    java.lang.Integer rationalNumeratorValue,
                                    java.lang.Long rationalDenominatorValue,
                                    CodedSequenceItem units,
                                    CodedSequenceItem qualifier)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numericValue` - numeric value as decimal string
        `floatingPointValue` - numeric value as floating point
        `rationalNumeratorValue` - integer numerator
        `rationalDenominatorValue` - integer denominator
        `units` - code for the units
        `qualifier` - code for qualifier
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    java.lang.String numericValue,
                                    java.lang.Double floatingPointValue,
                                    java.lang.Integer rationalNumeratorValue,
                                    java.lang.Long rationalDenominatorValue,
                                    CodedSequenceItem units,
                                    CodedSequenceItem qualifier,
                                    java.lang.String observationDateTime,
                                    java.lang.String observationUID)
                             throws DicomException

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `numericValue` - numeric value as decimal string
        `floatingPointValue` - numeric value as floating point
        `rationalNumeratorValue` - integer numerator
        `rationalDenominatorValue` - integer denominator
        `units` - code for the units
        `qualifier` - code for qualifier
        `observationDateTime` - Observation DateTime (or null or empty if none)
        `observationUID` - Observation UID (or null or empty if none)
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    boolean isNotSR,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    CodedSequenceItem qualifier)
                             throws DicomException

      Construct numeric content item with empty `MeasuredValueSequence` with qualifier explaining why it is empty.

      Parameters:
        `parent` - parent content item to add to
        `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `qualifier` - code for qualifier
      Throws:
        `DicomException` - if error in DICOM encoding

    - #### NumericContentItem

          public NumericContentItem​(ContentItem parent,
                                    java.lang.String relationshipType,
                                    CodedSequenceItem conceptName,
                                    CodedSequenceItem qualifier)
                             throws DicomException

      Construct SR numeric content item with empty `MeasuredValueSequence` with qualifier explaining why it is empty.

      Parameters:
        `parent` - parent content item to add to
        `relationshipType` - relationship type
        `conceptName` - coded concept name
        `qualifier` - code for qualifier
      Throws:
        `DicomException` - if error in DICOM encoding

  - ### Method Detail

    - #### doCommonConstructorStuff

          protected void doCommonConstructorStuff​(boolean isNotSR,
                                                  java.lang.String numericValue,
                                                  CodedSequenceItem units,
                                                  CodedSequenceItem qualifier,
                                                  java.lang.Double floatingPointValue,
                                                  java.lang.Integer rationalNumeratorValue,
                                                  java.lang.Long rationalDenominatorValue)
                                           throws DicomException

      Throws:
        `DicomException`

    - #### constructOnlyQualifier

          protected void constructOnlyQualifier​(CodedSequenceItem qualifier)

    - #### getQualifier

          public CodedSequenceItem getQualifier()

      Returns:
        the qualifier, or null if none

    - #### getUnits

          public CodedSequenceItem getUnits()

      Returns:
        the units

    - #### getNumericValue

          public java.lang.String getNumericValue()

      Returns:
        the decimal string numeric value, or null if none

    - #### hasFloatingPointValue

          public boolean hasFloatingPointValue()

      Returns:
        true if there is a floating point value encoded

    - #### getFloatingPointValue

          public double getFloatingPointValue()

      Returns:
        the floating point value

    - #### hasRationalValue

          public boolean hasRationalValue()

      Returns:
        true if there is a rational value encoded with an integer numerator and denominator

    - #### getRationalNumeratorValue

          public int getRationalNumeratorValue()

      Returns:
        the rational numerator value

    - #### getRationalDenominatorValue

          public long getRationalDenominatorValue()

      Returns:
        the rational denomninator value

    - #### getConceptValue

          public java.lang.String getConceptValue()

      Description copied from class: `ContentItemWithValue`

      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 `ContentItemWithValue`
      Returns:
        a String representation of the name and value, or an empty string

    - #### getConceptNameAndValue

          public java.lang.String getConceptNameAndValue()

      Description copied from class: `ContentItemWithValue`

      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 `ContentItemWithValue`
      Returns:
        a String representation of the name and value, or an empty string

    - #### toString

          public java.lang.String toString()

      Description copied from class: `ContentItemWithValue`

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

      Overrides:
        `toString` in class `ContentItemWithValue`
      Returns:
        the string representation of the content item