com.pixelmed.query
Class QueryInformationModel

java.lang.Object
  extended by 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.

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:
StudyRootQueryInformationModel

Field Summary
protected  int debugLevel
           
 
Constructor Summary
QueryInformationModel(String hostname, int port, String calledAETitle, String callingAETitle, int debugLevel)
          Construct a query information model.
 
Method Summary
protected abstract  HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
           
protected  AttributeTag getAttributeTagOfCountOfChildren(InformationEntity ie)
           
 String getCalledAETitle()
           
protected abstract  InformationEntity getChildTypeForParent(InformationEntity ie)
           
protected abstract  String getFindSOPClassUID()
           
protected abstract  String getMoveSOPClassUID()
           
 String getQueryLevelName(InformationEntity ie)
           
protected abstract  InformationEntity getRoot()
           
protected abstract  String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
           
 AttributeTag getUniqueKeyForInformationEntity(InformationEntity ie)
           
 void performHierarchicalMove(AttributeList identifier)
          Retrieve DICOM object(s).
 void performHierarchicalMove(AttributeList identifier, String retrieveAE)
          Deprecated. See performHierarchicalMoveFrom().
 void performHierarchicalMoveFrom(AttributeList identifier, String retrieveAE)
          Retrieve DICOM object(s) from the specified location.
 void performHierarchicalMoveFromTo(AttributeList identifier, String retrieveAE, String moveDestination)
          Retrieve DICOM object(s) from the specified location to the specified location.
 void performHierarchicalMoveTo(AttributeList identifier, String moveDestination)
          Retrieve DICOM object(s) to the specified location.
 QueryTreeModel performHierarchicalQuery(AttributeList filter)
          Perform a hierarchical query and return the response as a tree.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debugLevel

protected int debugLevel
Constructor Detail

QueryInformationModel

public QueryInformationModel(String hostname,
                             int port,
                             String calledAETitle,
                             String callingAETitle,
                             int debugLevel)

Construct a query information model.

Does not actually open an association or perform a query or retrieval; for that see:

Parameters:
hostname - their hostname or IP address
port - their port number
calledAETitle - their AE title
callingAETitle - our AE title (both when we query or retrieve and where we are listening as a storage SCP)
debugLevel - 0 is no debugging (silent), > 0 more verbose levels of debugging
Method Detail

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

performHierarchicalMove

public void performHierarchicalMove(AttributeList identifier,
                                    String retrieveAE)
                             throws IOException,
                                    DicomException,
                                    DicomNetworkException
Deprecated. See performHierarchicalMoveFrom().

Throws:
IOException
DicomException
DicomNetworkException

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