Class StudyRootQueryInformationModel
- java.lang.Object
-
- com.pixelmed.query.QueryInformationModel
-
- com.pixelmed.query.StudyRootQueryInformationModel
-
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.
-
-
Field Summary
-
Fields inherited from class com.pixelmed.query.QueryInformationModel
cFindAssociation, cMoveAssociation, debugLevel
-
-
Constructor Summary
Constructors Constructor Description StudyRootQueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel)
Construct a study root query information model.StudyRootQueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel, boolean reuseAssociations)
Construct a study root query information model.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class com.pixelmed.query.QueryInformationModel
getAttributeTagOfCountOfChildren, getCalledAETitle, getCFindAssociation, getCMoveAssociation, getQueryLevelName, getUniqueKeyForInformationEntity, performHierarchicalMove, performHierarchicalMove, performHierarchicalMoveFrom, performHierarchicalMoveFromTo, performHierarchicalMoveTo, performHierarchicalQuery, releaseAssociations, toString
-
-
-
-
Constructor Detail
-
StudyRootQueryInformationModel
public StudyRootQueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel, boolean reuseAssociations) throws DicomNetworkException, DicomException, java.io.IOException
Construct a study root query information model.
- 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
- 0 is no debugging (silent), > 0 more verbose levels of debuggingreuseAssociations
- keep alive and reuse Associations- Throws:
DicomException
DicomNetworkException
java.io.IOException
-
StudyRootQueryInformationModel
public StudyRootQueryInformationModel(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel)
Construct a study root query information model.
- 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
- 0 is no debugging (silent), > 0 more verbose levels of debugging
-
-
Method Detail
-
getRoot
protected InformationEntity getRoot()
- Specified by:
getRoot
in classQueryInformationModel
-
getChildTypeForParent
protected InformationEntity getChildTypeForParent(InformationEntity ie)
- Specified by:
getChildTypeForParent
in classQueryInformationModel
- Parameters:
ie
-
-
getAllInformationEntitiesToIncludeAtThisQueryLevel
protected java.util.HashSet getAllInformationEntitiesToIncludeAtThisQueryLevel(InformationEntity ie)
- Specified by:
getAllInformationEntitiesToIncludeAtThisQueryLevel
in classQueryInformationModel
- Parameters:
ie
-
-
getFindSOPClassUID
protected java.lang.String getFindSOPClassUID()
- Specified by:
getFindSOPClassUID
in classQueryInformationModel
-
getMoveSOPClassUID
protected java.lang.String getMoveSOPClassUID()
- Specified by:
getMoveSOPClassUID
in classQueryInformationModel
-
getStringValueForTreeFromResponseIdentifier
protected java.lang.String getStringValueForTreeFromResponseIdentifier(InformationEntity ie, AttributeList responseIdentifier)
- Specified by:
getStringValueForTreeFromResponseIdentifier
in classQueryInformationModel
- Parameters:
ie
-responseIdentifier
-
-
main
public static void main(java.lang.String[] arg)
Unit testing.
- Parameters:
arg
- an array of four strings, hostname, port, calledAETitle, callingAETitle
-
-