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:
StudyRootQueryInformationModel
Modifier and Type | Field and Description |
---|---|
protected Association |
cFindAssociation |
protected Association |
cMoveAssociation |
Constructor and 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.
|
Modifier and Type | Method and 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 |
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() |
protected Association cFindAssociation
protected Association cMoveAssociation
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:
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)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:
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 AssociationsDicomException
DicomNetworkException
java.io.IOException
protected abstract java.util.HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
ie
- protected AttributeTag getAttributeTagOfCountOfChildren(InformationEntity ie)
ie
- public final java.lang.String getCalledAETitle()
public final Association getCFindAssociation()
protected abstract InformationEntity getChildTypeForParent(InformationEntity ie)
ie
- public final Association getCMoveAssociation()
protected abstract java.lang.String getFindSOPClassUID()
protected abstract java.lang.String getMoveSOPClassUID()
public java.lang.String getQueryLevelName(InformationEntity ie)
ie
- protected abstract InformationEntity getRoot()
protected abstract java.lang.String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
ie
- responseIdentifier
- public AttributeTag getUniqueKeyForInformationEntity(InformationEntity ie)
ie
- public void performHierarchicalMove(AttributeList identifier) throws java.io.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.
identifier
- the move request identifier as a list of DICOM attributesjava.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 protocolpublic 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 the
calledAETitle
used in the constructor of this class instance.
identifier
- the move request identifier as a list of DICOM attributesretrieveAE
- the AE title of where to move the object(s) fromjava.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 protocolpublic 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.
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) tojava.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 protocolpublic 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 the moveDestination
into a presentation address (hostname and port number).
identifier
- the move request identifier as a list of DICOM attributesmoveDestination
- the AE title of where to move the object(s) tojava.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 protocolpublic 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.
filter
- the query request identifier as a list of DICOM attributesjava.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 protocolpublic void releaseAssociations() throws DicomNetworkException
Release any cached Associations.
DicomNetworkException
- thrown if there is a problem with the DICOM network protocolpublic java.lang.String toString()
toString
in class java.lang.Object