com.pixelmed.dicom
Class ContentItemFactory

java.lang.Object
  extended by com.pixelmed.dicom.ContentItemFactory

public class ContentItemFactory
extends 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
 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
ContentItemFactory()
           
 
Method Summary
static boolean codeContentItemValueMatchesCodeValueAndCodingSchemeDesignator(ContentItem ci, String cvWanted, 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, String relationshipType, CodedSequenceItem conceptName, CodedSequenceItem conceptCode)
           
 ContentItemFactory.CompositeContentItem makeCompositeContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String referencedSOPClassUID, String referencedSOPInstanceUID)
           
 ContentItemFactory.ContainerContentItem makeContainerContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName)
          Construct a ContainerContentItem Default to separate continuity
 ContentItemFactory.ContainerContentItem makeContainerContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, boolean continuityOfContentIsSeparate)
           
 ContentItemFactory.ContainerContentItem makeContainerContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, boolean continuityOfContentIsSeparate, String templateMappingResource, String templateIdentifier)
           
 ContentItemFactory.DateContentItem makeDateContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String stringValue)
           
 ContentItemFactory.DateTimeContentItem makeDateTimeContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String stringValue)
           
 ContentItemFactory.ImageContentItem makeImageContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String referencedSOPClassUID, String referencedSOPInstanceUID, int referencedFrameNumber, int referencedSegmentNumber, String presentationStateSOPClassUID, String presentationStateSOPInstanceUID, String realWorldValueMappingSOPClassUID, String realWorldValueMappingSOPInstanceUID)
           
 ContentItemFactory.NumericContentItem makeNumericContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, double numericValue, CodedSequenceItem units)
           
 ContentItemFactory.NumericContentItem makeNumericContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, int numerator, long denominator, CodedSequenceItem units)
           
 ContentItemFactory.NumericContentItem makeNumericContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String numericValue, CodedSequenceItem units, CodedSequenceItem qualifier)
           
 ContentItemFactory.NumericContentItem makeNumericContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String numericValue, Double floatingPointValue, Integer rationalNumeratorValue, Long rationalDenominatorValue, CodedSequenceItem units, CodedSequenceItem qualifier)
           
 ContentItemFactory.PersonNameContentItem makePersonNameContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String stringValue)
           
 ContentItemFactory.SpatialCoordinates3DContentItem makeSpatialCoordinates3DContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String graphicType, float[] graphicData, String referencedFrameOfReferenceUID)
           
 ContentItemFactory.SpatialCoordinatesContentItem makeSpatialCoordinatesContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String graphicType, float[] graphicData)
           
 ContentItemFactory.TextContentItem makeTextContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String stringValue)
           
 ContentItemFactory.TimeContentItem makeTimeContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, String stringValue)
           
 ContentItemFactory.UIDContentItem makeUIDContentItem(ContentItem parent, String relationshipType, CodedSequenceItem conceptName, 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,
                                                                        String relationshipType,
                                                                        CodedSequenceItem conceptName,
                                                                        boolean continuityOfContentIsSeparate,
                                                                        String templateMappingResource,
                                                                        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,
                                                                        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,
                                                                        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,
                                                                        String relationshipType,
                                                                        CodedSequenceItem conceptName,
                                                                        String referencedSOPClassUID,
                                                                        String referencedSOPInstanceUID)
                                                                 throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
referencedSOPClassUID -
referencedSOPInstanceUID -
Throws:
DicomException

makeImageContentItem

public ContentItemFactory.ImageContentItem makeImageContentItem(ContentItem parent,
                                                                String relationshipType,
                                                                CodedSequenceItem conceptName,
                                                                String referencedSOPClassUID,
                                                                String referencedSOPInstanceUID,
                                                                int referencedFrameNumber,
                                                                int referencedSegmentNumber,
                                                                String presentationStateSOPClassUID,
                                                                String presentationStateSOPInstanceUID,
                                                                String realWorldValueMappingSOPClassUID,
                                                                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,
                                                                                          String relationshipType,
                                                                                          CodedSequenceItem conceptName,
                                                                                          String graphicType,
                                                                                          float[] graphicData)
                                                                                   throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
graphicType -
graphicData -
Throws:
DicomException

makeSpatialCoordinates3DContentItem

public ContentItemFactory.SpatialCoordinates3DContentItem makeSpatialCoordinates3DContentItem(ContentItem parent,
                                                                                              String relationshipType,
                                                                                              CodedSequenceItem conceptName,
                                                                                              String graphicType,
                                                                                              float[] graphicData,
                                                                                              String referencedFrameOfReferenceUID)
                                                                                       throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
graphicType -
graphicData -
Throws:
DicomException

makeNumericContentItem

public ContentItemFactory.NumericContentItem makeNumericContentItem(ContentItem parent,
                                                                    String relationshipType,
                                                                    CodedSequenceItem conceptName,
                                                                    String numericValue,
                                                                    CodedSequenceItem units,
                                                                    CodedSequenceItem qualifier)
                                                             throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
numericValue -
units -
qualifier -
Throws:
DicomException

makeNumericContentItem

public ContentItemFactory.NumericContentItem makeNumericContentItem(ContentItem parent,
                                                                    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,
                                                                    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,
                                                                    String relationshipType,
                                                                    CodedSequenceItem conceptName,
                                                                    String numericValue,
                                                                    Double floatingPointValue,
                                                                    Integer rationalNumeratorValue,
                                                                    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,
                                                              String relationshipType,
                                                              CodedSequenceItem conceptName,
                                                              CodedSequenceItem conceptCode)
                                                       throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
conceptCode -
Throws:
DicomException

codeContentItemValueMatchesCodeValueAndCodingSchemeDesignator

public static boolean codeContentItemValueMatchesCodeValueAndCodingSchemeDesignator(ContentItem ci,
                                                                                    String cvWanted,
                                                                                    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,
                                                                      String relationshipType,
                                                                      CodedSequenceItem conceptName,
                                                                      String stringValue)
                                                               throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
stringValue -
Throws:
DicomException

makeDateContentItem

public ContentItemFactory.DateContentItem makeDateContentItem(ContentItem parent,
                                                              String relationshipType,
                                                              CodedSequenceItem conceptName,
                                                              String stringValue)
                                                       throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
stringValue -
Throws:
DicomException

makeTimeContentItem

public ContentItemFactory.TimeContentItem makeTimeContentItem(ContentItem parent,
                                                              String relationshipType,
                                                              CodedSequenceItem conceptName,
                                                              String stringValue)
                                                       throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
stringValue -
Throws:
DicomException

makePersonNameContentItem

public ContentItemFactory.PersonNameContentItem makePersonNameContentItem(ContentItem parent,
                                                                          String relationshipType,
                                                                          CodedSequenceItem conceptName,
                                                                          String stringValue)
                                                                   throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
stringValue -
Throws:
DicomException

makeUIDContentItem

public ContentItemFactory.UIDContentItem makeUIDContentItem(ContentItem parent,
                                                            String relationshipType,
                                                            CodedSequenceItem conceptName,
                                                            String stringValue)
                                                     throws DicomException
Parameters:
parent -
relationshipType -
conceptName -
stringValue -
Throws:
DicomException

makeTextContentItem

public ContentItemFactory.TextContentItem makeTextContentItem(ContentItem parent,
                                                              String relationshipType,
                                                              CodedSequenceItem conceptName,
                                                              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