Class QueryInformationModel
- java.lang.Object
-
- com.pixelmed.query.QueryInformationModel
-
- Direct Known Subclasses:
StudyRootQueryInformationModel
public abstract class QueryInformationModel extends java.lang.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:
StudyRootQueryInformationModel
-
-
Field Summary
Fields Modifier and Type Field Description protected Association
cFindAssociation
protected Association
cMoveAssociation
-
Constructor Summary
Constructors Constructor Description QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle)
Construct a query information model.QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, boolean reuseAssociations)
Construct a query information model.QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel)
Construct a query information model.QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel, boolean reuseAssociations)
Construct a query information model.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.HashSet
getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
protected AttributeTag
getAttributeTagOfCountOfChildren(InformationEntity ie)
java.lang.String
getCalledAETitle()
Association
getCFindAssociation()
protected abstract InformationEntity
getChildTypeForParent(InformationEntity ie)
Association
getCMoveAssociation()
protected abstract java.lang.String
getFindSOPClassUID()
protected abstract java.lang.String
getMoveSOPClassUID()
java.lang.String
getQueryLevelName(InformationEntity ie)
protected abstract InformationEntity
getRoot()
protected abstract java.lang.String
getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
AttributeTag
getUniqueKeyForInformationEntity(InformationEntity ie)
void
performHierarchicalMove(AttributeList identifier)
Retrieve DICOM object(s).void
performHierarchicalMove(AttributeList identifier, java.lang.String retrieveAE)
void
performHierarchicalMoveFrom(AttributeList identifier, java.lang.String retrieveAE)
Retrieve DICOM object(s) from the specified location.void
performHierarchicalMoveFromTo(AttributeList identifier, java.lang.String retrieveAE, java.lang.String moveDestination)
Retrieve DICOM object(s) from the specified location to the specified location.void
performHierarchicalMoveTo(AttributeList identifier, java.lang.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.void
releaseAssociations()
Release any cached Associations.java.lang.String
toString()
-
-
-
Field Detail
-
cFindAssociation
protected Association cFindAssociation
-
cMoveAssociation
protected Association cMoveAssociation
-
-
Constructor Detail
-
QueryInformationModel
public QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel, boolean reuseAssociations) throws DicomException, DicomNetworkException, java.io.IOException
Construct a query information model.
Opens association to be reused if reuseAssociations is true otherwise restablishes them on demand.
Does not actually perform a query or retrieval; for that see:
- Parameters:
hostname
- their hostname or IP addressport
- their port numbercalledAETitle
- their AE titlecallingAETitle
- our AE title (both when we query or retrieve and where we are listening as a storage SCP)debugLevel
- unusedreuseAssociations
- keep alive and reuse Associations- Throws:
DicomException
DicomNetworkException
java.io.IOException
-
QueryInformationModel
public QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, boolean reuseAssociations) throws DicomException, DicomNetworkException, java.io.IOException
Construct a query information model.
Opens association to be reused if reuseAssociations is true otherwise restablishes them on demand.
Does not actually perform a query or retrieval; for that see:
- Parameters:
hostname
- their hostname or IP addressport
- their port numbercalledAETitle
- their AE titlecallingAETitle
- our AE title (both when we query or retrieve and where we are listening as a storage SCP)reuseAssociations
- keep alive and reuse Associations- Throws:
DicomException
DicomNetworkException
java.io.IOException
-
QueryInformationModel
public QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.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 addressport
- their port numbercalledAETitle
- their AE titlecallingAETitle
- our AE title (both when we query or retrieve and where we are listening as a storage SCP)debugLevel
- ignored
-
QueryInformationModel
public QueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle)
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 addressport
- their port numbercalledAETitle
- their AE titlecallingAETitle
- our AE title (both when we query or retrieve and where we are listening as a storage SCP)
-
-
Method Detail
-
getCFindAssociation
public final Association getCFindAssociation()
-
getCMoveAssociation
public final Association getCMoveAssociation()
-
getCalledAETitle
public final java.lang.String getCalledAETitle()
-
getRoot
protected abstract InformationEntity getRoot()
-
getChildTypeForParent
protected abstract InformationEntity getChildTypeForParent(InformationEntity ie)
- Parameters:
ie
-
-
getAllInformationEntitiesToIncludeAtThisQueryLevel
protected abstract java.util.HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
- Parameters:
ie
-
-
getFindSOPClassUID
protected abstract java.lang.String getFindSOPClassUID()
-
getMoveSOPClassUID
protected abstract java.lang.String getMoveSOPClassUID()
-
getStringValueForTreeFromResponseIdentifier
protected abstract java.lang.String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
- Parameters:
ie
-responseIdentifier
-
-
getQueryLevelName
public java.lang.String getQueryLevelName(InformationEntity ie)
- Parameters:
ie
-
-
getUniqueKeyForInformationEntity
public AttributeTag getUniqueKeyForInformationEntity(InformationEntity ie)
- Parameters:
ie
-
-
getAttributeTagOfCountOfChildren
protected AttributeTag getAttributeTagOfCountOfChildren(InformationEntity ie)
- Parameters:
ie
-
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
performHierarchicalQuery
public QueryTreeModel performHierarchicalQuery(AttributeList filter) throws java.io.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:
java.io.IOException
- thrown if there is an generic IO problemDicomException
- thrown if there is a problem performing or parsing the queryDicomNetworkException
- thrown if there is a problem with the DICOM network protocol
-
performHierarchicalMove
public void performHierarchicalMove(AttributeList identifier) throws java.io.IOException, DicomException, DicomNetworkException
Retrieve DICOM object(s).
Assumes that the objects are available at the
calledAETitle
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:
java.io.IOException
- thrown if there is an generic IO problemDicomException
- thrown if there is a problem performing or parsing the queryDicomNetworkException
- thrown if there is a problem with the DICOM network protocol
-
performHierarchicalMove
public void performHierarchicalMove(AttributeList identifier, java.lang.String retrieveAE) throws java.io.IOException, DicomException, DicomNetworkException
- Throws:
java.io.IOException
DicomException
DicomNetworkException
-
performHierarchicalMoveFrom
public void performHierarchicalMoveFrom(AttributeList identifier, java.lang.String retrieveAE) throws java.io.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 thecalledAETitle
used in the constructor of this class instance.- Parameters:
identifier
- the move request identifier as a list of DICOM attributesretrieveAE
- the AE title of where to move the object(s) from- Throws:
java.io.IOException
- thrown if there is an generic IO problemDicomException
- thrown if there is a problem performing or parsing the queryDicomNetworkException
- thrown if there is a problem with the DICOM network protocol
-
performHierarchicalMoveTo
public void performHierarchicalMoveTo(AttributeList identifier, java.lang.String moveDestination) throws java.io.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 themoveDestination
into a presentation address (hostname and port number).- Parameters:
identifier
- the move request identifier as a list of DICOM attributesmoveDestination
- the AE title of where to move the object(s) to- Throws:
java.io.IOException
- thrown if there is an generic IO problemDicomException
- thrown if there is a problem performing or parsing the queryDicomNetworkException
- thrown if there is a problem with the DICOM network protocol
-
performHierarchicalMoveFromTo
public void performHierarchicalMoveFromTo(AttributeList identifier, java.lang.String retrieveAE, java.lang.String moveDestination) throws java.io.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 attributesretrieveAE
- the AE title of where to move the object(s) frommoveDestination
- the AE title of where to move the object(s) to- Throws:
java.io.IOException
- thrown if there is an generic IO problemDicomException
- thrown if there is a problem performing or parsing the queryDicomNetworkException
- 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
-
-