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:
StudyRootQueryInformationModel
Modifier and Type | Field and Description |
---|---|
protected Association |
cFindAssociation |
protected Association |
cMoveAssociation |
Constructor and Description |
---|
QueryInformationModel(String hostname,
int port,
String calledAETitle,
String callingAETitle)
Construct a query information model.
|
QueryInformationModel(String hostname,
int port,
String calledAETitle,
String callingAETitle,
boolean reuseAssociations)
Construct a query information model.
|
protected Association cFindAssociation
protected Association cMoveAssociation
public QueryInformationModel(String hostname, int port, String calledAETitle, 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(String hostname, int port, String calledAETitle, String callingAETitle, boolean reuseAssociations) throws DicomException, DicomNetworkException, 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
IOException
protected abstract HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
ie
- protected AttributeTag getAttributeTagOfCountOfChildren(InformationEntity ie)
ie
- public final String getCalledAETitle()
public final Association getCFindAssociation()
protected abstract InformationEntity getChildTypeForParent(InformationEntity ie)
ie
- public final Association getCMoveAssociation()
protected abstract String getFindSOPClassUID()
protected abstract String getMoveSOPClassUID()
public String getQueryLevelName(InformationEntity ie)
ie
- protected abstract InformationEntity getRoot()
protected abstract String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
ie
- responseIdentifier
- public AttributeTag getUniqueKeyForInformationEntity(InformationEntity ie)
ie
- 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.
identifier
- the move request identifier as a list of DICOM attributesIOException
- 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, 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.
identifier
- the move request identifier as a list of DICOM attributesretrieveAE
- the AE title of where to move the object(s) fromIOException
- 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, String retrieveAE, String moveDestination) throws 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) toIOException
- 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, 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).
identifier
- the move request identifier as a list of DICOM attributesmoveDestination
- the AE title of where to move the object(s) toIOException
- 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 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 attributesIOException
- 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 protocol