Class QueryInformationModel

java.lang.Object
com.pixelmed.query.QueryInformationModel
Direct Known Subclasses:
StudyRootQueryInformationModel

public abstract class QueryInformationModel extends Object

The QueryInformationModel class is an abstract class that contains the core functionality for performing DICOM query and retrieval over the network.

It hides the underlying DICOM network implementation.

Associations can be cached and reused.

Concrete sub-classes implement the behavior for specific query models, such as StudyRootQueryInformationModel, the description of which contains an exampleof building an identifier and performing a query.

The majority of methods are protected and are for the benefit of those implementing their own query models as concrete sub-classes. The public methods of primary interest to application builders are:

See Also:
  • Field Details

    • cFindAssociation

      protected Association cFindAssociation
    • cMoveAssociation

      protected Association cMoveAssociation
  • Constructor Details

  • Method Details

    • getCFindAssociation

      public final Association getCFindAssociation()
    • getCMoveAssociation

      public final Association getCMoveAssociation()
    • getCalledAETitle

      public final String getCalledAETitle()
    • getRoot

      protected abstract InformationEntity getRoot()
    • getChildTypeForParent

      protected abstract InformationEntity getChildTypeForParent(InformationEntity ie)
      Parameters:
      ie -
    • getAllInformationEntitiesToIncludeAtThisQueryLevel

      protected abstract HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
      Parameters:
      ie -
    • getFindSOPClassUID

      protected abstract String getFindSOPClassUID()
    • getMoveSOPClassUID

      protected abstract String getMoveSOPClassUID()
    • getStringValueForTreeFromResponseIdentifier

      protected abstract String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
      Parameters:
      ie -
      responseIdentifier -
    • getQueryLevelName

      public String getQueryLevelName(InformationEntity ie)
      Parameters:
      ie -
    • getUniqueKeyForInformationEntity

      public AttributeTag getUniqueKeyForInformationEntity(InformationEntity ie)
      Parameters:
      ie -
    • getAttributeTagOfCountOfChildren

      protected AttributeTag getAttributeTagOfCountOfChildren(InformationEntity ie)
      Parameters:
      ie -
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • performHierarchicalQuery

      public QueryTreeModel performHierarchicalQuery(AttributeList filter) throws IOException, DicomException, DicomNetworkException

      Perform a hierarchical query and return the response as a tree.

      Performs a query recursively from the requested level of the information model down to the lowest level of the query model, using the matching keys present in the supplied identifier (filter) (if any), requesting the return keys listed in the request identifier.

      It starts out at the highest level of the model, and for each response returned at that level, uses each unique key returned at that level of the response to perform another query at the next level down, and so on, recursively.

      The actual queries at lower levels may be deferred and not performed until the tree is actually expanded whilst browsing, to avoid delays in making the top level nodes available.

      If the filter contains the attributes to count the number of subsidiary entities (e.g., NumberOfStudyRelatedSeries), then an immediate subsidiary query to determine the presence and number of a node's children will be avoided, or at least deferred until that node is expanded when browsing.

      Parameters:
      filter - the query request identifier as a list of DICOM attributes
      Returns:
      the results of query as a tree suitable for browing
      Throws:
      IOException - thrown if there is an generic IO problem
      DicomException - thrown if there is a problem performing or parsing the query
      DicomNetworkException - thrown if there is a problem with the DICOM network protocol
    • performHierarchicalMove

      public void performHierarchicalMove(AttributeList identifier) throws IOException, DicomException, DicomNetworkException

      Retrieve DICOM object(s).

      Assumes that the objects are available at thecalledAETitle specified in the constructor in this class instance.

      Assumes that we have a storage SCP listening as the callingAETitle specified in the constructor in this class instance.

      Parameters:
      identifier - the move request identifier as a list of DICOM attributes
      Throws:
      IOException - thrown if there is an generic IO problem
      DicomException - thrown if there is a problem performing or parsing the query
      DicomNetworkException - thrown if there is a problem with the DICOM network protocol
    • performHierarchicalMoveFrom

      public void performHierarchicalMoveFrom(AttributeList identifier, String retrieveAE) throws IOException, DicomException, DicomNetworkException

      Retrieve DICOM object(s) from the specified location.

      Assumes that we have a storage SCP listening as the callingAETitle specified in the constructor in this class instance.

      Note that the retrieveAE argument may differ from the calledAETitle used in the constructor of this class instance.

      Parameters:
      identifier - the move request identifier as a list of DICOM attributes
      retrieveAE - the AE title of where to move the object(s) from
      Throws:
      IOException - thrown if there is an generic IO problem
      DicomException - thrown if there is a problem performing or parsing the query
      DicomNetworkException - thrown if there is a problem with the DICOM network protocol
    • performHierarchicalMoveTo

      public void performHierarchicalMoveTo(AttributeList identifier, String moveDestination) throws IOException, DicomException, DicomNetworkException

      Retrieve DICOM object(s) to the specified location.

      Assumes that the objects are available at the calledAETitle specified in the constructor in this class instance.

      Further assumes that calledAETitle knows how to resolve the moveDestination into a presentation address (hostname and port number).

      Parameters:
      identifier - the move request identifier as a list of DICOM attributes
      moveDestination - the AE title of where to move the object(s) to
      Throws:
      IOException - thrown if there is an generic IO problem
      DicomException - thrown if there is a problem performing or parsing the query
      DicomNetworkException - thrown if there is a problem with the DICOM network protocol
    • performHierarchicalMoveFromTo

      public void performHierarchicalMoveFromTo(AttributeList identifier, String retrieveAE, String moveDestination) throws IOException, DicomException, DicomNetworkException

      Retrieve DICOM object(s) from the specified location to the specified location.

      Parameters:
      identifier - the move request identifier as a list of DICOM attributes
      retrieveAE - the AE title of where to move the object(s) from
      moveDestination - the AE title of where to move the object(s) to
      Throws:
      IOException - thrown if there is an generic IO problem
      DicomException - thrown if there is a problem performing or parsing the query
      DicomNetworkException - thrown if there is a problem with the DICOM network protocol
    • releaseAssociations

      public void releaseAssociations() throws DicomNetworkException

      Release any cached Associations.

      Throws:
      DicomNetworkException - thrown if there is a problem with the DICOM network protocol