com.pixelmed.dicom

## Class ContentItemFactory

- java.lang.Object
- - com.pixelmed.dicom.ContentItemFactory

    public class ContentItemFactory
    extends java.lang.Object

A class with methods for constructing a `ContentItem` of the appropriate class from a list of attributes.

The sub-classes of `ContentItem` are public internal classes of this class, but specialize the methods, specifically the extractors and the string representation methods.

This is not an abstract class, and the content item factory method is not static; an instance of the factory needs to be created.

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

### Nested Class Summary

Nested Classes
`class` `ContentItemFactory.CodeContentItem`
`class` `ContentItemFactory.CompositeContentItem`
`class` `ContentItemFactory.ContainerContentItem`
`class` `ContentItemFactory.DateContentItem`
`class` `ContentItemFactory.DateTimeContentItem`
`class` `ContentItemFactory.ImageContentItem`
`class` `ContentItemFactory.NumericContentItem`
`class` `ContentItemFactory.PersonNameContentItem`
`class` `ContentItemFactory.SpatialCoordinates3DContentItem`
`class` `ContentItemFactory.SpatialCoordinatesContentItem`
`protected class` `ContentItemFactory.StringContentItem`
`class` `ContentItemFactory.TemporalCoordinatesContentItem`
`class` `ContentItemFactory.TextContentItem`
`class` `ContentItemFactory.TimeContentItem`
`class` `ContentItemFactory.UIDContentItem`
`class` `ContentItemFactory.UnrecognizedContentItem`
`class` `ContentItemFactory.WaveformContentItem`

### Constructor Summary

Constructors
Constructor and Description
`ContentItemFactory()`

### Method Summary

Methods
`static boolean` `codeContentItemValueMatchesCodeValueAndCodingSchemeDesignator(ContentItem ci, java.lang.String cvWanted, java.lang.String csdWanted)` Test if the coded value of the code content item matches the specified code value and coding scheme designator.
`ContentItem` `getNewContentItem(ContentItem parent, AttributeList list)` Construct a content item of the appropriate class from a list of attributes.
`ContentItemFactory.CodeContentItem` `makeCodeContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, CodedSequenceItem conceptCode)`
`ContentItemFactory.CompositeContentItem` `makeCompositeContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String referencedSOPClassUID, java.lang.String referencedSOPInstanceUID)`
`ContentItemFactory.ContainerContentItem` `makeContainerContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName)` Construct a ContainerContentItem Default to separate continuity
`ContentItemFactory.ContainerContentItem` `makeContainerContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, boolean continuityOfContentIsSeparate)`
`ContentItemFactory.ContainerContentItem` `makeContainerContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, boolean continuityOfContentIsSeparate, java.lang.String templateMappingResource, java.lang.String templateIdentifier)`
`ContentItemFactory.DateContentItem` `makeDateContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String stringValue)`
`ContentItemFactory.DateTimeContentItem` `makeDateTimeContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String stringValue)`

`ContentItemFactory.ImageContentItem`

`makeImageContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String referencedSOPClassUID, java.lang.String referencedSOPInstanceUID, int referencedFrameNumber, int referencedSegmentNumber, java.lang.String presentationStateSOPClassUID, java.lang.String presentationStateSOPInstanceUID, java.lang.String realWorldValueMappingSOPClassUID, java.lang.String realWorldValueMappingSOPInstanceUID)`

`ContentItemFactory.NumericContentItem` `makeNumericContentItem(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, double numericValue, CodedSequenceItem units)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, int numerator, long denominator, CodedSequenceItem units)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(ContentItem parent, boolean isNotSR, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, CodedSequenceItem units, CodedSequenceItem qualifier)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(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)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, double numericValue, CodedSequenceItem units)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, int numerator, long denominator, CodedSequenceItem units)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String numericValue, CodedSequenceItem units, CodedSequenceItem qualifier)`
`ContentItemFactory.NumericContentItem` `makeNumericContentItem(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)`
`ContentItemFactory.PersonNameContentItem` `makePersonNameContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String stringValue)`
`ContentItemFactory.SpatialCoordinates3DContentItem` `makeSpatialCoordinates3DContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String graphicType, float[] graphicData, java.lang.String referencedFrameOfReferenceUID)`
`ContentItemFactory.SpatialCoordinatesContentItem` `makeSpatialCoordinatesContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String graphicType, float[] graphicData)`
`ContentItemFactory.TextContentItem` `makeTextContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String stringValue)`
`ContentItemFactory.TimeContentItem` `makeTimeContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String stringValue)`
`ContentItemFactory.UIDContentItem` `makeUIDContentItem(ContentItem parent, java.lang.String relationshipType, CodedSequenceItem conceptName, java.lang.String stringValue)`

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

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

### Constructor Detail

#### ContentItemFactory

    public ContentItemFactory()

### Method Detail

#### makeContainerContentItem

    public ContentItemFactory.ContainerContentItem makeContainerContentItem(ContentItem parent,
                                                                   java.lang.String relationshipType,
                                                                   CodedSequenceItem conceptName,
                                                                   boolean continuityOfContentIsSeparate,
                                                                   java.lang.String templateMappingResource,
                                                                   java.lang.String templateIdentifier)
                                                                     throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `continuityOfContentIsSeparate` - true if SEPARATE, false if CONTINUOUS
  `templateMappingResource` -
  `templateIdentifier` -
Throws:
  `DicomException`

#### makeContainerContentItem

    public ContentItemFactory.ContainerContentItem makeContainerContentItem(ContentItem parent,
                                                                   java.lang.String relationshipType,
                                                                   CodedSequenceItem conceptName,
                                                                   boolean continuityOfContentIsSeparate)
                                                                     throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `continuityOfContentIsSeparate` - true if SEPARATE, false if CONTINUOUS
Throws:
  `DicomException`

#### makeContainerContentItem

    public ContentItemFactory.ContainerContentItem makeContainerContentItem(ContentItem parent,
                                                                   java.lang.String relationshipType,
                                                                   CodedSequenceItem conceptName)
                                                                     throws DicomException

Construct a ContainerContentItem Default to separate continuity

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
Throws:
  `DicomException`

#### makeCompositeContentItem

    public ContentItemFactory.CompositeContentItem makeCompositeContentItem(ContentItem parent,
                                                                   java.lang.String relationshipType,
                                                                   CodedSequenceItem conceptName,
                                                                   java.lang.String referencedSOPClassUID,
                                                                   java.lang.String referencedSOPInstanceUID)
                                                                     throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `referencedSOPClassUID` -
  `referencedSOPInstanceUID` -
Throws:
  `DicomException`

#### makeImageContentItem

    public ContentItemFactory.ImageContentItem makeImageContentItem(ContentItem parent,
                                                           java.lang.String relationshipType,
                                                           CodedSequenceItem conceptName,
                                                           java.lang.String referencedSOPClassUID,
                                                           java.lang.String referencedSOPInstanceUID,
                                                           int referencedFrameNumber,
                                                           int referencedSegmentNumber,
                                                           java.lang.String presentationStateSOPClassUID,
                                                           java.lang.String presentationStateSOPInstanceUID,
                                                           java.lang.String realWorldValueMappingSOPClassUID,
                                                           java.lang.String realWorldValueMappingSOPInstanceUID)
                                                             throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `referencedSOPClassUID` -
  `referencedSOPInstanceUID` -
  `referencedFrameNumber` - if < 1, not added
  `referencedSegmentNumber` - if < 1, not added
  `presentationStateSOPClassUID` -
  `presentationStateSOPInstanceUID` -
  `realWorldValueMappingSOPClassUID` -
  `realWorldValueMappingSOPInstanceUID` -
Throws:
  `DicomException`

#### makeSpatialCoordinatesContentItem

    public ContentItemFactory.SpatialCoordinatesContentItem makeSpatialCoordinatesContentItem(ContentItem parent,
                                                                                     java.lang.String relationshipType,
                                                                                     CodedSequenceItem conceptName,
                                                                                     java.lang.String graphicType,
                                                                                     float[] graphicData)
                                                                                       throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `graphicType` -
  `graphicData` -
Throws:
  `DicomException`

#### makeSpatialCoordinates3DContentItem

    public ContentItemFactory.SpatialCoordinates3DContentItem makeSpatialCoordinates3DContentItem(ContentItem parent,
                                                                                         java.lang.String relationshipType,
                                                                                         CodedSequenceItem conceptName,
                                                                                         java.lang.String graphicType,
                                                                                         float[] graphicData,
                                                                                         java.lang.String referencedFrameOfReferenceUID)
                                                                                           throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `graphicType` -
  `graphicData` -
Throws:
  `DicomException`

#### makeNumericContentItem

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

Parameters:
  `parent` -
  `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
  `relationshipType` -
  `conceptName` -
  `numericValue` -
  `units` -
  `qualifier` -
Throws:
  `DicomException`

#### makeNumericContentItem

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

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `numericValue` -
  `units` -
  `qualifier` -
Throws:
  `DicomException`

#### makeNumericContentItem

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

Parameters:
  `parent` -
  `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
  `relationshipType` -
  `conceptName` -
  `numericValue` -
  `units` -
Throws:
  `DicomException`

#### makeNumericContentItem

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

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `numericValue` -
  `units` -
Throws:
  `DicomException`

#### makeNumericContentItem

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

Parameters:
  `parent` -
  `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
  `relationshipType` -
  `conceptName` -
  `numerator` -
  `denominator` -
  `units` -
Throws:
  `DicomException`

#### makeNumericContentItem

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

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `numerator` -
  `denominator` -
  `units` -
Throws:
  `DicomException`

#### makeNumericContentItem

    public ContentItemFactory.NumericContentItem makeNumericContentItem(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)
                                                                 throws DicomException

Parameters:
  `parent` -
  `isNotSR` - affects whether value type is NUM (false) or NUMERIC (true)
  `relationshipType` -
  `conceptName` -
  `numericValue` -
  `floatingPointValue` -
  `rationalNumeratorValue` -
  `rationalDenominatorValue` -
  `units` -
  `qualifier` -
Throws:
  `DicomException`

#### makeNumericContentItem

    public ContentItemFactory.NumericContentItem makeNumericContentItem(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` -
  `relationshipType` -
  `conceptName` -
  `numericValue` -
  `floatingPointValue` -
  `rationalNumeratorValue` -
  `rationalDenominatorValue` -
  `units` -
  `qualifier` -
Throws:
  `DicomException`

#### makeCodeContentItem

    public ContentItemFactory.CodeContentItem makeCodeContentItem(ContentItem parent,
                                                         java.lang.String relationshipType,
                                                         CodedSequenceItem conceptName,
                                                         CodedSequenceItem conceptCode)
                                                           throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `conceptCode` -
Throws:
  `DicomException`

#### codeContentItemValueMatchesCodeValueAndCodingSchemeDesignator

    public static boolean codeContentItemValueMatchesCodeValueAndCodingSchemeDesignator(ContentItem ci,
                                                                        java.lang.String cvWanted,
                                                                        java.lang.String csdWanted)

Test if the coded value of the code 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.

Parameters:
  `ci` -
  `csdWanted` -
  `cvWanted` -
Returns:
  true if matches

#### makeDateTimeContentItem

    public ContentItemFactory.DateTimeContentItem makeDateTimeContentItem(ContentItem parent,
                                                                 java.lang.String relationshipType,
                                                                 CodedSequenceItem conceptName,
                                                                 java.lang.String stringValue)
                                                                   throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `stringValue` -
Throws:
  `DicomException`

#### makeDateContentItem

    public ContentItemFactory.DateContentItem makeDateContentItem(ContentItem parent,
                                                         java.lang.String relationshipType,
                                                         CodedSequenceItem conceptName,
                                                         java.lang.String stringValue)
                                                           throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `stringValue` -
Throws:
  `DicomException`

#### makeTimeContentItem

    public ContentItemFactory.TimeContentItem makeTimeContentItem(ContentItem parent,
                                                         java.lang.String relationshipType,
                                                         CodedSequenceItem conceptName,
                                                         java.lang.String stringValue)
                                                           throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `stringValue` -
Throws:
  `DicomException`

#### makePersonNameContentItem

    public ContentItemFactory.PersonNameContentItem makePersonNameContentItem(ContentItem parent,
                                                                     java.lang.String relationshipType,
                                                                     CodedSequenceItem conceptName,
                                                                     java.lang.String stringValue)
                                                                       throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `stringValue` -
Throws:
  `DicomException`

#### makeUIDContentItem

    public ContentItemFactory.UIDContentItem makeUIDContentItem(ContentItem parent,
                                                       java.lang.String relationshipType,
                                                       CodedSequenceItem conceptName,
                                                       java.lang.String stringValue)
                                                         throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `stringValue` -
Throws:
  `DicomException`

#### makeTextContentItem

    public ContentItemFactory.TextContentItem makeTextContentItem(ContentItem parent,
                                                         java.lang.String relationshipType,
                                                         CodedSequenceItem conceptName,
                                                         java.lang.String stringValue)
                                                           throws DicomException

Parameters:
  `parent` -
  `relationshipType` -
  `conceptName` -
  `stringValue` -
Throws:
  `DicomException`

#### getNewContentItem

    public ContentItem getNewContentItem(ContentItem parent,
                                AttributeList list)
                                  throws DicomException

Construct a content item of the appropriate class from a list of attributes.

Parameters:
  `parent` - the parent to add the content item to
  `list` - a list of attributes that constitute the content item as it is encoded in a DICOM data set
Returns:
  a content item
Throws:
  `DicomException`