public class StudyRootQueryInformationModel extends QueryInformationModel
The StudyRootQueryInformationModel
supports query and retrieval using the DICOM Study Root information model.
Specifically, all patient attributes are included at the level of the study, and below the study level are series and instance (image) levels.
For example, an application might instantiate a
StudyRootQueryInformationModel
, and
then actually perform a query (with debugging messages on) using a list of attributes as follows:
final QueryInformationModel model = new StudyRootQueryInformationModel("remotehost",104,"THEIRAET","OURAET",1); final QueryTreeModel tree = model.performHierarchicalQuery(identifier); System.err.println("Tree="+tree);
The attribute list supplied must contain both matching and response keys. By way of example, one could construct an identifier for a query of all the instances for a particular patient named "Smith^Mary" as follows
AttributeList identifier = new AttributeList(); { AttributeTag t = TagFromName.PatientName; Attribute a = new PersonNameAttribute(t,specificCharacterSet); a.addValue("Smith^Mary"); filter.put(t,a); } { AttributeTag t = TagFromName.PatientID; Attribute a = new ShortStringAttribute(t,specificCharacterSet); filter.put(t,a); } { AttributeTag t = TagFromName.PatientBirthDate; Attribute a = new DateAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.PatientSex; Attribute a = new CodeStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.StudyID; Attribute a = new ShortStringAttribute(t,specificCharacterSet); filter.put(t,a); } { AttributeTag t = TagFromName.StudyDescription; Attribute a = new LongStringAttribute(t,specificCharacterSet); filter.put(t,a); } { AttributeTag t = TagFromName.ModalitiesInStudy; Attribute a = new CodeStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.StudyDate; Attribute a = new DateAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.StudyTime; Attribute a = new TimeAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.PatientAge; Attribute a = new AgeStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SeriesDescription; Attribute a = new LongStringAttribute(t,specificCharacterSet); filter.put(t,a); } { AttributeTag t = TagFromName.SeriesNumber; Attribute a = new IntegerStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.Modality; Attribute a = new CodeStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SeriesDate; Attribute a = new DateAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SeriesTime; Attribute a = new TimeAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.InstanceNumber; Attribute a = new IntegerStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.ContentDate; Attribute a = new DateAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.ContentTime; Attribute a = new TimeAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.ImageType; Attribute a = new CodeStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.NumberOfFrames; Attribute a = new IntegerStringAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.StudyInstanceUID; Attribute a = new UniqueIdentifierAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SeriesInstanceUID; Attribute a = new UniqueIdentifierAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SOPInstanceUID; Attribute a = new UniqueIdentifierAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SOPClassUID; Attribute a = new UniqueIdentifierAttribute(t); filter.put(t,a); } { AttributeTag t = TagFromName.SpecificCharacterSet; Attribute a = new CodeStringAttribute(t); filter.put(t,a); a.addValue("ISO_IR 100"); }
The resulting tree will contain all the returned information at the study, series and instance (image) returned which match a PatientName of "Smith^Mary". If one wanted to filer the list of studies and series returned by a Modality of CT, then one could instead have created an identifier containing:
{ AttributeTag t = TagFromName.ModalitiesInStudy; Attribute a = new CodeStringAttribute(t); a.addValue("CT"); filter.put(t,a); } { AttributeTag t = TagFromName.Modality; Attribute a = new CodeStringAttribute(t); a.addValue("CT"); filter.put(t,a); }
Note that since ModalitiesInStudy is an optional matching key in DICOM, not all SCPs will support it, so one should also filter at the series level with Modality. In those cases "empty" study responses will be included when the study matches but there are no modality-specific series.
Note also that no "client side" filtering is performed ... that is the values for matching keys will be sent to the SCP, but if the SCP doesn't match on them and returns responses anyway, this class does not filter out those responses before returning them to the user (including them in the returned tree).
In a real application, the FilterPanel
class can be used to provide a user interface for editing the values in the
request identifier attribute list.
cFindAssociation, cMoveAssociation
Constructor and Description |
---|
StudyRootQueryInformationModel(java.lang.String hostname,
int port,
java.lang.String calledAETitle,
java.lang.String callingAETitle)
Construct a study root query information model.
|
StudyRootQueryInformationModel(java.lang.String hostname,
int port,
java.lang.String calledAETitle,
java.lang.String callingAETitle,
boolean reuseAssociations)
Construct a study root query information model.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.HashSet |
getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie) |
protected InformationEntity |
getChildTypeForParent(InformationEntity ie) |
protected java.lang.String |
getFindSOPClassUID() |
protected java.lang.String |
getMoveSOPClassUID() |
protected InformationEntity |
getRoot() |
protected java.lang.String |
getStringValueForTreeFromResponseIdentifier(InformationEntity ie,
AttributeList responseIdentifier) |
static void |
main(java.lang.String[] arg)
Unit testing.
|
getAttributeTagOfCountOfChildren, getCalledAETitle, getCFindAssociation, getCMoveAssociation, getQueryLevelName, getUniqueKeyForInformationEntity, performHierarchicalMove, performHierarchicalMoveFrom, performHierarchicalMoveFromTo, performHierarchicalMoveTo, performHierarchicalQuery, releaseAssociations, toString
public StudyRootQueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle)
Construct a study root query information model.
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 StudyRootQueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, boolean reuseAssociations) throws DicomNetworkException, DicomException, java.io.IOException
Construct a study root query information model.
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 java.util.HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
getAllInformationEntitiesToIncludeAtThisQueryLevel
in class QueryInformationModel
ie
- protected InformationEntity getChildTypeForParent(InformationEntity ie)
getChildTypeForParent
in class QueryInformationModel
ie
- protected java.lang.String getFindSOPClassUID()
getFindSOPClassUID
in class QueryInformationModel
protected java.lang.String getMoveSOPClassUID()
getMoveSOPClassUID
in class QueryInformationModel
protected InformationEntity getRoot()
getRoot
in class QueryInformationModel
protected java.lang.String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
getStringValueForTreeFromResponseIdentifier
in class QueryInformationModel
ie
- responseIdentifier
- public static void main(java.lang.String[] arg)
Unit testing.
arg
- an array of four strings, hostname, port, calledAETitle, callingAETitle